A backup method and related apparatus

By comparing checksums and updating path lists between the OBS server and the database system, the problem of low backup efficiency caused by the increase in data volume in cloud database backup is solved, realizing a more efficient backup method, reducing data upload volume and improving backup performance.

CN114201337BActive Publication Date: 2026-04-21HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
Filing Date
2020-09-02
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing cloud database backup methods become increasingly costly to perform regular full backups as data volume increases, especially as the challenge of completing backups within a specified time window becomes more and more significant, leading to low backup efficiency.

Method used

By comparing the checksum between the OBS server and the database system, it is determined whether the file to be uploaded is the same as the existing historical file. If they are the same, they are copied to the preset backup path to avoid duplicate uploads. If they are different, they are uploaded normally. The backup efficiency is improved by updating the path list.

Benefits of technology

It reduces the amount of data uploaded for backup, improves backup performance and efficiency, reduces the amount of data transmitted over the network, and improves the accuracy and speed of backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114201337B_ABST
    Figure CN114201337B_ABST
Patent Text Reader

Abstract

This application provides a backup method, comprising: an Object Storage Service (OBS) server obtaining a first checksum of the file to be uploaded and a list of object file paths to be matched from a database system; the OBS server obtaining a second checksum of the object file to be matched corresponding to the object file in the list of object file paths; if the first checksum and the second checksum are the same, the OBS server copying the object file to be matched to a preset backup path. This application avoids duplicate file uploads by comparing the content of the file to be uploaded with existing historical files in the OBS server, thereby reducing the amount of data uploaded for backup and improving backup performance. Furthermore, by using the list of object file paths to be matched, potentially identical files to be matched are identified, narrowing the range of matching files and improving backup efficiency. Furthermore, by using checksums to determine file similarity, reading file content is avoided, improving backup efficiency and accuracy. This application also provides related apparatus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data backup technology, and in particular to a backup method and related apparatus. Background Technology

[0002] In database systems, to prevent data corruption, a suitable backup plan needs to be specified for the data, storing the data in a database used for backup. Backup methods can be categorized into full backups and incremental backups. A full backup backs up all data to the database, while an incremental backup compares the data with historical backups and backs up only the newly added data.

[0003] Most current backup methods employ a combination of "full backup + incremental backup" to reduce the amount of backup data, such as performing a full backup weekly and an incremental backup daily. This effectively avoids the large amount of data required for a full backup while also ensuring data recovery performance and maintaining the availability of the database system.

[0004] However, existing cloud databases have seen a significant increase in data volume as usage time increases, making regular full backups increasingly costly, especially given the growing challenge of completing full backups within a specified time window. Summary of the Invention

[0005] This application provides a backup method and related apparatus that can reduce the amount of data uploaded for backup and improve backup performance.

[0006] In a first aspect, embodiments of this application provide a backup method, comprising: an object storage service (OBS) server obtaining a first verification value of a file to be uploaded and a list of object file paths to be matched from a database system; the OBS server obtaining a second verification value of an object file to be matched corresponding to the list of object file paths to be matched; if the first verification value is the same as the second verification value, the OBS server copying the object file to be matched to a preset backup path.

[0007] This application embodiment avoids duplicate file uploads by comparing the content of the file to be uploaded with existing historical files in the OBS server, thereby reducing the amount of data uploaded for backup and improving backup performance. Furthermore, by using a list of file paths to be matched, potentially identical files are identified, narrowing down the range of matching files and improving backup efficiency. Furthermore, by using checksums to determine file similarity, file content reading is avoided, further improving backup efficiency and accuracy.

[0008] In conjunction with the first aspect, in one implementation of this application embodiment, the method further includes: if the first verification value is different from the current second verification value, then the OBS server compares whether the first verification value and the next second verification value are the same; if the first verification value is different from all the second verification values, then the OBS server returns first synthesis failure information to the database system, the first synthesis failure information being used to instruct the database system to upload the file to be uploaded to the OBS server.

[0009] In conjunction with the first aspect, in one implementation of this application embodiment, after the OBS server returns the first synthesis failure information to the database system, the method further includes: the OBS server saving the file to be uploaded to the preset backup path.

[0010] In conjunction with the first aspect, in one implementation of this application embodiment, the method further includes: the OBS server sending the preset backup path to the database system, so that the database system updates the list of object file paths to be matched according to the preset backup path.

[0011] In conjunction with the first aspect, in one implementation of this application embodiment, the method further includes: if the OBS server fails to copy the file to be matched to a preset backup path, the OBS server returns a second synthesis failure message to the database system, the second synthesis failure message being used to instruct the database system to upload the file to be uploaded to the OBS server.

[0012] Secondly, embodiments of this application provide a backup method, comprising: a database system obtaining a first verification value of a file to be uploaded; the database system obtaining a second verification value of a file to be matched corresponding to a list of file paths to be matched from an OBS server; if the first verification value is the same as the second verification value, the database system sending an instruction message to the OBS server, the instruction message being used to instruct the OBS server to copy the file to be matched corresponding to the second verification value to a preset backup path.

[0013] In conjunction with the second aspect, in one implementation of this application embodiment, the method further includes: if the first verification value is not the same as the current second verification value, the database system compares whether the first verification value and the next second verification value are the same; compares whether the first verification value and the next second verification value are the same; if the first verification value is not the same as all the second verification values, the database system uploads the file to be uploaded to the OBS server, so that the OBS server saves the file to be uploaded to the preset backup path.

[0014] In conjunction with the second aspect, in one implementation of this application embodiment, the method further includes: the database system obtaining the preset backup path from the OBS server; and the database system updating the list of object file paths to be matched according to the preset backup path.

