Data backup method and device, electronic equipment, storage medium and computer program product
By backing up JuiceFS's metadata in real-time in object storage, the problem of insufficient time and real-time performance of native backup tools is solved, and efficient data backup and fast data recovery are achieved.
Patent Information
- Application Number
- CN202411681975.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-28
AI Technical Summary
JuiceFS's native metadata backup tool only supports full backup, which results in a long time and a lot of resources when the metadata scale is large, and provides weak real-time performance, resulting in a high recovery point target in disaster scenarios, which may lead to data loss.
Real-time backup is achieved by storing the data to be backed up in the tag object stored in the object store and storing its metadata in the tag object's tag object. This method divides the data to be backed up into multiple sub-data and backs up each sub-data, reducing the amount of data backed up each time and improving backup efficiency.
It improves the efficiency of data backup, reduces the computing resource usage during the backup process, and can quickly recover data when the metadatabase encounters disaster, avoiding data loss.
Smart Images

Figure CN119718776A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data backup method, device, electronic device, storage medium and computer program product. Background Art
[0002] In related technologies, JuiceFS is a high-performance distributed file system. JuiceFS adopts an architecture that separates "data" and "metadata" storage, and implements the storage of high-performance distributed file systems on object storage. The metadata database is the core of JuiceFS. If the metadata database cannot provide services due to a disaster scenario, it also means that the corresponding data can no longer be used.
[0003] At this time, you can use JuiceFS's built-in data backup and recovery solution to recover data. JuiceFS's native metadata backup tool will query the full amount of database data and export the full amount of data in JSON format. And import and restore it to another database through the recovery tool. However, JuiceFS provides metadata backup and recovery functions, but there are limitations on the native function solution. That is, it only supports full backup, so when the metadata scale is large, the backup process takes a long time and consumes more resources. In addition, the use of regular full backup solutions provides weak real-time performance. In disaster recovery scenarios, it will cause a high recovery point objective (RPO). Once a catastrophic event occurs, more data will be lost. Summary of the invention
[0004] The embodiments of the present application provide a data backup method, device, electronic device, storage medium and computer program product, which can improve the efficiency of data backup and will not cause data recovery losses when the metadata database encounters a disaster and performs data recovery.
[0005] The technical solution of this application is implemented as follows:
[0006] The present application provides a data backup method, including:
[0007] While obtaining the data to be backed up, the data to be backed up is stored in a label object of the object storage, and metadata of the data to be backed up is stored in a label of the label object.
[0008] In the above solution, storing the data to be backed up in a label object of an object storage, and storing metadata of the data to be backed up in a label of the label object, includes:
[0009] storing first metadata of the data to be backed up in a first tag of a first tag object; wherein the first tag includes a first index;
[0010] Dividing the data to be backed up into a plurality of sub-data;
[0011] For each of the sub-data, the sub-data is stored in a corresponding second tag object, and the second metadata corresponding to the sub-data is stored in a second tag corresponding to the second tag object; wherein the second tag includes a second index, and each of the second tag objects is subordinate to the first tag object.
[0012] In the above scheme, while acquiring the data to be backed up, storing the data to be backed up in a tag object of the object storage, and storing the metadata of the data to be backed up in the tag of the tag object, the method further includes:
[0013] The file system metadata corresponding to the file system is stored in a predetermined object of the object storage; wherein the file system metadata includes: application database information, object storage information in the application database, and object storage login information.
[0014] In the above scheme, while acquiring the data to be backed up, storing the data to be backed up in a tag object of the object storage, and storing metadata of the data to be backed up in a tag of the tag object, the method further includes:
[0015] Traversing the tag corresponding to each tag object in the object storage to obtain the metadata of the data to be backed up;
[0016] The metadata is restored in the new metadata database.
[0017] In the above solution, before traversing the tag corresponding to each tag object in the object storage to obtain the metadata of the data to be backed up, the method further includes:
[0018] Initialize the new metadata database based on the relevant information of the preset database;
[0019] Predetermined objects in the object store are traversed to obtain file system metadata, and the file system metadata is restored in the new metadata repository.
[0020] In the above solution, traversing the tag corresponding to each tag object in the object storage to obtain the metadata of the data to be backed up includes:
[0021] Traverse the first tag of each first tag object to obtain the first metadata and the first index;
[0022] The second tag of each second tag object under each first tag object is traversed to obtain the second metadata and the second index corresponding to each sub-data.
[0023] In the above solution, restoring the metadata in the constructed metadata database includes:
[0024] The first metadata, the first index, and each of the second metadata and the second index subordinate to the first metadata are restored in the new metadata database according to the subordinate relationship.
[0025] The embodiment of the present application also provides a data backup device, including:
[0026] The backup unit is used to acquire the data to be backed up, store the data to be backed up in a label object of the object storage, and store metadata of the data to be backed up in a label of the label object.
[0027] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps in the above method when executing the computer program.
[0028] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are implemented.
[0029] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps in the above method when executed by a processor.
[0030] In an embodiment of the present application, while taking the data to be backed up, the data to be backed up is stored in a label object of the object storage, and the metadata of the data to be backed up is stored in the label of the label object. In this way, since each data to be backed up is backed up in real time, compared with the delayed full backup solution in the related art, the amount of data backed up each time is smaller, and less computing resources are occupied, thereby improving the backup efficiency. In addition, since each data to be backed up is backed up in real time in the object storage service in the present application, compared with the delayed full backup solution in the related art, the backup delay is smaller, that is, the metadata stored in the label of the object storage is completely consistent with the metadata of the actual stored data, and there will be no data loss when the metadata is restored. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the effects of the related technology provided by the embodiments of the present application;
[0032] Figure 2An optional flowchart of a data backup method provided in an embodiment of the present application;
[0033] Figure 3 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0034] Figure 4 An optional effect diagram of the data backup method provided in the embodiment of the present application;
[0035] Figure 5 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0036] Figure 6 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0037] Figure 7 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0038] Figure 8 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0039] Fig. 9 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0040] Fig.10 An optional flowchart of a data backup method provided in an embodiment of the present application;
[0041] Fig.11 A schematic diagram of the structure of a data backup device provided in an embodiment of the present application;
[0042] Fig.12 A hardware entity schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0044] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0045] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0047] Combination Figure 1 , the application architecture of JuiceFS in hyperconvergence infrastructure (HCI) products, showing how JuiceFS relies on two services when used in HCI products. JuiceFS uses an architecture that separates the storage of "object storage service" and "source database" to achieve the storage of high-performance distributed file systems on object storage. The metadata database is used to read and write metadata, and the object storage service is used to read and write file block data. The metadata database is the core of JuiceFS. If the metadata database cannot provide services due to disaster scenarios, it also means that the corresponding data can no longer be used. The data backup and recovery solution that comes with JuiceFS is not reliable enough at the product level:
[0048] After investigation, it was found that JuiceFS provides metadata backup and recovery functions, but there are limitations on the native function solution.
[0049] 1. Backup and recovery operations consume a lot of resources and take a long time: The original solution only supports full metadata backup, so when the metadata scale is large, the backup process takes a long time and consumes more resources. When doing backup and recovery, the RTO and RPO of the solution will increase linearly with the increase of data scale.
[0050] 2. Weak real-time performance: The regular full backup solution provides weak real-time performance. In disaster recovery scenarios, this will result in a high RPO. Once a catastrophic event occurs, a lot of data will be lost.
[0051] 3. Data consistency requirements lead to the need to suspend services: Due to the separated architecture, there is a certain time difference between the data in the metadata database and the object data on the object storage. During the writing of the changed data, there will definitely be a temporary mismatch between the data on both ends. Therefore, the native backup tool also requires that no changes be written to JuiceFS during the backup, otherwise data consistency cannot be guaranteed.
[0052] This application embodiment provides a data backup method, see Figure 2 , is an optional flow chart of the data backup method provided in the embodiment of the present application, which will be combined with Figure 2 The steps shown are explained:
[0053] S101. While acquiring data to be backed up, store the data to be backed up in a label object of an object storage, and store metadata of the data to be backed up in a label of the label object.
[0054] In the embodiment of the present application, the data backup device can obtain the data to be backed up from other devices or nodes. When obtaining the data to be backed up, the data to be backed up is stored in a label object of a local object storage service, and metadata of the data to be backed up is extracted, and the extracted metadata is stored in a label of the label object.
[0055] The data backup device may be an HCI platform. In other embodiments, the data backup device may also be other data storage servers or cloud servers, etc. Metadata: data describing data, such as the name, size, type, and other information of a file.
[0056] The tag object can be an object in the object storage that has been tagged through the Tagging interface. Tagging: A function in the object storage that allows users to add tags to objects to store additional information. Object Storage: A storage architecture that stores data in units of objects.
[0057] In some other embodiments, the data backup device may divide the data to be backed up into multiple blocks of data, back up each block of data in a corresponding label object, and back up metadata corresponding to each block of data in a label of the corresponding label object.
[0058] The metadata real-time backup and recovery technology in the embodiments of the present application can be applied to various types of products, including but not limited to HCI products and all products using JuiceFS. Object storage providers can be replaced by all object storage providers compatible with the S3 protocol, including but not limited to Amazon (Amazon Web Services, AWS) object storage service, Wasabi object storage service, Minio object storage service, etc.
[0059] In an embodiment of the present application, while taking the data to be backed up, the data to be backed up is stored in a label object of the object storage, and the metadata of the data to be backed up is stored in the label of the label object. In this way, since each data to be backed up is backed up in real time, compared with the delayed full backup solution in the related art, the amount of data backed up each time is smaller, and less computing resources are occupied, thereby improving the backup efficiency. In addition, since each data to be backed up is backed up in real time in the object storage service in the present application, compared with the delayed full backup solution in the related art, the backup delay is smaller, that is, the metadata stored in the label of the object storage is completely consistent with the metadata of the actual stored data, and there will be no data loss when the metadata is restored.
[0060] In an embodiment of the present application, a data backup method is proposed, which can save, back up and restore the data of the metadata database in the event that the metadata database is damaged, which will enhance the reliability of JuiceFS in this scenario.
[0061] This application saves the core data metadata required for file recovery by making use of the ability to store extended information in object storage (Tagging function). When the metadata is damaged, the metadata in the object storage is used to rebuild the metadata, providing a solution to ensure the security of the metadata. Through the Tagging function of the object storage, the real-time synchronization and rapid recovery of the JuiceFS file system metadata are achieved. The key technical points include: when the file system is formatted, the file system metadata is saved to a specific object of the object storage. Using the Tagging function of the object storage, the metadata information of files and directories is synchronized in real time to the object tag named after the inode ID. A rapid recovery method is provided when the metadata is damaged, and the metadata database is rebuilt by traversing the tag information on the object storage.
[0062] Problems that the technical solution of the present invention will solve:
[0063] (1) Data loss after metadata database failure:
[0064] After the JuiceFS metadata database fails, there is still a copy of the data directly stored in the tagging of the object storage. A metadata database with consistent data can be restored again only by relying on the data in the object storage.
[0065] (2) Full backup is time-consuming and resource-consuming:
[0066] By storing metadata on the corresponding object through the Tagging interface each time an object is uploaded to the object storage service, the real-time backup effect is achieved without the need for subsequent full backup. The backup and recovery time and computing resources consumed will no longer increase due to the size of the backup data.
[0067] (3) Ensuring data consistency requires that the business stop writing to the file system:
[0068] The real-time backup function ensures the consistency of metadata and objects on the object storage. There is no need to stop business when performing backup, and changes can still be made to the JuiceFS file system.
[0069] See also Figure 3 , is an optional flow chart of the data backup method provided in the embodiment of the present application, Figure 2 The illustrated S101 can also be implemented through S201 to S203, which will be described in conjunction with the steps:
[0070] S201. Store first metadata of the data to be backed up in a first tag of a first tag object; wherein the first tag object includes a first index.
[0071] In the embodiment of the present application, the data backup device extracts corresponding first metadata based on the acquired data to be backed up, and stores the first metadata in a first tag of a first tag object through a tagging interface.
[0072] The first metadata may include information such as the name, size, storage time, and data type of the data to be backed up. The first tag includes a corresponding first index.
[0073] The first label object may be an object named with an inode ID. An inode ID is an index node identifier in a file system and is used to uniquely identify a file or directory.
[0074] S202: Divide the data to be backed up into multiple sub-data.
[0075] In the embodiment of the present application, the data backup device divides the data to be backed up into a plurality of sub-data.
[0076] S203: For each sub-data, store the sub-data in a corresponding second tag object, and store second metadata corresponding to the sub-data in a second tag corresponding to the second tag object.
[0077] In an embodiment of the present application, for each sub-data, the data backup device extracts the second metadata of each sub-data, stores each sub-data in a corresponding second tag object through a tagging interface, and stores the second metadata of each sub-data in a second tag corresponding to the corresponding second tag.
[0078] The second metadata may include information such as the name, size, storage time and data type of the corresponding sub-data. The second tag includes the corresponding second index. The first tag object may also be an object named by inode ID. Each second tag object is subordinate to the first tag object.
[0079] In some other embodiments, the data storage device receives a delete command for the data to be backed up, deletes the first metadata in the first tag, deletes the corresponding sub-data in the second tag object under the first tag object, and deletes the second metadata in the second tag of each second tag object.
[0080] In an embodiment of the present application, the first metadata of the data to be backed up is stored in the first tag of the first tag object; wherein the first tag object corresponds to the first index. The data to be backed up is divided into a plurality of sub-data. For each of the sub-data, the sub-data is stored in the corresponding second tag object, and the second metadata corresponding to the sub-data is stored in the second tag corresponding to the second tag object. In this way, after a disaster occurs to the metadata database, a new metadata database can still be restored from the metadata in the first tag and the second tag as long as the object storage service is normal, so that no data loss will be caused when the data is restored.
[0081] See also Figure 4 , is an optional flow chart of the data backup method provided in the embodiment of the present application, Figure 2 The S101 shown may also include S301 implementation, which will be described in combination with the steps:
[0082] S301: Store the file system metadata corresponding to the file system in a predetermined object of the object storage.
[0083] In the embodiment of the present application, when the data backup device performs JuiceFS formatting, the file system metadata of the file system may be stored in a predetermined object of the object storage service.
[0084] Among them, the file system is the method and data structure used by the operating system to identify files on storage devices (commonly disks, but also solid-state drives based on NAND Flash) or partitions; that is, the method of organizing files on storage devices.
[0085] The file system metadata includes: database information of the data backup device application, object storage information in the application database, and object storage login information (including login account information and login password information).
[0086] Combination Figure 5, showing the solution in this application, after the metadata database that has crashed cannot read data, HCI can restore and rebuild a metadata database with consistent data through the real-time backup metadata on the object storage service on the JuiceFS system, and then continue to use it normally.
[0087] In the embodiment of the present application, the file system metadata corresponding to the file system is stored in the predetermined object of the object storage. In this way, after the metadata database encounters a disaster, as long as the object storage service is normal, the file system metadata of the file system can be restored from the predetermined object, thereby helping the data backup device to build a complete data storage service system based on the file system metadata.
[0088] See also Figure 6 , is an optional flow chart of the data backup method provided in the embodiment of the present application, which will be described in combination with the steps:
[0089] S11. Save the key information of the file system to a specified object of the object storage.
[0090] In the embodiment of the present application, when JuiceFS is formatted, the data backup device saves the key information of the file system to a designated object of the object storage.
[0091] S12. Save the name, size, time, type and other information into the label of the object named by the inode ID.
[0092] In the embodiment of the present application, when the data backup device is creating files / directories for the data to be backed up, the data backup device saves the first metadata (name, size, time, type and other information) to the first label of the first label object named by the inode ID.
[0093] S13. Update the corresponding file information on the label of the object storage.
[0094] In an embodiment of the present application, when the data backup device writes a label object for the data to be backed up, it divides the data to be backed up into multiple sub-data, extracts the second metadata of each sub-data, stores each sub-data in the second label object corresponding to the first label, and stores the corresponding second metadata in the second label of the corresponding second label object.
[0095] S14. Synchronously delete metadata information corresponding to the file.
[0096] In an embodiment of the present application, the data storage device receives a deletion command for the data to be backed up, deletes the first metadata in the first tag, deletes the corresponding sub-data in the second tag object under the first tag object, and deletes the second metadata in the second tag of each second tag object.
[0097] See also Figure 7 , is an optional flow chart of the data backup method provided in the embodiment of the present application, Figure 1 The process of step S101 may further include: S401 to S402, which will be described in combination with the steps:
[0098] S401: traverse the tag corresponding to each tag object in the object storage to obtain the metadata of the data to be backed up.
[0099] In an embodiment of the present application, after a metadata database encounters a disaster, the metadata in the metadata database cannot be used to restore the corresponding data. The data backup device traverses the tags corresponding to each tag in the object storage service and extracts the metadata of the data to be backed up from the tags of the tag objects.
[0100] S402: Restore the metadata into a new metadata database.
[0101] In the embodiment of the present application, after the metadata database encounters a disaster, the data backup device can initialize a new metadata database in the JuiceFS system and restore the metadata obtained in S401 to the new metadata database.
[0102] In some embodiments, the metadata repository may be a MySQL database, and in other embodiments, the metadata repository may be other databases.
[0103] In the embodiment of the present application, the tag corresponding to each tag object in the object storage is traversed to obtain the metadata of the data to be backed up. The metadata is restored in the new metadata database. In this way, after the metadata database encounters a disaster, as long as the object storage service is normal, the metadata of the data to be backed up can be obtained from the tag of the tag object, so that when the data is restored, no data loss will be caused.
[0104] See also Figure 8 , is an optional flow chart of the data backup method provided in the embodiment of the present application, Figure 6 The process before S401 shown may also include: S501 to S502, which will be described in combination with the steps:
[0105] S501: Initialize and obtain the new metadata database based on the relevant information of the preset database.
[0106] In the embodiment of the present application, after the metadata database encounters a disaster, the data backup device can initialize a new metadata database based on the relevant information of the MySQL database.
[0107] S502: traverse predetermined objects in the object storage, obtain file system metadata, and restore the file system metadata in the new metadata repository.
[0108] In the embodiment of the present application, the data backup device traverses the predetermined objects in the object storage server, obtains the file system metadata from the predetermined objects, and restores the obtained file system metadata into the new metadata database.
[0109] In the embodiment of the present application, the new metadata database is initialized based on the information related to the preset database. The predetermined objects of the object storage are traversed to obtain the file system metadata, and the file system metadata is restored in the new metadata database. In this way, after the metadata database encounters a disaster, a new metadata database can be quickly created based on the information related to the preset database, and as long as the object storage service is normal, the file system metadata of the file system can be restored from the predetermined objects, thereby helping the data backup device to build a complete data storage service system based on the file system metadata.
[0110] See also Fig. 9 , is an optional flow chart of the data backup method provided in the embodiment of the present application, Figure 6 The steps S401 to S402 shown can also be performed through S601 to S603, which will be described in combination with the steps:
[0111] S601: traverse the first tag of each first tag object to obtain first metadata and a first index.
[0112] In an embodiment of the present application, the data backup device traverses each first label object in the object storage service, and obtains the first metadata and the first index corresponding to the first label object from the first label of each label object.
[0113] S602: traverse the second tag of each second tag object under each first tag object, and obtain the second metadata and the second index corresponding to each sub-data.
[0114] In the embodiment of the present application, since the first label object has multiple second label objects under it, the data backup device can traverse the second label of each second label object under the first label object, and obtain the second metadata of the corresponding sub-data and the second index corresponding to the second label object from each second label.
[0115] S603: restore the first metadata, the first index, and each of the second metadata and the second index subordinate to the first metadata in the new metadata database according to a subordinate relationship.
[0116] In the embodiment of the present application, the data backup device can restore the first metadata, the first index, and each second metadata and second index subordinate to each first metadata in the new metadata database according to the corresponding subordinate relationship.
[0117] In an embodiment of the present application, the first label of each first label object is traversed to obtain the first metadata and the first index. The second label of each second label object under each first label object is traversed to obtain the second metadata and the second index corresponding to each sub-data. The first metadata, the first index, and the second metadata and the second index of each subordinate to the first metadata are restored in the new metadata database according to the subordinate relationship. In this way, after the metadata database encounters a disaster, as long as the object storage service is normal, the corresponding data can be restored based on the first label, the first metadata and the first index, and the second metadata and the second index in the second label, so that no data loss will occur when the data is restored.
[0118] See also Fig.10 , is an optional flow chart of the data backup method provided in the embodiment of the present application, which will be described in combination with the steps:
[0119] S15. Use an empty metadata database to initialize the corresponding table structure.
[0120] In the embodiment of the present application, the data backup device can initialize a new metadata base based on the relevant information of the metadata base.
[0121] S16. Restore the metadata of the file system on the object storage to the new metadata database.
[0122] In the embodiment of the present application, the data backup device can search for the file system metadata of the file system in the predetermined object of the object storage service, and restore the found file system metadata to the new metadata database.
[0123] S17. Restore the metadata of the file on the object storage to the new metadata database.
[0124] In an embodiment of the present application, the data backup device can traverse the first label object on the object storage service, obtain the first metadata of the data to be backed up from the first label of the first label object, and restore the first metadata in the new metadata database.
[0125] S18. Restore the data objects of the files in the object storage to the new metadata repository.
[0126] In the embodiment of the present application, the data backup device can traverse the second label of each second label object under the first label object, and obtain the second metadata and the second index of each sub-data from the second label.
[0127] See also Fig.11 , is a schematic diagram of the structure of a data backup device provided in an embodiment of the present application.
[0128] The embodiment of the present application provides a data backup device 800 , including: a backup unit 801 .
[0129] The backup unit 801 is used to acquire the data to be backed up, store the data to be backed up in a label object of the object storage, and store metadata of the data to be backed up in a label of the label object.
[0130] In the embodiment of the present application, the backup unit 801 in the data backup device 800 is used to store the first metadata of the data to be backed up in the first tag of the first tag object; wherein the first tag includes a first index;
[0131] Dividing the data to be backed up into a plurality of sub-data;
[0132] For each of the sub-data, the sub-data is stored in a corresponding second tag object, and the second metadata corresponding to the sub-data is stored in a second tag corresponding to the second tag object; wherein the second tag includes a second index, and each of the second tag objects is subordinate to the first tag object.
[0133] In an embodiment of the present application, the backup unit 801 in the data backup device 800 is used to store the file system metadata corresponding to the file system in a predetermined object of the object storage; wherein the file system metadata includes: application database information, object storage information in the application database, and object storage login information.
[0134] In the embodiment of the present application, the backup unit 801 in the data backup device 800 is used to traverse the label corresponding to each label object in the object storage to obtain the metadata of the data to be backed up;
[0135] The metadata is restored in the new metadata database.
[0136] In the embodiment of the present application, the backup unit 801 in the data backup device 800 is used to initialize the new metadata database based on the relevant information of the preset database;
[0137] Predetermined objects in the object store are traversed to obtain file system metadata, and the file system metadata is restored in the new metadata repository.
[0138] In the embodiment of the present application, the backup unit 801 in the data backup device 800 is used to traverse the first tag of each first tag object to obtain the first metadata and the first index;
[0139] The second tag of each second tag object under each first tag object is traversed to obtain the second metadata and the second index corresponding to each sub-data.
[0140] In the embodiment of the present application, the backup unit 801 in the data backup device 800 is used to restore the first metadata, the first index, and each of the second metadata and the second index subordinate to the first metadata in the new metadata database according to the subordinate relationship.
[0141] It should be noted that in the embodiment of the present application, if the above-mentioned data backup method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a data backup device (which can be a personal computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0142] Correspondingly, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps in the data backup device method when executed by a processor.
[0143] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0144] It should be noted that Fig.12 A hardware entity diagram of an electronic device provided in an embodiment of the present application, such as Fig.12 As shown, an embodiment of the present application provides an electronic device 900, including a memory 902 and a processor 901, wherein the memory 902 stores a computer program that can be run on the processor 901, and the processor 901 implements the steps in the above method when executing the program, wherein;
[0145] The processor 901 generally controls the overall operation of the electronic device 900 .
[0146] The memory 902 is configured to store instructions and applications executable by the processor 901, and can also cache data to be processed or processed by the processor 901 and various modules in the electronic device 900 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0147] Correspondingly, an embodiment of the present application further provides a computer program product, including a computer program, which can be executed by the processor 901 of the electronic device 900 to complete the steps in the data backup device method.
[0148] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0149] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0150] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0151] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0152] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0153] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a magnetic disk or an optical disk, and other media that can store program codes.
[0154] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a mobile storage device, a ROM, a magnetic disk, or an optical disk.
[0155] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data backup method, characterized in that: include: While acquiring the data to be backed up, the data to be backed up is stored in a label object of the object storage, and metadata of the data to be backed up is stored in a label of the label object.
2. The data backup method according to claim 1, characterized in that: The storing the data to be backed up in a label object of the object storage, and storing metadata of the data to be backed up in a label of the label object, includes: storing first metadata of the data to be backed up in a first tag of a first tag object; wherein the first tag includes a first index; Dividing the data to be backed up into a plurality of sub-data; For each of the sub-data, the sub-data is stored in a corresponding second tag object, and the second metadata corresponding to the sub-data is stored in a second tag corresponding to the second tag object; wherein the second tag includes a second index, and each of the second tag objects is subordinate to the first tag object.
3. The data backup method according to claim 1, characterized in that: While acquiring the data to be backed up, storing the data to be backed up in a label object of the object storage, and storing metadata of the data to be backed up in a label of the label object, the method further includes: The file system metadata corresponding to the file system is stored in a predetermined object of the object storage; wherein the file system metadata includes: application database information, object storage information in the application database, and object storage login information.
4. The data backup method according to any one of 1 to 3, characterized in that: While acquiring the data to be backed up, after storing the data to be backed up in a label object of the object storage and storing metadata of the data to be backed up in a label of the label object, the method further includes: Traversing the tag corresponding to each tag object in the object storage to obtain the metadata of the data to be backed up; The metadata is restored in the new metadata database.
5. The data backup method according to claim 4, characterized in that: Before traversing the tag corresponding to each tag object in the object storage to obtain the metadata of the data to be backed up, the method further includes: Initialize the new metadata database based on the relevant information of the preset database; Predetermined objects in the object store are traversed to obtain file system metadata, and the file system metadata is restored in the new metadata repository.
6. The data backup method according to claim 4, characterized in that: The traversing the tag corresponding to each tag object in the object storage to obtain the metadata of the data to be backed up includes: Traverse the first tag of each first tag object to obtain the first metadata and the first index; The second tag of each second tag object under each first tag object is traversed to obtain the second metadata and the second index corresponding to each sub-data.
7. The data backup method according to claim 6, characterized in that: The step of restoring the metadata in the constructed metadata database includes: The first metadata, the first index, and each of the second metadata and the second index subordinate to the first metadata are restored in the new metadata database according to the subordinate relationship.
8. A data backup device, characterized in that: include: The backup unit is used to acquire the data to be backed up, store the data to be backed up in a label object of the object storage, and store metadata of the data to be backed up in a label of the label object.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps in the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that The computer program implements the steps of the method according to any one of claims 1 to 7 when executed by a processor.