File backup based on file type
By dividing the file collection by file type and generating corresponding backup files, the problem of insufficient performance in traditional file backup methods is solved, efficient file backup and recovery is achieved, user operations are simplified, and deduplication and throughput are improved.
Patent Information
- Application Number
- CN201910990429.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-17
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2039-10-17
AI Technical Summary
Traditional file backup methods have insufficient performance problems in modern file systems, resulting in slow file recovery, low deduplication rate and poor user experience, which cannot meet users' backup needs.
Divide the set of files to be backed up into multiple file subsets. Each file subset has the same file type, generate multiple backup files separately, and generate total backup files based on these backup files, and use file type information to increase deduplication rate. and throughput, providing file type-based file recovery solutions.
Improves the performance of file backup and recovery, simplifies user operations, enhances deduplication and throughput, meets users' needs for file type recovery, and reduces backup time.
Smart Images

Figure CN112685223B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure generally relate to computer systems or storage systems, and more particularly, to a method, electronic device, and computer program product for file backup. Background Art
[0002] Traditionally, in the file backup of a computer system or storage system, especially in the backup of a file system, all files to be backed up are usually backed up together in one backup session, and finally a backup file (e.g., a container file) is generated. For example, a typical user backup scenario may be that the user selects storage disk C, storage disk D, and storage disk E to perform on-demand file backup, or selects these storage disks in the backup strategy so as to perform file backup on these storage disks regularly. In either case, all file contents in storage disk C, storage disk D, and storage disk E will be deduplicated and stored as one backup file.
[0003] However, for modern file systems, this traditional backup method may have some problems and shortcomings, and thus cannot meet the performance requirements of file backup in many scenarios, resulting in a poor user experience. Summary of the invention
[0004] Embodiments of the present disclosure relate to a method, an electronic device, and a computer program product for file backup.
[0005] In a first aspect of the present disclosure, a method for file backup is provided. The method comprises: dividing a file set to be backed up into a plurality of file subsets, wherein the files in each file subset have the same file type. The method further comprises: generating a plurality of backup files based on the plurality of file subsets, wherein the plurality of backup files correspond to the plurality of file types of the files in the plurality of file subsets. The method further comprises: generating a total backup file corresponding to the file set based on the plurality of backup files.
[0006] In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes at least one processor and at least one memory storing computer program instructions. The at least one memory and the computer program instructions are configured to, together with the at least one processor, enable the electronic device to: divide the file set to be backed up into multiple file subsets, and the files in each file subset have the same file type. The at least one memory and the computer program instructions are also configured to, together with the at least one processor, enable the electronic device to: generate multiple backup files based on the multiple file subsets, respectively, and the multiple backup files correspond to the multiple file types of the files in the multiple file subsets. The at least one memory and the computer program instructions are further configured to, together with the at least one processor, enable the electronic device to: generate a total backup file corresponding to the file set based on the multiple backup files.
[0007] In a third aspect of the present disclosure, a computer program product is provided. The computer program product is tangibly stored on a non-volatile computer readable medium and includes machine executable instructions. When the machine executable instructions are executed, the machine performs the steps of the method according to the first aspect.
[0008] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other objects, features and advantages of the embodiments of the present disclosure will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner.
[0010] Figure 1 A schematic diagram of a file backup system environment in which embodiments of the present disclosure may be implemented is shown.
[0011] Figure 2 A flow chart of an example method according to an embodiment of the present disclosure is shown.
[0012] Figure 3 An example architecture of a file backup system based on file types according to an embodiment of the present disclosure is shown.
[0013] Figure 4 Example file metadata including file type information according to an embodiment of the present disclosure is shown.
[0014] Figure 5 Example file metadata including a backup file identifier according to an embodiment of the present disclosure is shown.
[0015] Figure 6 A schematic diagram of generating a reference file as a total backup file according to an embodiment of the present disclosure is shown.
[0016] Figure 7 A schematic block diagram of a device that can be used to implement an embodiment of the present disclosure is shown.
[0017] The same or similar reference numerals are used throughout the drawings to designate the same or similar components. DETAILED DESCRIPTION
[0018] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments shown in the accompanying drawings. It should be understood that these specific embodiments are described only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way.
[0019] Figure 1 FIG. 1 is a schematic diagram of a file backup system environment 100 in which an embodiment of the present disclosure may be implemented. Figure 1 As shown, the system environment 100 includes a computing device 110, and a file set 120 is stored on the computing device 110. Generally speaking, the file set 120 can be used to organize and manage various files or data in the computing device 110. For example, the file set 120 can correspond to a file system in a computer system or a storage system. It should be understood that although Figure 1 The file collection 120 is shown as being formed inside the computing device 110, but this is only exemplary and is not intended to limit the scope of the present disclosure in any way. In some embodiments, the file collection 120 may also be on other computing devices different from the computing device 110. For example, the computing device 110 may be a server for providing backup services, and the other computing device may be a client for the computing device 110 to perform backup services.
[0020] In order to provide protection for the files or data in the file set 120, the computing device 110 may back up the file set 120 to the backup storage device 130 according to the backup instruction of the user, regularly, or according to a predetermined backup strategy. For example, an application for file or data protection may be run on the computing device 110 to perform the backup of the file set 120. To this end, the computing device 110 and the backup storage device 130 may communicate via the communication link 140. For example, the computing device 110 may transmit the file or data content to be backed up to the backup storage device 130 via the communication link 140, obtain various backup files or backup data from the backup storage device 130, and perform any other appropriate file or data communication, etc.
[0021] In addition, the computing device 110 may also send control signals to the backup storage device 130 via the communication link 140 to implement various controls, management and operations on the backup storage device 130. Figure 1 The backup storage device 130 is depicted as being external to the computing device 110, but this is exemplary only and is not intended to limit the scope of the present disclosure in any way. In some embodiments, the backup storage device 130 may also be included within the computing device 110 as an integral part thereof.
[0022] In some embodiments, the backup storage device 130 may be a cloud storage system or other remote storage server. In other embodiments, the backup storage device 130 may also be any system with storage function that provides storage services or functions to users. In some embodiments, the backup storage device 130 may use various types of devices with storage functions to provide storage functions, including but not limited to hard disks (HDDs), solid-state disks (SSDs), removable disks, compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks, Blu-ray disks, serially attached small computer system interface (SCSI) storage disks (SAS), serial advanced technology attachment (SATA) storage disks, any other magnetic storage devices, and any other optical storage devices, or any combination thereof.
[0023] In some embodiments, computing device 110 may include any device capable of implementing computing functions and / or control functions, including, but not limited to, a special-purpose computer, a general-purpose computer, a general-purpose processor, a microprocessor, a microcontroller, or a state machine. Computing device 110 may also be implemented as an individual computing device or a combination of computing devices, for example, a combination of a digital signal processor (DSP) and a microprocessor, a plurality of microprocessors, one or more microprocessors in combination with a DSP core, or any other such configuration. In addition, in the context of the present disclosure, computing device 110 may also be referred to as electronic device 110, and these two terms may be used interchangeably herein.
[0024] In some embodiments, the communication link 140 may be any form of connection or coupling that enables data communication or control signal communication between the computing device 110 and the backup storage device 130, including but not limited to coaxial cable, fiber optic cable, twisted pair, or wireless technology (such as infrared, radio, and microwave). In some embodiments, the communication link 140 may include various types of buses. In other embodiments, the communication link 140 may include a computer network, a communication network, or other wired or wireless networks.
[0025] It should be understood that Figure 1The units, modules or components in the file backup system environment 100 that are related to the embodiments of the present disclosure are only schematically shown. In practice, the file backup system environment 100 may also include other units, modules or components for other functions. Therefore, the embodiments of the present disclosure are not limited to Figure 1 The specific devices, units, modules or components depicted are generally applicable to any system environment that can perform file or data backup.
[0026] As mentioned above, for modern file systems, traditional file backup methods may have some problems and shortcomings, and therefore cannot meet the performance requirements of file backup in many scenarios, resulting in a poor user experience. In particular, in traditional file backup methods, all files are mixed together for backup in one backup session. For example, in some traditional backup systems, file data may be distributed on different branches of a Merkle tree structure. In other traditional backup systems, file data may be distributed in different parts of a container file. During file recovery, in order to browse recoverable files, users can use two methods.
[0027] The first method is to read the file or directory structure related information online from the file's metadata, and manually select the files to be restored. The second method is to use a search tool to read the file's metadata and create an index in the cache, and then use the cached and indexed metadata to select the files to be restored. However, both of the above methods require manual intervention. When the file set or data set is large, it is almost impossible to rely on manual selection to filter out the files to be restored. In this regard, the above second method uses cached metadata to implement the search function, which can alleviate the user's inconvenience and cumbersomeness to some extent, but it requires the consumption of a central processing unit (CPU) and memory to create an index cache, which increases system overhead.
[0028] On the other hand, hundreds or more files of different file types may be stored in modern file systems. When performing file backup, according to the traditional backup method, backing up these files of different file types into one backup file in one backup session may have the following two problems.
[0029] First, this traditional backup method may result in slow and inconvenient file recovery. For example, a user may choose to perform a file system backup because the user wants to perform a file-level recovery. That is, the user may not expect to recover all files backed up in a backup session, because this may be slow and unnecessary. Alternatively, the user may only want to recover a certain type of file, for example, an audio file (such as an MP3 format file, a WAV format file, etc.), a video file (such as an AVI format file, an MKV format file, etc.), a picture file (such as a JPEG format file, a PNG format file, etc.), or other types of files. If a traditional backup method is used, the user must manually select the files to be recovered by browsing the backup content, which is very inefficient and inconvenient.
[0030] Secondly, traditional backup methods may also lead to reduced deduplication rates and throughput rates. Specifically, almost all modern backup solutions use deduplication technology to accelerate deduplication throughput and optimize storage capacity. Different backup solutions may adopt different deduplication technologies, such as variable-size block technology, fixed-size block technology, etc. However, these deduplication technologies all follow the same rule, that is, the data pattern greatly affects the deduplication rate. In addition, in a large file collection, files of the same file type usually have a higher similarity. In the traditional backup method, the backup process that mixes all file types together in one backup session cannot fully utilize the data pattern similarity, thereby reducing the deduplication rate.
[0031] Furthermore, with the rapid growth of file system size and file type complexity, users' needs to restore specific file types are increasing. Therefore, users may not be satisfied with the traditional backup method that is slow to restore and storage-unfriendly, and users may also be reluctant to manually select specific files to be restored because it is not only cumbersome but also time-consuming. In short, the traditional file backup and recovery method with mixed file types cannot meet the backup needs of users because the inherent characteristics of files mixed together for backup make it difficult to filter out the files to be restored according to the file type during the file recovery process.
[0032] In view of the above-mentioned problems and potential other problems existing in traditional solutions, an embodiment of the present disclosure proposes a technical solution for file backup. In some embodiments, the technical solution implements the association between file types and backup files to improve the file backup and file recovery process. In addition, the technical solution can use the existing file backup and recovery framework to provide a simplified and user-friendly way to implement file recovery based on file type. In addition, the technical solution can also provide enhancement of file locality based on file type to improve deduplication rate and throughput rate. In addition, the technical solution can also provide a reliable multi-stream solution for file system backup to reduce backup time. In short, the embodiments of the present disclosure can improve the performance of file backup and file recovery. The following is combined with Figures 2 to 6 Some example embodiments of the present disclosure are described in detail.
[0033] Figure 2 A flowchart of an example method 200 according to an embodiment of the present disclosure is shown. In some embodiments, the method 200 may be implemented by a computing device 110 in a file backup system environment 100, for example, by a processor or processing unit of the computing device 110, or by various functional modules of the computing device 110. In other embodiments, the method 200 may also be implemented by a computing device independent of the system environment 100, or may be implemented by other units or modules in the system environment 100.
[0034] Figure 3 FIG. 3 shows an example architecture of a file backup system 300 based on file type according to an embodiment of the present disclosure. Figure 3 The various operations of method 200 are described using the example architecture in FIG. Figure 3 The example architecture of the file backup system 300 depicted in FIG. 2 is merely exemplary and is not intended to limit the scope of the embodiments of the present disclosure in any way. In other embodiments, the computing device 110 may perform the method 200 based on any appropriate system architecture.
[0035] refer to Figure 2 and Figure 3 At 210, the computing device 110 divides the file set 120 to be backed up into a plurality of file subsets, namely, a first file subset 310, a second file subset 320, a third file subset 330, a fourth file subset 340, and a fifth file subset 350, etc. It will be understood that Figure 3 The specific number of file subsets and the specific number of other elements shown in the figure are merely exemplary and are not intended to limit the scope of the present disclosure in any way. In other embodiments, the file set 120 can be divided into any appropriate number of file subsets. Figure 3Any other elements in may also have any other suitable number.
[0036] In an embodiment of the present disclosure, the files in each file subset 310 to 350 have the same file type. For example, the files in the first file subset 310 may have a first file type, the files in the second file subset 320 may have a second file type, the files in the third file subset 330 may have a third file type, the files in the fourth file subset 340 may have a fourth file type, and the files in the fifth file subset 350 may have a fifth file type, etc. In some embodiments, the first to fifth file types may be different file types.
[0037] Generally, the computing device 110 can divide the file set 120 to be backed up by any file type division method. As an example, the files in the file set 120 to be backed up can be divided into file types according to the file format indicated by the file extension of the file in the computer system. For example, the first file type can be a file type with an extension of EXE, the second file type can be a file type with an extension of DOC, the third file type can be a file type with an extension of AVI, the fourth file type can be a file type with an extension of MP3, and the fifth file type can be a file type with an extension of SQL, and so on. In this way, the computing device 110 can reuse the existing file type of the file in the computer system without having to set the file type for the file again for file backup, thereby simplifying the implementation of the embodiments of the present disclosure.
[0038] Alternatively or additionally, the file type used to perform file backup does not need to be mapped one-to-one with a specific file extension, but can be mapped to a preconfigured universal file type. In other words, the file type used for file backup can include a user-defined file type. For example, the file type can be "video", which means that it can cover all file types related to video, such as AVI files, WMV files, MKV files, etc. For another example, the file type can be "office files", which means that it can cover all file types related to office, such as PPT files, DOC files, etc. Mapping the file type used for file backup to a universal file type has significant technical advantages. For example, a user can customize the file type according to their own preferences to achieve the specific file classification purpose of a specific user.
[0039] In addition, for a certain file, its file type can be one of the preconfigured file types or a file type with a type name of "other". In this way, the computing device 110 can classify files that are not suitable for classification into a user-defined explicit file type into the "other" type. In some of the following descriptions, it will be assumed that the first file type of the first file subset 310 is a picture (PIC) file type, the second file type of the second file subset 320 is a video (VIDEO) file type, and the fifth file type of the fifth file subset 350 is an other (OTHERS) file type. However, it will be understood that the specific file types in these descriptions are merely illustrative and are not intended to limit the scope of the present disclosure in any way. In other embodiments, the first to fifth file types and more file types used for file backup can be any appropriate file types.
[0040] In some embodiments, the computing device 110 may also use the above two file type classification methods or other file type classification methods in combination. For example, a certain file in the file set 120 may have two file types, "MP3" and "audio". In this case, in the subsequent file backup process, the file may be backed up to a backup file corresponding to the MP3 file type, or to a backup file corresponding to the audio file type. In this way, in the file recovery process, the computing device 110 may provide the user with more file types that can be recovered.
[0041] Generally speaking, the backup process of the file system may include several stages, including a file traversal stage. During the file traversal, the computing device 110 may perform a series of operations on the files in the file set 120 to be backed up, such as creating metadata of the files, checking file duplication by checking the file cache, dividing the files into blocks, etc. The created file metadata may generally include information related to the file, such as the file name, file size, owner, group, access control list (ACL), etc.
[0042] Therefore, in some embodiments, regardless of the file type division method used to divide the file set 120, when performing file backup, the computing device 110 can determine the file type of each file in the file set 120 to be backed up. Then, the computing device 110 can generate metadata associated with each file to include information indicating the file type of the file. For example, the computing device 110 can add a new field "ftype" to the metadata of the file to indicate the type of the file. In this way, the computing device 110 can fully utilize the existing metadata of the file to be backed up to identify the type of the file without having to set an identifier for indicating the file type. Figure 4 A specific example of using metadata to identify file types is described below.
[0043] Figure 4 FIG. 4 shows example file metadata including file type information according to an embodiment of the present disclosure. Figure 4 As shown, assuming that the first file type of a certain file in the first file subset 310 (hereinafter also referred to as the first file) is a picture (PIC) file type, the first metadata 410 of the first file may include information indicating the file type of the first file, for example, "ftype=PIC". Similarly, the metadata of other files in the first file subset 310 may also include information indicating the file type, for example, "ftype=PIC".
[0044] Similarly, assuming that the second file type of a certain file in the second file subset 320 (hereinafter also referred to as the second file) is a video (VIDEO) file type, the second metadata 420 of the second file may include information indicating the file type of the second file, for example, "ftype=VEDIO". Similarly, the metadata of other files in the second file subset 320 may also include information indicating the file type, for example, "ftype=VEDIO".
[0045] Similarly, assuming that the fifth file type of a certain file in the fifth file subset 350 (hereinafter referred to as the fifth file) is the OTHERS file type, the fifth metadata 450 of the fifth file may include information indicating the file type of the fifth file, for example, "ftype=OTHERS". Similarly, the metadata of other files in the fifth file subset 350 may also include information indicating the file type, for example, "ftype=OTHERS".
[0046] will understand, Figure 4 The first metadata 410, the second metadata 420, the fifth metadata 450, etc. depicted in the figure are merely illustrative and are not intended to limit the scope of the present disclosure in any way. For example, the first metadata 410 is depicted as also including information such as the file name (file1.jpeg), the user ID (uid), the group ID (gid), and the mode (mode), the second metadata 420 is depicted as also including information such as the file name (file2.avi), the user ID, the group ID, and the mode, and the fifth metadata 450 is depicted as also including information such as the file name (file5.sst), the user ID, the group ID, and the mode (mode). However, in other embodiments, the first metadata 410, the second metadata 420, the fifth metadata 450, etc. may include more file information, less file information, and different file information than that shown.
[0047] In some embodiments, when the metadata of the files in the to-be-backed file set 120 includes file type information, the computing device 110 may divide the file set 120 into a plurality of file subsets 310 to 350 corresponding to different file types based on the metadata of the files. In this way, once the file type information of the to-be-backed file has been recorded in the metadata of the file, the computing device 110 may perform multiple backups for the file using the type information in the metadata of the file, thereby avoiding the need to re-determine the file type each time the file is backed up.
[0048] Return to reference Figure 2 and Figure 3 At 220, the computing device 110 generates a plurality of backup files (also referred to as sub-container files) 315 to 355, etc., respectively based on the plurality of file subsets 310 to 350, etc. For example, the backup files 315 to 355, etc. may be stored in the backup storage device 130. Specifically, the computing device 110 may generate a first backup file 315 based on the first file subset 310, a second backup file 325 based on the second file subset 320, a third backup file 335 based on the third file subset 330, a fourth backup file 345 based on the fourth file subset 340, and a fifth backup file 355 based on the fifth file subset 350, and so on.
[0049] Therefore, the plurality of backup files 315 to 355, etc. may respectively correspond to the plurality of file types of the files in the plurality of file subsets 310 to 350, etc. That is, the first backup file 315 may correspond to the first file type, the second backup file 325 may correspond to the second file type, the third backup file 335 may correspond to the third file type, the fourth backup file 345 may correspond to the fourth file type, and the fifth backup file 355 may correspond to the fifth file type, etc. This method of generating the backup files 315 to 355, etc. respectively according to the file type has significant technical advantages over the traditional backup method, as described in detail below.
[0050] For a backup session of a file system, traditionally there is only one backup file used to hold all file contents. The logic behind this is to keep similar file order between different backup sessions to preserve locality between files, thereby improving deduplication rate and throughput. The result is that all files are fed into one write stream of a backup file. However, mixing different types of files together for backup is not conducive to improving deduplication rate and throughput.
[0051] For example, suppose there are 4 files f1, f2, f3, and f4, where f1 and f3 have the same file type and therefore share more duplicate file segments, and f2 and f4 have the same file type and therefore share more duplicate file segments. However, f1 and f2 have almost no common file segments, and f3 and f4 also have almost no common file segments. For simplicity, assuming that the segment index cache in memory only applies to one file range, the 4 files will be traversed and written in the order of 1 to 4.
[0052] Specifically, the backup system may first perform deduplication on f1, write all file segments of f1 to the backup file, and then the file segment index of f1 is cached. Next, the backup system may perform deduplication on f2, and find no identical file segments in the file segment index cache, so all file segments of f2 are written to the backup file, and then the file segment index cache is replaced by f2. Then, the backup system may perform deduplication on f3, and find no matching file segments in the file segment index cache, so it is necessary to query the backup file for duplicate file segments, which may result in slow disk input / output (I / O), and then the file segment index cache is replaced by f3. Next, the backup system may perform deduplication on f4, and find no matching file segments in the file segment index cache, so it is necessary to query the backup file for duplicate file segments, which may result in slow disk I / O, and then the file segment index cache is replaced by f4.
[0053] It can be seen that in some extreme cases, the ingestion of each file will not match the file segment index cache in the memory, resulting in a large amount of slow disk I / O to query duplicate file segments from the backup file. In contrast, the advantage of having the same type of files backed up in separate backup files is obvious, which can improve deduplication and throughput while retaining file locality based on file type.
[0054] For example, continuing with the above example, in an embodiment of the present disclosure, f1 and f3 are backed up to the same backup file, while f2 and f4 are backed up to another backup file. The computing device 110 may first perform deduplication on f1 and write all file segments into the backup file, after which the file segment index of f1 is cached. Next, the computing device 110 may perform deduplication on f3, and then may find a large number of identical file segments in the file segment index cache of f1, so the identical file segments may be synthesized, with only a few new file segments being written to the backup file. Similarly, the same benefits also exist in the backup process of f2 and f4.
[0055] In addition, in some embodiments, when generating multiple backup files 315 to 355, etc., the computing device 110 may create multiple parallel threads corresponding to the multiple file subsets 310 to 350, etc., for respectively performing backup of the file subsets 310 to 350, etc. Then, the computing device 110 may generate corresponding backup files based on the files in the file subsets through corresponding threads for each file subset. In other words, the computing device 110 may use multiple threads to back up the first file subset 310 to the first backup file 315, the second file subset 320 to the second backup file 325, the third file subset 330 to the third backup file 335, the fourth file subset 340 to the fourth backup file 345, and the fifth file subset 350 to the fifth backup file 355, etc. This parallel backup method also has obvious technical advantages over the traditional backup method, as described in detail below.
[0056] In the traditional backup process of a single backup file, the backup system only establishes one write stream to highly preserve the locality between files, at the cost of only being able to use a single thread. In contrast, in an embodiment of the present disclosure, the computing device 110 can divide different files into multiple file subsets according to file type, so multiple ingest streams can be established to generate multiple backup files in parallel. If the data link used to transmit backup files or data content is not a bottleneck, then ideally, the backup time of the file set 120 can be reduced to 1 / N, where N is the number of file types. In addition, in each file subset, the order of file processing remains unchanged, so the locality between files is also preserved.
[0057] In some embodiments, after generating the plurality of backup files 315 to 355, etc., for each file subset in the plurality of file subsets 310 to 350, etc., computing device 110 may determine an identifier of a backup file corresponding to the file subset. For example, computing device 110 may determine an identifier of a first backup file 315 corresponding to the first file subset 310, an identifier of a second backup file 325 corresponding to the second file subset 320, an identifier of a third backup file 335 corresponding to the third file subset 330, an identifier of a fourth backup file 345 corresponding to the fourth file subset 340, an identifier of a fifth backup file 355 corresponding to the fifth file subset 350, and so on.
[0058] Then, computing device 110 may add the identifiers of the backup files to the metadata of the files in the corresponding file subsets. For example, computing device 110 may add the identifier of first backup file 315 to the metadata of the files in first file subset 310, add the identifier of second backup file 325 to the metadata of the files in second file subset 320, add the identifier of third backup file 335 to the metadata of the files in third file subset 330, add the identifier of fourth backup file 345 to the metadata of the files in fourth file subset 340, and add the identifier of fifth backup file 355 to the metadata of the files in fifth file subset 350, and so on. Figure 5 A specific example of adding a backup file identifier to metadata of a corresponding file is described below.
[0059] Figure 5 FIG. 4 shows example file metadata including a backup file identifier according to an embodiment of the present disclosure. Figure 5 As shown, continue to use the description Figure 4 In the example used when backing up, after a first file of a file type of picture (PIC) is backed up to a first backup file 315, the computing device 110 may add an identifier of the first backup file 315 to the metadata 510 of the first file. For example, the metadata 510 may include information "backup file ID=1". Similarly, after a second file of a file type of video (VIDEO) is backed up to a second backup file 325, the computing device 110 may add an identifier of the second backup file 325 to the metadata 510 of the second file. For example, the metadata 520 may include information "backupfile ID=2". Similarly, after a fifth file of a file type of others (OTHERS) is backed up to a fifth backup file 355, the computing device 110 may add an identifier of the fifth backup file 355 to the metadata 550 of the fifth file. For example, the metadata 550 may include information "backup file ID=5".
[0060] In this way, in a subsequent file recovery operation, the computing device 110 can determine from which backup file a certain file should be recovered from the metadata of the file, so that the embodiments of the present disclosure can also be applied to a file recovery method that is not based on the file type. For example, in this recovery method, the computing device 110 can provide a recoverable file directory and list to the user, so that the user can select one or more specific files to be recovered without first selecting the file type to be recovered. In this case, the computing device 110 can determine from which backup file to restore the file selected by the user from the metadata of the file selected by the user.
[0061] Return to reference Figure 2 and Figure 3 At 230, the computing device 110 generates a total backup file 360 corresponding to the file set 120 to be backed up based on the plurality of backup files 315 to 355, etc. That is, the computing device 110 may generate the total backup file 360 based on the first backup file 315, the second backup file 325, the third backup file 335, the fourth backup file 345, and the fifth backup file 355 to complete a full backup 370 of the file set 120. For example, the full backup 370 may correspond to a backup session.
[0062] In some embodiments, it may be advantageous for computing device 110 to generate a total backup file 360. For example, although computing device 110 may generate multiple backup files corresponding to different file types in one backup session, in some cases, an overall backup file representing the entire backup session may still be needed. For example, many backup operations, such as management operations such as retention, expiration, replication, and cloud movement, need to be completed in units of backups rather than in multiple backup files corresponding to file types. In addition, total backup file 360 may also maintain information about which backup file represents which file type.
[0063] Generally, computing device 110 may generate total backup file 360 from multiple backup files 315 to 355, etc. using any appropriate method. For example, computing device 110 may copy the contents of backup files 315 to 355, etc. to total backup file 360. In this direct way, computing device 110 may provide double protection for file set 120. Alternatively, in other embodiments, computing device 110 may create a reference file that logically points to multiple backup files 315 to 355, etc. as total backup file 360, so as not to occupy additional storage space. Figure 6 A specific example in which the computing device 110 generates a reference file as the total backup file 360 is described below.
[0064] Figure 6 FIG. 3 shows a schematic diagram of generating a reference file as a total backup file 360 according to an embodiment of the present disclosure. Figure 6As shown, computing device 110 can first create a reference file, which, for example, occupies almost negligible lower storage space. Then, computing device 110 can logically point the reference file to multiple backup files 315 to 355, etc., through reference relations 610, 620 and 650, etc., thereby generating a total backup file 360. In other words, the generated total backup file 360 can be a combination of all backup files of a backup session. However, this combination can be a logical concept, that is, the total backup file 360 can not occupy any additional physical storage space. Computing device 110 can adopt a variety of methods to achieve this goal, such as soft links or hard links at the operating system (OS) level, fast copy technology in the storage system, etc. After generating the total backup file 360, the management workflow 605 of the file backup system can be completed by accessing the total backup file 360, for example, the access to the total backup file 360 will be linked to multiple backup files 315 to 355, etc., thereby further accessing multiple backup files 315 to 355, etc.
[0065] In a file restore operation as an example of management workflow 605, computing device 110 may restore files in file set 120 from total backup file 360 based on a file restore request from a user. In some embodiments, since file set 120 is backed up according to file type, computing device 110 may also restore files in file set 120 according to file type accordingly. For example, after receiving a file restore request from a user, computing device 110 may determine a plurality of file types that may be restored from total backup file 360, such as a first type to a fifth type, etc. To this end, computing device 110 may read the supported file types for backup from total backup file 360. For example, computing device 110 may obtain the information from metadata of total backup file 360.
[0066] Next, the computing device 110 may provide the user with information indicating a plurality of file types so that the user may select a target file type from the plurality of file types to perform a file recovery operation. In this way, the user may flexibly select the file type to be recovered. For example, the computing device 110 may display supported file types on a display device for the user to select. Continuing with the above example, the computing device 110 may display a first file type (such as a picture file type), a second file type (such as a video file type), ..., a fifth file type (such as other file types), and so on to the user. It will be appreciated that the computing device 110 may also provide the above information to the user through any other appropriate human-computer interaction method, such as a voice interaction method, a tactile interaction method, and the like.
[0067] If the user selects a target file type from among the multiple file types available for restoration, computing device 110 may determine a target backup file corresponding to the target file type from among the multiple backup files 315 to 355, etc. That is, the user selects one or more file types, and computing device 110 may map them to specific backup files through total backup file 360. For example, assuming that the user selects to restore files of a second file type (such as a video file type), computing device 110 may determine a second backup file 325 corresponding to the second file type as the target backup file.
[0068] To this end, the computing device 110 can determine from the metadata of the second backup file 325 that it corresponds to the second file type. Then, the computing device 110 can restore files of the target file type (such as a video file type) based on the target backup file 325. For example, the computing device 110 can directly restore all video files backed up in the second backup file 325. In this way, the cumbersome and inconvenient browsing and selection operations required by the user to restore all files of a specific file type in the traditional backup method are avoided.
[0069] Alternatively, the computing device 110 may also restore one or more specific files of a certain file type based on the user's selection. To this end, assuming that the user selects the target file type 325, the computing device 110 may also determine a target backup file corresponding to the target file type (e.g., a video file type) from the plurality of backup files 315 to 355, such as the second backup file 325.
[0070] Then, the computing device 110 may provide the user with information indicating the recoverable files in the backup file so that the user can select a target file to be recovered from the recoverable files. For example, the computing device 110 may display on the display device a list of all files that can be recovered from the second backup file 325. In this way, the user can flexibly select a file of a specific file type to be recovered.
[0071] Then, when the user selects a target file to be restored, the computing device 110 can restore the target file based on the target backup file. In this way, the flexibility of the user in restoring files of a specific file type is improved, and the operations required for the user to restore one or more files of a specific file type are simplified compared to the traditional backup method.
[0072] In summary, the embodiments of the present disclosure provide a technical solution for file backup, which starts from the origin of the backup process and backs up files of different types into separate backup files, while not causing additional backup overhead relative to the traditional backup method. In this way, in addition to simplifying file backup and recovery operations, due to the appropriate classification of backup files, the locality based on file type in file backup is also enhanced, and parallel multi-stream backup can also be utilized, so the backup performance can be improved.
[0073] More specifically, the file type-based file backup and recovery solution of the embodiment of the present disclosure completes the file type classification during the backup process, and records the file classification information in the metadata of the file and the metadata of the backup file. In the subsequent file recovery, the user can conveniently restore a specific file type with one click. Similarly, since different types of files are backed up in different backup files, files with similar data patterns are more likely to be located in the same location, thereby improving the deduplication rate.
[0074] For the file backup operation of the file system, the files are classified according to the file type during the backup process, and this classification can be integrated into the file traversal process, so no additional system overhead is introduced. The backup system can divide the files to be backed up into different file subsets according to the file type, and the multiple file subsets are represented and generated into corresponding backup files in the backup session. As a result, for one backup session, the backup system can generate a total backup file, and the total backup file can have one or more backup files, each backup file containing the file content of one file type. In some embodiments, the total backup file can be a logical combination of all backup files (e.g., a snapshot mechanism), so it does not occupy additional storage capacity.
[0075] For file restore operations of a file system, a user can simply restore the entire backed-up file set by selecting a total backup file, or a user can choose to restore files with a specific file type by selecting a backup file corresponding to the specific file type. In some embodiments, the metadata of the file can be retained in the backup file. Therefore, if the user only wants to restore a single file, the file-level browsing and searching operations implemented based on the metadata can still be used.
[0076] Figure 7 A block diagram of a device 700 that can be used to implement an embodiment of the present disclosure is schematically shown. In some embodiments, the device 700 can be an electronic device that can be used to implement Figure 1 The computing device 110 in FIG. Figure 7As shown in FIG. 7 , the device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only storage device (ROM) 702 or loaded from a storage unit 708 to a random access storage device (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0077] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0078] The various processes and processing described above, such as method 200, may be performed by processing unit 701. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by CPU 701, one or more steps of method 200 described above may be performed.
[0079] As used herein, the term "including" and similar terms should be understood as open inclusion, i.e., "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included herein.
[0080] As used herein, the term "determine" encompasses a wide variety of actions. For example, "determine" may include computing, calculating, processing, deriving, investigating, searching (e.g., searching in a table, a database, or another data structure), ascertaining, etc. In addition, "determine" may include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory), etc. In addition, "determine" may include resolving, selecting, choosing, establishing, etc.
[0081] It should be noted that the embodiments of the present disclosure may be implemented by hardware, software, or a combination of software and hardware. The hardware portion may be implemented using dedicated logic; the software portion may be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods may be implemented using computer executable instructions and / or contained in a processor control code, such as a programmable memory or a data carrier such as an optical or electronic signal carrier, providing such code.
[0082] In addition, although the operation of the method of the present disclosure is described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flow chart can change the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution. It should also be noted that the features and functions of two or more devices according to the present disclosure can be embodied in one device. Conversely, the features and functions of a device described above can be further divided into being embodied by multiple devices.
[0083] Although the present disclosure has been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed. The present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method for file backup, comprising: Divide the file set to be backed up into multiple file subsets, where the files in each file subset have the same file type; Generating a plurality of backup files based on the plurality of file subsets respectively, the plurality of backup files respectively corresponding to a plurality of file types of files in the plurality of file subsets; as well as Based on the multiple backup files, a total backup file corresponding to the file set is generated, The generating of the plurality of backup files comprises: Creating a plurality of parallel threads corresponding to the plurality of file subsets; and For each file subset among the multiple file subsets, generating a backup file corresponding to the file subset based on the files in the file subset by using a thread corresponding to the file subset among the multiple threads; The method further comprises: Creating a reference file that logically points to the multiple backup files to serve as the total backup file; Determining, based on a file restoration request received from a user, a plurality of file types corresponding to the plurality of backup files that are restorable from the total backup file; and Information indicating the plurality of file types is provided to the user so that the user selects a target file type among the plurality of file types.
2. The method according to claim 1, further comprising: For each file in the file collection, determining a file type of the file; as well as generating metadata associated with the file, the metadata comprising information indicating a file type of the file; Wherein dividing the file set into the plurality of file subsets comprises: The file collection is divided into the plurality of file subsets based on the metadata of the files in the file collection.
3. The method according to claim 1, further comprising: After generating the plurality of backup files, for each file subset in the plurality of file subsets, determining an identifier of a backup file in the plurality of backup files that corresponds to the subset of files; as well as The identifier is added to metadata of files in the subset of files.
4. The method according to claim 1, further comprising: Determining a target backup file corresponding to the target file type among the multiple backup files according to determining that the user selects the target file type; as well as A file of the target file type is restored based on the target backup file.
5. The method according to claim 1, further comprising: Determining a target backup file corresponding to the target file type among the multiple backup files according to determining that the user selects the target file type; as well as Information indicating the restorable files in the backup file is provided to the user so that the user can select a target file to be restored from the restorable files.
6. The method according to claim 5, further comprising: According to determining that the user selects the target file, the target file is restored based on the target backup file. The method according to claim 1 , wherein the file type comprises a user-defined file type.
8. An electronic device, comprising: at least one processor; as well as at least one memory storing computer program instructions, the at least one memory and the computer program instructions being configured, together with the at least one processor, to cause the electronic device to: Divide the file set to be backed up into multiple file subsets, where the files in each file subset have the same file type; Generating a plurality of backup files based on the plurality of file subsets respectively, the plurality of backup files respectively corresponding to a plurality of file types of files in the plurality of file subsets; as well as Based on the multiple backup files, generate a total backup file corresponding to the file set; The electronic device generates the multiple backup files by: Creating a plurality of parallel threads corresponding to the plurality of file subsets; as well as For each file subset among the multiple file subsets, generating a backup file corresponding to the file subset based on the files in the file subset by using a thread corresponding to the file subset among the multiple threads; The at least one memory and the computer program instructions are configured to, together with the at least one processor, enable the electronic device to generate the total backup file by: Creating a reference file that logically points to the multiple backup files to serve as the total backup file; Determining, based on a file recovery request received from a user, a plurality of file types corresponding to the plurality of backup files that can be recovered from the total backup file; as well as Information indicating the plurality of file types is provided to the user so that the user selects a target file type among the plurality of file types.
9. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: For each file in the file collection, determining a file type of the file; and generating metadata associated with the file, the metadata comprising information indicating a file type of the file; The at least one memory and the computer program instructions are configured to, together with the at least one processor, enable the electronic device to divide the file set into the plurality of file subsets by: The file collection is divided into the plurality of file subsets based on the metadata of the files in the file collection.
10. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: After generating the plurality of backup files, for each file subset in the plurality of file subsets, determining an identifier of a backup file in the plurality of backup files that corresponds to the subset of files; and The identifier is added to metadata of files in the subset of files.
11. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: Determining a target backup file corresponding to the target file type among the multiple backup files according to determining that the user selects the target file type; and A file of the target file type is restored based on the target backup file.
12. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: Determining a target backup file corresponding to the target file type among the multiple backup files according to determining that the user selects the target file type; and Information indicating the restorable files in the backup file is provided to the user so that the user can select a target file to be restored from the restorable files.
13. The electronic device of claim 12, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: According to determining that the user selects the target file, the target file is restored based on the target backup file. The electronic device according to claim 8 , wherein the file type comprises a user-defined file type.
15. A computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions which, when executed, cause a machine to perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Two-stage single-instance data de-duplication backup method
CN103324552A
Application perception data routing method oriented to large-scale cluster deduplication and system
CN103902735A
Backup file recovery method for heterogeneous database
CN107391306A
Data backup method, mobile terminal and computer readable storage medium
CN108021470A
Concurrent backup method and a system of virtual machine files
CN109344001A