[0015] In conjunction with the second aspect, in one implementation of this application embodiment, the method further includes: the database system obtaining second synthesis failure information from the OBS server; and in response to the second synthesis failure information, the database system uploading the file to be uploaded to the OBS server.

[0016] Thirdly, embodiments of this application provide a backup device, comprising: an acquisition module, configured to acquire a first verification value of a file to be uploaded and a list of file paths to be matched from a database system; the acquisition module is further configured to acquire a second verification value of a file to be matched corresponding to the list of file paths to be matched; and a processing module, configured to copy the file to be matched to a preset backup path if the first verification value is the same as the second verification value.

[0017] In conjunction with the third aspect, in one implementation of this application embodiment, the processing module is further configured to: if the first verification value is not the same as the current second verification value, compare whether the first verification value and the next second verification value are the same; the processing module is further configured to: if the first verification value is not the same as all the second verification values, return first synthesis failure information to the database system, the first synthesis failure information being used to instruct the database system to upload the file to be uploaded to the OBS server.

[0018] In conjunction with the third aspect, in one implementation of the embodiments of this application, the processing module is further configured to save the file to be uploaded to the preset backup path.

[0019] In conjunction with the third aspect, in one implementation of the embodiments of this application, the processing module is further configured to send the preset backup path to the database system, so that the database system updates the list of object file paths to be matched according to the preset backup path.

[0020] In conjunction with the third aspect, in one implementation of the embodiments of this application, the processing module is further configured to return a second synthesis failure message to the database system if the OBS server fails to copy the file to be matched to the preset backup path. The second synthesis failure message is used to instruct the database system to upload the file to be uploaded to the OBS server.

[0021] Fourthly, embodiments of this application provide a backup device, comprising: an acquisition module, configured to acquire a first verification value of a file to be uploaded; the acquisition module is further configured to acquire a second verification value of a file to be matched corresponding to a list of file paths to be matched from an OBS server; and a processing module, configured to send an instruction message to the OBS server if the first verification value is the same as the second verification value, the instruction message being configured to instruct the OBS server to copy the file to be matched corresponding to the second verification value to a preset backup path.

[0022] In conjunction with the fourth aspect, in one implementation of the embodiments of this application, the processing module is further configured to: if the first verification value is not the same as the current second verification value, compare whether the first verification value and the next second verification value are the same; compare whether the first verification value and the next second verification value are the same; the processing module is further configured to: if the first verification value is not the same as all the second verification values, upload the file to be uploaded to the OBS server, so that the OBS server saves the file to be uploaded to the preset backup path.

[0023] In conjunction with the fourth aspect, in one implementation of the embodiments of this application, the acquisition module is further configured to acquire the preset backup path from the OBS server; the processing module is further configured to update the list of object file paths to be matched according to the preset backup path.

[0024] In conjunction with the fourth aspect, in one implementation of the embodiments of this application, the acquisition module is further configured to acquire second synthesis failure information from the OBS server; the processing module is further configured to upload the file to be uploaded to the OBS server in response to the second synthesis failure information.

[0025] Fifthly, embodiments of this application provide an OBS server, including a processor and a memory; the processor and the memory communicate with each other; the memory is used to store instructions; the processor is used to execute the instructions in the memory to perform the method as described in the first aspect.

[0026] In a sixth aspect, embodiments of this application provide a database system, including a processor and a memory; the processor and the memory communicate with each other; the memory is used to store instructions; the processor is used to execute the instructions in the memory to perform the method as described in the second aspect.

[0027] In a seventh aspect, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method as described in the first or second aspect. Attached Figure Description

[0028] Figure 1 These are schematic diagrams illustrating some of the more common damage scenarios;

[0029] Figure 2 This is a schematic diagram of cloud storage in one embodiment of this application;

[0030] Figure 3 This is another schematic diagram of cloud storage in the embodiments of this application;

[0031] Figure 4 A flowchart illustrating the backup method provided in the embodiments of this application;

[0032] Figure 5 A schematic diagram illustrating a backup application example provided in this application;

[0033] Figure 6 In order to be in Figure 5 Based on the implementation of this application Figure 4 A schematic diagram of the backup method shown;

[0034] Figure 7 for Figure 6 The method flowchart corresponding to the application example;

[0035] Figure 8 A schematic diagram of another embodiment of the backup method provided in this application;

[0036] Figure 9 This application is based on Figure 5 A diagram illustrating the application example of performing a backup again;

[0037] Figure 10 for Figure 9 The corresponding flowchart;

[0038] Figure 11 This is a schematic diagram of a backup device according to an embodiment of this application;

[0039] Figure 12 This is a schematic diagram of another backup device in the embodiments of this application;

[0040] Figure 13 A schematic diagram of an OBS server provided in an embodiment of this application;

[0041] Figure 14 This is a schematic diagram of a database system provided in an embodiment of this application. Detailed Implementation

[0042] This application provides a backup method and related apparatus that can reduce the amount of data uploaded and improve backup performance.

[0043] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0044] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0045] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the related technologies is given first:

[0046] In database systems, data may be corrupted for various reasons. Figure 1 These diagrams illustrate several common data loss scenarios. These scenarios primarily include: hardware failure, software failure, user error, virus intrusion, and catastrophic events. Hardware failure refers to a malfunction at the storage device level, such as disk damage. Software failure refers to the potential generation of erroneous data during software use, causing the software or other software systems to malfunction and become unusable. User error refers to the accidental deletion of data by the user. Virus intrusion refers to the storage device being compromised by a virus or Trojan horse, locking or deleting data. Catastrophic events refer to fires or other incidents that result in data loss.

[0047] To address data corruption, a suitable backup plan is necessary. Backup plans can be preserved in the data's historical record, allowing for easy data recovery or record viewing at any time. Backups should primarily adhere to the following principles: 1. Minimize, or even completely eliminate, data loss. 2. Minimize backup and recovery time to ensure maximum system availability.

[0048] Depending on the content being backed up, backups are mainly divided into physical backups and logical backups. Based on efficiency, they can be categorized into full backups, incremental backups, and cumulative backups. Generally speaking, physical backups have faster recovery speeds but require more storage space, while logical backups are slower, require less storage space, and have higher recovery costs.

[0049] Traditionally, database backup data is primarily stored on storage devices. However, with the promotion and popularization of the cloud, especially the widespread use of cloud databases, database backup data can now be stored in the cloud. Figure 2 This is a schematic diagram of cloud storage in an embodiment of this application. For example... Figure 2 As shown, logical backups of cloud databases primarily involve exporting the database data using tools, storing it as backup files, and then uploading it to cloud storage services such as Object Storage Service (OBS). Document databases (such as MongoDB) use backup tools (such as mongodump) to export the data into a specific format (such as BSON format) for storage, and then storing it on the cloud (OBS) through the OBS object storage interface. It can be understood that this backup method is a logical backup approach.

[0050] Figure 3 This is another schematic diagram of cloud storage in an embodiment of this application. This backup method is a physical backup method. With the popularization of cloud computing, cloud databases mainly use snapshots based on shared storage, directly reading snapshot data from the physical layer for backup, i.e., disk snapshots. The backup data is stored in an object storage system (OBS). Backups using this method can achieve 5 to 10 times better performance than logical backups.

[0051] To achieve rapid backups, most cloud storage systems employ a combination of full backups and incremental backups to reduce the amount of data backed up. For example, cloud storage can perform a full backup once a week and an incremental backup once a day. This effectively avoids the large amount of data required for a full backup while also ensuring data recovery performance and maintaining the availability of the database system.

[0052] However, the aforementioned cloud databases experience a significant increase in data volume with prolonged use, leading to increasingly higher costs for regular full backups, especially given the growing challenge of completing backups within a specified time window. For example, a 1GB full backup of the cloud database previously took one hour. After some time, the backup volume might increase to 3GB, requiring three hours, resulting in low backup efficiency.

[0053] To address the aforementioned problems, embodiments of this application provide a backup method that can reduce the amount of data uploaded for backup and improve backup performance. The backup method provided in these embodiments can be applied to the above-mentioned... Figure 2 The logical backup shown can also be applied to the above. Figure 3 The physical backup shown can also be applied to other storage scenarios in practical applications, and this application embodiment does not limit this.

[0054] Figure 4 A flowchart illustrating a backup method provided in an embodiment of this application. The method includes the following steps:

[0055] 401. The OBS server retrieves the first checksum of the file to be uploaded and the list of file paths to be matched from the database system.

[0056] In this application embodiment, a database system refers to a device or system that requires data backup, which may be a terminal, user equipment, or a server, etc., and this application embodiment does not limit this. This application embodiment uses a database system as an example for description, and other devices can be implemented with reference to this application embodiment, which will not be described in detail here.

[0057] In this embodiment, an OBS server refers to a device that stores data to be backed up in preparation for future data recovery. This OBS server can also be replaced by a cloud storage server, storage device, or other data storage device; this embodiment does not limit its use. This embodiment uses an OBS server as an example for description; other devices can be implemented with reference to this embodiment, and will not be described in detail here.

[0058] In this embodiment, when the database system performs a backup, all files that need to be backed up can be considered as files to be uploaded. The database system and OBS server can implement the backup method provided in this embodiment for each file to be uploaded, or they can perform batch processing on all files to be uploaded; this embodiment does not limit this approach.

[0059] The first checksum of the file to be uploaded can be a checksum, MD5 value, etc., and this application embodiment does not limit the specific type of the first checksum. The database system can pre-execute a checksum algorithm on the file to be uploaded to obtain the first checksum of the file to be uploaded. This application embodiment does not limit the checksum algorithm.

[0060] In this embodiment, the list of object files to be matched is a list saved from each backup, recording the location of the object files to be matched in the OBS server. For example, during a data backup, the OBS server stores several data files. The storage location of these data files in the OBS server can be saved in a list and transferred to the database system. Therefore, it can be understood that these data files stored and backed up in the OBS server can all be considered as object files to be matched. The database system saves this list and associates the data files in the database system with the data files in the list. For a given backup, the list of object files to be matched is a pre-set list recording the "location of the object files to be matched in the OBS server". For the first backup, this list is blank. Table 1 shows an example of the list of object files to be matched after the first backup. In the example in Table 1, the database system backed up two files (file1 and file2), storing them as backup1 / backup1-file1 and backup1 / backup1-file2 in the OBS server, respectively.

[0061] Table 1

[0062] Data files in a database system Data files in the OBS server List of file paths to be matched file1 backup1-file1 backup1 / backup1-file1 file2 backup1-file2 backup1 / backup1-file2

[0063] Table 2 shows an example of performing a backup based on the example in Table 1. In the example in Table 2, the database system performs another backup, storing file1 and file2 as backup2 / backup2-file1 and backup2 / backup2-file2 in the OBS server, respectively. During this backup process, the backup method provided in this application embodiment can be executed according to the list of file paths to be matched shown in Table 1.

[0064] Table 2

[0065] Data files in a database system Data files in the OBS server List of file paths to be matched file1 backup1-file1 backup1 / backup1-file1 backup2-file1 backup2 / backup2-file1 file2 backup1-file2 backup1 / backup1-file2 backup2-file2 backup2 / backup2-file2

[0066] When performing a third backup, the backup method provided in this application embodiment can be executed according to the list of file paths of the objects to be matched in Table 2.

[0067] 402. The OBS server obtains the second checksum of the object file corresponding to the list of object file paths to be matched.

[0068] In this embodiment, all data files stored and backed up on the OBS server can be considered as files to be matched. The OBS server can then locate the corresponding file to be matched based on the list of file paths.

[0069] The second checksum of the file to be matched can be pre-stored in the OBS server, or it can be calculated by the OBS server using a checksum algorithm. Specifically, if it's pre-stored in the OBS server, it means that during the last backup, when the database system uploaded the file to be uploaded, it also uploaded the first checksum. The OBS server can then store the file to be uploaded as the file to be matched, and the first checksum can be stored as the second checksum. When a backup is performed again, if the file to be uploaded has changed since the last backup, the first checksum will also change, resulting in a difference between the first and second checksums. Therefore, the similarity between the first and second checksums can be used to determine if the file to be uploaded and the file to be matched are the same. In another scenario, the OBS server uses the same checksum algorithm as the one used to calculate the first checksum to calculate the second checksum of the file to be matched. It's understandable that if the file to be uploaded and the file to be matched are the same, and the checksum algorithm is the same, then the first and second checksums will also be the same. Therefore, the similarity between the first and second checksums can be used to determine if the file to be uploaded and the file to be matched are the same.

[0070] 403. If the first check value is the same as the second check value, the OBS server will copy the file to be matched to the preset backup path.

[0071] In this embodiment, after the OBS server detects that the first checksum and the second checksum are the same, it indicates that the file to be uploaded is the same as the object file to be matched. The OBS server can then copy the object file to be matched to a preset backup path instead of copying the file to be uploaded to the preset backup path. This eliminates the need for the database system to upload the file to be uploaded, reducing the amount of data transferred during backup and improving backup efficiency.

[0072] For example, as shown in the example in Table 2 above, when the OBS server backs up file1, if the first checksum of the file to be uploaded, file1, is found to be the same as the second checksum of the object file to be matched, file1 (file path backup1 / backup1-file1), in the OBS server, it means that the file to be uploaded, file1, and the object file to be matched, file1, are the same. The OBS server can then copy backup1 / backup1-file1 to backup2 / backup2-file1 without requiring the database system to upload the file to be uploaded, thus reducing the amount of data transferred during backup and improving backup efficiency.

[0073] 404. If the copy is successful, the OBS server will return a successful merging message to the database system.

[0074] In some embodiments, after the OBS server copies the object file to be matched to the preset backup path and confirms that the copy is successful, it can return a successful merging message to the database system to notify the database system that the file to be uploaded has been backed up.

[0075] 405. If the copy fails, the OBS server returns a second merge failure message to the database system.

[0076] In some embodiments, the OBS server may fail to copy the object file to be matched to the preset backup path for various reasons. These reasons may include the object file being locked, corrupted, or deleted, etc., which are not limited to the specific circumstances described in this application.

[0077] Therefore, when a copy fails, the OBS server cannot perform a backup by copying the file to be matched. In this case, the OBS server can return a second merge failure message to the database system, instructing the database system to upload the file to be uploaded to the OBS server.

[0078] 406. In response to the second synthesis failure message, the database system uploads the file to be uploaded to the OBS server.

[0079] In this embodiment of the application, after receiving the second synthesis failure information, the database system can upload the file to be uploaded to the OBS server, so that the OBS server can copy the file to be uploaded to a preset backup path to complete the backup of the file to be uploaded.

[0080] Understandably, when the OBS server receives a file to be uploaded from the database system, it can copy the file to a preset backup path to complete the backup of the file.

[0081] 407. If the first checksum is different from all the second checksums, the OBS server returns a first synthesis failure message to the database system.

[0082] In this embodiment, when the OBS server detects that the first checksum and the second checksum are the same, it can copy the file to be matched to a preset backup path to achieve backup. When the OBS server detects that the first checksum and the second checksum are different, the OBS server will generally check whether the first checksum is the same as the next second checksum. For example, when performing the third backup of the example in Table 2, the list of file paths to be matched corresponding to the file to be uploaded (file1) in the database system is shown in the first two items of the third column of Table 2 (backup1 / backup1-file1 and backup2 / backup2-file1). Therefore, when performing the third backup, the OBS server first checks whether the first checksum of the file to be uploaded (file1) is the same as the second checksum of the file to be matched (backup1-file1) corresponding to backup1 / backup1-file1. When they are different, the OBS server continues to check whether the first checksum of the file to be uploaded (file1) is the same as the second checksum of the file to be matched (backup2-file1) corresponding to backup2 / backup2-file1.

[0083] After the above process, if the OBS server detects that the first checksum of the file to be uploaded is different from all the second checksums, it means that there is no matching object file in the OBS server that is the same as the file to be uploaded. In this case, the OBS server can return a first synthesis failure message to the database system. This first synthesis failure message is used to instruct the database system to upload the file to be uploaded to the OBS server.

[0084] 408. In response to the first synthesis failure message, the database system uploads the file to be uploaded to the OBS server.

[0085] In this embodiment of the application, when the database system receives the first synthesis failure information, it can upload the file to be uploaded to the OBS server so that the OBS server can copy the file to be uploaded to the preset backup path to complete the backup of the file to be uploaded.

[0086] Understandably, when the OBS server receives a file to be uploaded from the database system, it can copy the file to a preset backup path to complete the backup of the file.

[0087] In some embodiments, after the OBS server completes the backup of the uploaded file, it can send a preset backup path to the database system, causing the database system to update the list of object file paths to be matched according to the preset backup path. For example, after performing the third backup of the example in Table 2, the updated list of object file paths to be matched by the database system is shown in Table 3. Table 3 is an example table of the third backup of the example in Table 2. After the second backup and before the third backup, the data file file1 in the database system remains unchanged, while the data file file2 becomes file2.1 (both have the same filename but different contents). Therefore, during the third backup, if the OBS server detects that the first checksum of data file file1 is the same as the second checksum of the object file backup2-file1 to be matched, it can directly copy backup2-file1 to the preset backup path folder backup3. If the OBS server detects that the second checksum of data file file2.1 is different from all the object files to be matched, the OBS server can instruct the database system to upload data file file2.1 and then copy data file file2.1 to the preset backup path folder backup3 to complete this backup. After the backup is complete, the OBS server can send the list of object file paths to be matched shown in Table 3 to the database system, so that the database system can update the list of object file paths to be matched according to the preset backup path.

[0088] In the above process, the database system can determine that data file file2 has become data file file2.1 in a reasonable way. For example, data files file2 and file2.1 may have the same filename but different contents. The database system can then determine that data files file2 and file2.1 belong to the original and changed data files based on their filenames, similar to the situation described above. In practical applications, the database system can also determine the relationship between data files based on other file identifiers, such as file numbers, etc. This application embodiment does not limit this. Therefore, when backing up a file to be uploaded, the database system can find the list of matching object file paths for the file to be uploaded based on its file identifier (such as filename). Then, it uploads the first checksum of the file to be uploaded and the list of matching object file paths to the file to be uploaded to the OBS server. For example, in the example in Table 3, during the third backup, the filenames of data file file2 and data file file2.1 are both "Second File". The database system can find the corresponding list of file paths to be matched based on the filename "Second File", which are backup1 / backup1-file2 and backup2 / backup2-file2, and then upload them to the OBS server.

[0089] Table 3

[0090] Data files in a database system Data files in the OBS server List of file paths to be matched file1 backup1-file1 backup1 / backup1-file1 backup2-file1 backup2 / backup2-file1 backup3-file1 backup3 / backup3-file1 file2.1 backup1-file2 backup1 / backup1-file2 backup2-file2 backup2 / backup2-file2 backup3-file2.1 backup3 / backup3-file2.1

[0091] It is understood that the embodiments provided in this application can be applied to all backup processes, including full backups or incremental backups. In the case of a full backup, traditional methods require uploading a large amount of data. Implementing the embodiments of this application can significantly reduce the amount of data that needs to be uploaded, resulting in a more significant effect. The following will describe in detail an application example of this application's embodiments to a full backup.

[0092] Figure 5 This is a schematic diagram illustrating a backup application example provided in this application. The example includes a database system and an OBS server. The database system is backed up for the first time as a full backup, backing up three files (File1, File2, and File3) to the Fullbackup1 folder on the OBS server. Furthermore, the database system uploads the checksum values ​​corresponding to these three files along with the backup files.

[0093] In this embodiment of the application, during backup, historical data from previous backups is compared to determine whether the data is synthesized into a new backup data file using the OBS object composition interface, thereby reducing network transmission; or whether it is necessary to upload the new data file to OBS for storage via the network. Therefore, in Figure 5 In the application example, the database files (file1, file2, file3) were uploaded to the OBS object storage via the network during the initial full backup process. The OBS not only saves the data files, but also maintains the descriptive information of the data files (file path and file verification information such as checksum).

[0094] Figure 6 In order to be in Figure 5 Based on the implementation of this application Figure 4 A schematic diagram of the backup method shown. Figure 7 for Figure 6 The flowchart for this application example is as follows: The database system first obtains the file to be uploaded, calculates its checksum, and then calculates the object path list (list of object file paths to be matched) based on the information from the last full backup and incremental backup. It can be understood that in this application example, the information from the last full backup and incremental backup can refer to the path list of backup files (object files to be matched) from the OBS server during the last full backup and incremental backup process. The database system then merges the path lists corresponding to the filename from each backup to obtain the object path list based on the filename of the file to be uploaded.

[0095] Then, the database system can upload the above information to the OBS server through the OBS server's Composite Object interface. This Composite Object interface is an associated interface provided by the OBS server for the backup method provided in this application embodiment, used to receive the above-mentioned object path list and checksum information. It is understood that in other practical applications, other interfaces can be called to transmit the above information, and this application does not limit this.

[0096] The OBS server can search for the corresponding object files to be matched based on the object path list and filenames, in ascending order, as well as the checksums of the object files to be matched stored during the last backup. Generally, newer files are more likely to be the same as the file to be uploaded. Therefore, searching from newest to oldest can more quickly find the matching object files that are the same as the file to be uploaded, improving processing efficiency.

[0097] The OBS server then compares the checksum of the file to be matched with the checksum of the file to be uploaded. If they match, the file to be matched is copied directly to a new backup path, and a successful merge message is returned to the database system. If they do not match, a second merge failure message is returned to the database system.

[0098] If the database system receives a successful merge notification, it will not upload the file to be uploaded again. If the database system receives a second merge failure notification, it will upload the file to be uploaded to the OBS server via the network for backup, and will also upload the checksum of the file to be uploaded.

[0099] The above process allows you to directly combine previously backed-up, unmodified object files (file1, file2, and file3) into a new backup object using OBS, avoiding network transmission. The newly added file4 needs to be uploaded to OBS for backup.

[0100] Figure 8 A schematic diagram of another embodiment of the backup method provided in this application. This embodiment includes the following steps:

[0101] 801. The database system obtains the first verification value of the file to be uploaded.

[0102] In this embodiment, the database system can calculate the first verification value of the file to be uploaded according to a preset verification algorithm. Specifically, as described above... Figure 4 The descriptions in the corresponding embodiments are similar and will not be repeated here.

[0103] 802. The database system obtains the second verification value of the object file corresponding to the list of object file paths to be matched.

[0104] In this embodiment, the second checksum of the object file to be matched may be stored in the OBS server. The database system can determine the object file to be compared in this backup based on the list of object file paths, and then call the OBS server's interface to obtain the second checksum of the object file to be matched from the OBS server.

[0105] In this embodiment of the application, the list of file paths to be matched is the same as that described above. Figure 4 The corresponding implementation methods are similar and will not be described in detail here.

[0106] 803. If the first check value is the same as the second check value, the database system sends an indication message to the OBS server.

[0107] In this embodiment of the application, the database system can detect whether the first check value and the second check value are the same, as described above. Figure 4 The execution entities in the corresponding embodiments are different; in this application embodiment, detection is performed through a database system.

[0108] If the first checksum and the second checksum are the same, it means that the OBS server can use the object file corresponding to the second checksum as the backup object file. Therefore, the database system can send an instruction to the OBS server, which instructs the OBS server to copy the object file corresponding to the second checksum to the preset backup path. In practical applications, the database system can also instruct the OBS server to copy the object file corresponding to the second checksum to the preset backup path by calling the OBS server's interface, or use other methods to give the instruction; this application embodiment does not limit this.

[0109] Understandably, after receiving the instruction, the OBS server, in response, copies the file to be matched corresponding to the second checksum to the preset backup path. If the copy is successful, the OBS server can return a successful merge message to the database system, allowing the database system to perform relevant processing. If the copy fails, it indicates that the OBS server cannot complete the backup via copying, and the OBS server can return a second merge failure message to the database system. Upon receiving this second merge failure message, the database system can send the file to be uploaded to the OBS server, enabling the OBS server to perform a backup based on this file.

[0110] 804. If the first checksum is different from all the second checksums, the database system uploads the file to be uploaded to the OBS server.

[0111] In this embodiment, the database system can compare the first checksum of the file to be uploaded with the second checksums of several other files to be matched. If they match, step 803 can be executed. If they do not match, the database system can upload the file to be uploaded to the OBS server. After receiving the file, the OBS server can save it to a preset backup path to achieve backup.

[0112] In some embodiments, after the OBS server performs a backup, it also sends a list of paths (or preset backup paths) of the backup data files (files to be matched) to the database system. (As described above...) Figure 4 The corresponding implementation methods are similar and will not be described in detail here.

[0113] Figure 9 This application is based on Figure 5 This is a diagram illustrating an application example of performing a backup again. Figure 10 for Figure 9 The corresponding flowchart. This application example includes the following steps:

[0114] The database system first obtains the file to be uploaded, calculates its checksum, and then calculates the object path list (the list of object file paths to be matched) based on the information from the last full and incremental backups. It can be understood that, in this application example, the last full and incremental backup information can refer to the path list of backup files (object files to be matched) from the OBS server during the last full and incremental backup process. The database system then merges the path lists corresponding to the filename from each backup to obtain the object path list based on the filename to be uploaded.

[0115] Then, the database system calls the object attribute interface of the OBS server to obtain the verification value of the object file to be matched corresponding to the object path list.

[0116] After the database system receives the checksums of the file to be uploaded and the object file to be matched, it can compare whether the two checksums are the same. If they are the same, it means that the database system does not need to upload the file to be uploaded, but can instead instruct the OBS server to directly copy the object file to be matched to the preset backup path. Therefore, the database can instruct the OBS server to complete the backup based on the object file to be matched.

[0117] If the two checksums are different, it means that the OBS server does not have an object file identical to the file to be uploaded. In this case, the database system uploads the file to be uploaded and its checksum to the OBS server. The OBS server can then back up the file to be uploaded and save the checksum for use in the next backup.

[0118] After the OBS server completes the copy, it will typically return a success message to the database system. If the copy fails, the OBS server will return a failure message to the database system, causing the database system to upload the file to be uploaded to the OBS server to complete the backup.

[0119] Figure 11 This is a schematic diagram of a backup device according to an embodiment of the present application. The backup device 1100 includes:

[0120] Module 1101 is used to perform the aforementioned operations. Figure 4 Steps 401, 406, and 408 in the corresponding embodiments.

[0121] Processing module 1102 is used to perform the aforementioned Figure 4 Steps 402, 403, 404, 405, and 407 in the corresponding embodiments.

[0122] Figure 12 This is a schematic diagram of another backup device according to an embodiment of this application. The backup device 1200 includes:

[0123] Module 1201 is used to perform the aforementioned operations. Figure 8 Step 802 in the corresponding embodiments.

[0124] Processing module 1202 is used to perform the aforementioned Figure 8 Steps 801, 803, and 804 in the corresponding embodiments.

[0125] Figure 13 This is a schematic diagram of an OBS server provided in an embodiment of this application. The OBS server 1300 includes one or more processors 1301, a memory 1303, and a communication interface 1304. The processors 1301, memory 1303, and communication interface 1304 can be connected via a communication bus 1302. The memory 1303 is used to store one or more programs; the one or more processors 1301 are used to run the one or more programs, causing the OBS server 1300 to execute the methods corresponding to the above-described method embodiments. That is, the OBS server 1300 can be the aforementioned... Figure 4 The OBS server in the method embodiment shown may be the one described above. Figure 8 The OBS server in the method embodiment shown.

[0126] Processor 1301 can be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, or one or more integrated circuits for implementing the solutions of this application, such as application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0127] The communication bus 1302 is used to transmit information between the aforementioned components. The communication bus 1302 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, see attached... Figure 13 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0128] The memory 1303 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions; it may also be a random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions; it may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 1303 may exist independently and be connected to the processor 1301 via the communication bus 1302. The memory 1303 may also be integrated with the processor 1301.

[0129] Communication interface 1304 uses any transceiver-like device for communicating with other devices or communication networks. Communication interface 1304 includes a wired communication interface and may also include a wireless communication interface. The wired communication interface may, for example, be an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof.

[0130] In a specific implementation, as one embodiment, the processor 1301 may include one or more CPUs, as shown in the appendix. Figure 13 CPU0 and CPU1 are shown in the diagram.

[0131] In a specific implementation, as one example, the OBS server 1300 may include multiple processors, as shown in the attached diagram. Figure 13 The processors 1301 and 1305 shown are illustrated. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0132] In a specific implementation, as one example, the OBS server 1300 may further include output devices and input devices. The output devices communicate with the processor 1301 and can display information in various ways. For example, the output devices may be liquid crystal displays (LCDs), light-emitting diode (LED) displays, cathode ray tube (CRT) displays, or projectors. The input devices communicate with the processor 1301 and can receive user input in various ways. For example, the input devices may be mice, keyboards, touchscreen devices, or sensing devices.

[0133] In some embodiments, memory 1303 is used to store program code 1310 for executing the scheme of this application, and processor 1301 can execute the program code 1310 stored in memory 1303. That is, OBS server 1300 can implement the message processing method provided in the method embodiment through processor 1301 and program code 1310 in memory 1303.

[0134] The OBS server 1300 of this application embodiment can correspond to the gateway device in the above-described method embodiments. Furthermore, the processor 1301, communication interface 1304, etc. in the OBS server 1300 can implement the functions and / or various steps and methods implemented by the gateway device in the above-described method embodiments. For the sake of brevity, further details are omitted here.

[0135] It should be understood that OBS server 1300 corresponds to the OBS server in the above method embodiments, and each unit in OBS server 1300 and the other operations and / or functions described above are respectively for implementing the above... Figure 4 The OBS server or in the method shown Figure 8 The various steps and methods implemented by the OBS server in the method shown are detailed in the above method embodiments, and will not be repeated here for the sake of brevity.

[0136] Figure 14 This is a schematic diagram of a database system provided in an embodiment of this application. The database system 1400 includes one or more processors 1401, a memory 1403, and a communication interface 1404. The processors 1401, memory 1403, and communication interface 1404 can be connected via a communication bus 1402. The memory 1403 is used to store one or more programs; the one or more processors 1401 are used to run the one or more programs, causing the database system 1400 to execute the methods corresponding to the above-described method embodiments. That is, the database system 1400 can be the aforementioned... Figure 4The database system in the method embodiments shown may be the one described above. Figure 8 The database system in the method embodiment shown.

[0137] Processor 1401 can be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, or one or more integrated circuits for implementing the solutions of this application, such as application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0138] The communication bus 1402 is used to transmit information between the aforementioned components. The communication bus 1402 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, see attached... Figure 14 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0139] The memory 1403 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions; it may also be a random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions; it may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. The memory 1403 may exist independently and be connected to the processor 1401 via the communication bus 1402. The memory 1403 may also be integrated with the processor 1401.

[0140] Communication interface 1404 uses any transceiver-like device for communicating with other devices or communication networks. Communication interface 1404 includes a wired communication interface and may also include a wireless communication interface. The wired communication interface may, for example, be an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof.

[0141] In a specific implementation, as one embodiment, the processor 1401 may include one or more CPUs, as shown in the appendix. Figure 14 CPU0 and CPU1 are shown in the diagram.

[0142] In a specific implementation, as one example, the database system 1400 may include multiple processors, as shown in the appendix. Figure 14 The processors 1401 and 1405 shown are illustrated. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0143] In a specific implementation, as one embodiment, the database system 1400 may further include output devices and input devices. The output devices communicate with the processor 1401 and can display information in various ways. For example, the output devices may be liquid crystal displays (LCDs), light-emitting diode (LED) displays, cathode ray tube (CRT) displays, or projectors. The input devices communicate with the processor 1401 and can receive user input in various ways. For example, the input devices may be mice, keyboards, touchscreen devices, or sensing devices.

[0144] In some embodiments, the memory 1403 is used to store program code 1410 for executing the scheme of this application, and the processor 1401 can execute the program code 1410 stored in the memory 1403. That is, the database system 1400 can implement the message processing method provided in the method embodiment through the processor 1401 and the program code 1410 in the memory 1403.

[0145] The database system 1400 of this application embodiment can correspond to the gateway device in the above-described method embodiments. Furthermore, the processor 1401, communication interface 1404, etc. in the database system 1400 can implement the functions and / or various steps and methods implemented by the gateway device in the above-described method embodiments. For the sake of brevity, further details are omitted here.

[0146] It should be understood that database system 1400 corresponds to the database system in the above method embodiments, and each unit in database system 1400 and the other operations and / or functions described above are respectively for implementing the above... Figure 4 The database system or in the method shown Figure 8 The various steps and methods implemented by the database system in the method shown are detailed in the above method embodiments, and will not be repeated here for the sake of brevity.

[0147] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0148] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0149] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0150] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0151] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A backup method, characterized in that, include: The Object Storage Service (OBS) server obtains the first checksum of the file to be uploaded and a list of object file paths to be matched from the database system. The OBS server obtains the second verification value of the object file corresponding to the list of object file paths to be matched; If the first check value is the same as the second check value, the OBS server will copy the object file to be matched to a preset backup path. If the first check value is not the same as the current second check value, the OBS server compares the first check value with the next second check value to see if they are the same. If the first check value is different from all the second check values, the OBS server returns a first synthesis failure message to the database system. The first synthesis failure message is used to instruct the database system to upload the file to be uploaded to the OBS server, so that the OBS server copies the file to be uploaded to the preset backup path. If the OBS server fails to copy the file to be matched to the preset backup path, the OBS server returns a second synthesis failure message to the database system. The second synthesis failure message is used to instruct the database system to upload the file to be uploaded to the OBS server, so that the OBS server copies the file to be uploaded to the preset backup path.

2. The method according to claim 1, characterized in that, After the OBS server returns the first synthesis failure information to the database system, the method further includes: The OBS server saves the file to be uploaded to the preset backup path.

3. The method according to claim 1 or 2, characterized in that, The method further includes: The OBS server sends the preset backup path to the database system, causing the database system to update the list of object file paths to be matched based on the preset backup path.

4. A backup method, characterized in that, include: The database system retrieves the first verification value of the file to be uploaded. The database system obtains the second verification value of the object file to be matched corresponding to the list of object file paths to be matched from the OBS server; If the first verification value is the same as the second verification value, the database system sends an instruction message to the OBS server, which instructs the OBS server to copy the object file to be matched corresponding to the second verification value to a preset backup path. If the first check value is not the same as the current second check value, the database system compares whether the first check value and the next second check value are the same. If the first check value is different from all the second check values, the database system uploads the file to be uploaded to the OBS server so that the OBS server saves the file to be uploaded to the preset backup path. The database system obtains second synthesis failure information from the OBS server; In response to the second synthesis failure information, the database system uploads the file to be uploaded to the OBS server, so that the OBS server copies the file to be uploaded to the preset backup path.

5. The method according to claim 4, characterized in that, The method further includes: The database system obtains the preset backup path from the OBS server; The database system updates the list of file paths to be matched based on the preset backup path.

6. A backup device, characterized in that, include: The acquisition module is used to retrieve the first verification value of the file to be uploaded and the list of file paths of the objects to be matched from the database system; The acquisition module is also used to acquire the second verification value of the object file to be matched corresponding to the list of object file paths to be matched; The processing module is used to copy the file to be matched to a preset backup path if the first verification value is the same as the second verification value. The processing module is further configured to compare whether the first verification value and the next second verification value are the same if the first verification value is not the same as the current second verification value. The processing module is further configured to return a first synthesis failure message to the database system if the first verification value is different from all the second verification values. The first synthesis failure message is used to instruct the database system to upload the file to be uploaded to the OBS server so that the OBS server copies the file to be uploaded to the preset backup path. The processing module is further configured to return a second synthesis failure message to the database system if the OBS server fails to copy the file to be matched to the preset backup path. The second synthesis failure message is used to instruct the database system to upload the file to be uploaded to the OBS server so that the OBS server copies the file to be uploaded to the preset backup path.

7. The backup device according to claim 6, characterized in that, The processing module is also used to save the file to be uploaded to the preset backup path.

8. The backup device according to claim 6 or 7, characterized in that, The processing module is also used to send the preset backup path to the database system, so that the database system updates the list of object file paths to be matched according to the preset backup path.

9. A backup device, characterized in that, include: The acquisition module is used to obtain the first verification value of the file to be uploaded; The acquisition module is also used to obtain the second verification value of the object file to be matched corresponding to the list of object file paths to be matched from the OBS server; The processing module is configured to send an indication message to the OBS server if the first verification value is the same as the second verification value. The indication message is used to instruct the OBS server to copy the object file to be matched corresponding to the second verification value to a preset backup path. The processing module is further configured to compare whether the first verification value and the next second verification value are the same if the first verification value is not the same as the current second verification value. The processing module is further configured to upload the file to be uploaded to the OBS server if the first verification value is not the same as all the second verification values, so that the OBS server saves the file to be uploaded to the preset backup path; The acquisition module is also used to acquire second synthesis failure information from the OBS server; The processing module is further configured to, in response to the second synthesis failure information, upload the file to be uploaded to the OBS server, so that the OBS server copies the file to be uploaded to the preset backup path.

10. The backup device according to claim 9, characterized in that, The acquisition module is also used to obtain the preset backup path from the OBS server; The processing module is also used to update the list of file paths to be matched according to the preset backup path.

11. An OBS server, characterized in that, Including processor and memory; The processor and the memory communicate with each other; The memory is used to store instructions; The processor is configured to execute the instructions in the memory, performing the method as described in any one of claims 1 to 3.

12. A database system, characterized in that, Including processor and memory; The processor and the memory communicate with each other; The memory is used to store instructions; The processor is configured to execute the instructions in the memory, performing the method as described in any one of claims 4 to 5.

13. A computer-readable storage medium, characterized in that, Includes instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and system for database backup

    CN105095300A