Data backup method, device and electronic equipment

By obtaining the meta-information of the data to be backed up and using logical data buckets for parallel reading and storage, the problems of slow backup speed and waste of storage space in the existing technology are solved, and fast and efficient data backup and recovery are achieved.

CN114218015BActive Publication Date: 2024-09-13HAIKOU SHARING CIRCLE INTELLECTUAL PROPERTY CONSULTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111600059.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2024-09-13
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

Existing data backup solutions suffer from the problems of slow backup speed and waste of storage space. Especially when backing up big data, it is difficult to complete the backup within the specified time, and the backup speed is slowed down due to reading invalid data, and the storage space requested is too much. Big and a waste of resources.

Method used

By obtaining the meta-information of the data to be backed up, determining its actual size, applying for the corresponding backup space, and reading and storing based on the offset position and offset of the real sub-data, using logical data buckets for parallel reading and storage. Avoid reading and storing invalid data and improve backup efficiency.

Benefits of technology

It achieves a faster data backup process, avoids waste of storage space, improves backup efficiency and adaptability, especially when backing up big data, can complete the backup within the specified time, and improves the efficiency of data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114218015B
    Figure CN114218015B
Patent Text Reader

Abstract

The present invention relates to the field of data backup technology, and in particular to a data backup method, device and electronic device, the method comprising obtaining meta information corresponding to data to be backed up, the meta information comprising an actual size; applying for at least one backup space based on the actual size; parsing the data to be backed up, determining the offset position and offset of each real sub-data in the data to be backed up; reading each real sub-data based on the offset position and offset of each real sub-data, and storing each real sub-data using the at least one backup space. Applying for backup space using the actual size of the data to be backed up can avoid wasting backup space resources; and reading data is based on the offset position and offset of each real sub-data, so that addressing and transmission of blank data is not required during backup, thereby improving backup speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data backup, and in particular to a data backup method, device and electronic equipment. Background Art

[0002] Existing data backup algorithms are generally based on the system file read and write interface to read the source data disk, and then write it to the backup target disk. This solution is based on the read and write file interface provided by the operation, which is simple to use. For general small files or scenarios that require a loose backup rate, it is obviously a solution that best balances cost, system complexity and engineering efficiency.

[0003] In order to provide better services and avoid the impact of backup resources on the business side, backup cannot be performed during the business service time period. Therefore, the actual scenario is that backup is usually performed in the second half of the night, and usually needs to be completed within a specified few hours. For a single backup data source greater than 2T and a strict backup time period requirement, it is difficult to meet the backup requirements within the specified time period if the backup processing based on the read-write file interface provided by the system is continued. This is because the existing backup solution has a slow backup speed and wastes storage space. Specifically, in fact, the disk is not always full of data, so there are many blank spaces in the disk, which can be understood as invalid data. The existing system file read-write interface also reads these invalid data when reading. In fact, a 2T disk may actually have only 10GB of actual data, but the backup reads 2TB of data, which will seriously affect the backup speed, because the invalid data outside the 10GB data does not actually need to be read and backed up; at the same time, because the existing backup solution will apply for a storage space of the same size as the source data disk when the backup storage is initialized, the main purpose is for subsequent recovery, but in fact, such a large storage space cannot be used for a long time, which leads to a waste of storage space. Summary of the invention

[0004] In view of this, embodiments of the present invention provide a data backup method, device and electronic device to solve the problems of slow data backup speed and waste of storage space.

[0005] According to a first aspect, an embodiment of the present invention provides a data backup method, including:

[0006] Obtaining meta information corresponding to the data to be backed up, the meta information including the actual size;

[0007] Applying for at least one backup space based on the actual size;

[0008] Parsing the data to be backed up to determine the offset position and offset amount of each real sub-data in the data to be backed up;

[0009] The respective real sub-data are read based on the offset position and the offset amount of the respective real sub-data, and the respective real sub-data are stored using the at least one backup space.

[0010] The data backup method provided by the embodiment of the present invention applies for backup space using the actual size of the data to be backed up, thereby avoiding waste of backup space resources; and when reading data, it is based on the offset position and offset of each real sub-data, so that there is no need to address and transmit blank data during backup, thereby improving the backup speed.

[0011] In combination with the first aspect, in a first implementation of the first aspect, reading each real sub-data based on the offset position and the offset amount of each real sub-data, and storing each real sub-data using the at least one backup space includes:

[0012] Initializing a preset number of logical data buckets to correspond each of the logical data buckets to the at least one backup space;

[0013] Based on the preset number of logical data buckets and the offset position and offset amount of each real sub-data, reading each real sub-data;

[0014] Based on the corresponding relationship between each of the logical data buckets and the backup space, the real sub-data is stored.

[0015] The data backup method provided by the embodiment of the present invention has many physical formats for data storage, some of which require storage in private clouds and public clouds, and their interfaces are different. In this case, different physical storage interfaces only need to implement their own drivers to connect to 10 logical data buckets, thereby improving the scalability and adaptability of the backup method.

[0016] In combination with the first implementation of the first aspect, in the second implementation of the first aspect, reading each real sub-data based on the preset number of logical data buckets and the offset position and offset of each real sub-data includes:

[0017] Dividing the data to be backed up into the preset number of data segments to determine the initialization offset address of each of the logical data buckets;

[0018] Based on the initialization offset address of each of the logical data buckets and the offset position and offset amount of each of the real sub-data, the real sub-data are read in parallel.

[0019] The data backup method provided by the embodiment of the present invention performs parallel reading of the data to be backed up through various logical data buckets, thereby improving the efficiency of data backup.

[0020] In combination with the first implementation of the first aspect, in a third implementation of the first aspect, applying for at least one backup space based on the actual size includes:

[0021] When the actual size is greater than a preset value, applying for the preset amount of backup space;

[0022] When the actual size is less than or equal to the preset value, apply for the backup space.

[0023] The data backup method provided by the embodiment of the present invention, when the actual size of the data to be backed up is small, if multiple backup spaces are used for backup, more small files will be generated. Therefore, in this case, only one backup space is applied for data backup, which can improve data backup efficiency.

[0024] In combination with the first implementation of the first aspect, in a fourth implementation of the first aspect, storing the real sub-data based on the correspondence between each of the logical data buckets and the backup space includes:

[0025] Writing the real sub-data read from the logical data bucket into the corresponding backup space;

[0026] The data in each of the backup spaces is compressed respectively to determine compressed data.

[0027] The data backup method provided in the embodiment of the present invention adopts the design concept of a preset number of logical data buckets. Since small files are compressed and stored faster than large files, the data decompression process is more than N times faster than the existing solution, where N is the preset number.

[0028] In combination with the first aspect, in a fifth implementation of the first aspect, the method further includes:

[0029] Writing the metadata of the data to be backed up into a metadata file;

[0030] Writing the offset position and offset of each real sub-data in the data to be backed up into the data metafile;

[0031] The metadata file and the data metafile are stored.

[0032] The data backup method provided by the embodiment of the present invention stores the meta information of the data to be backed up and the offset position and offset of each real sub-data, so that the data can be accurately restored during subsequent data restoration.

[0033] In combination with the fifth implementation of the first aspect, in the sixth implementation of the first aspect, the method further includes:

[0034] When disaster recovery data is required, obtain the target backup space corresponding to the data to be recovered;

[0035] Decompressing the compressed data in the target backup space;

[0036] The decompressed data is restored based on the metadata file and the data metafile to determine the data to be restored.

[0037] The data backup method provided by the embodiment of the present invention can improve the efficiency of disaster recovery data recovery by decompressing the compressed data in the target backup space in parallel and then restoring the data during data recovery.

[0038] According to the second aspect, an embodiment of the present invention further provides a data backup device, including:

[0039] An acquisition module, used to acquire meta information corresponding to the data to be backed up, wherein the meta information includes an actual size;

[0040] An application module, configured to apply for at least one backup space based on the actual size;

[0041] A parsing module, used for parsing the data to be backed up, and determining the offset position and offset amount of each real sub-data in the data to be backed up;

[0042] The backup module is used to read each real sub-data based on the offset position and offset of each real sub-data, and store each real sub-data by using the at least one backup space.

[0043] According to the third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data backup method described in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.

[0044] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the data backup method described in the first aspect or any one of the implementations of the first aspect.

[0045] It should be noted that, for the beneficial effects of the data backup device, electronic device, and computer-readable storage medium provided by the embodiments of the present invention, please refer to the description of the corresponding beneficial effects of the data backup method above, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 is a flow chart of a data backup method according to an embodiment of the present invention;

[0048] Figure 2 is a schematic diagram of obtaining meta information according to an embodiment of the present invention;

[0049] Figure 3 is a flow chart of a data backup method according to an embodiment of the present invention;

[0050] Figure 4 is a schematic diagram of initializing 10 logical data buckets according to an embodiment of the present invention;

[0051] Figure 5 is a flow chart of a data backup method according to an embodiment of the present invention;

[0052] Figure 6 is a flow chart of a data backup method according to an embodiment of the present invention;

[0053] Figure 7 is a schematic diagram of a data metafile index according to an embodiment of the present invention;

[0054] Figure 8 is a structural block diagram of a data backup device according to an embodiment of the present invention;

[0055] Fig. 9 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0057] The data backup method provided by the embodiment of the present invention applies for backup space based on the actual size of the data to be backed up to prevent waste of backup space resources; and uses the offset address and offset of the real sub-data in the data to be backed up to read the real sub-data to avoid reading invalid data, thereby improving backup efficiency.

[0058] Furthermore, the data backup method also introduces the concept of logical data buckets, which uses logical data buckets for concurrent reading of data to be backed up, which not only improves processing efficiency, but also avoids the impact of different reading methods caused by different interfaces of different backup spaces, thereby improving the scalability and adaptability of the solution.

[0059] According to an embodiment of the present invention, a data backup method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0060] In this embodiment, a data backup method is provided, which can be used in the above-mentioned electronic devices, such as clients, servers, etc. Figure 1 is a flow chart of a data backup method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0061] S11, obtaining meta information corresponding to the data to be backed up.

[0062] The meta information includes the actual size.

[0063] When backing up the data to be backed up, the electronic device first reads the meta information of the target data disk storing the data to be backed up, including the actual size, i.e., the actual size of the data to be backed up; as well as the drive format of the target data disk, the size of the target data disk, the drive letter position, the drive letter name, etc. The actual size of the data to be backed up is used to apply for backup space.

[0064] Furthermore, the meta information read is also used to initialize the data disk during data recovery; it is used to divide the data segments into backup logical data buckets when storing backup data; with this meta information, when initializing the backup data storage, only the actual size of the backup space is needed.

[0065] Data written to the disk is recorded in the form of clusters, and a cluster can only store one file data. When writing data, the disk will record in the FAT table the mark that the current cluster is occupied by a file. Then, by counting the number of clusters occupied by all marks and then reading the cluster size of the disk partition information, the file size is calculated as the number of clusters * the disk cluster size. This is generally larger than the actual file size, because no matter how small the file is, it will occupy a cluster size position, but it has no effect on this solution. Based on this, the electronic device can determine the actual size of the data to be backed up by using the number of clusters * the size of the disk cluster.

[0066] like Figure 2 As shown, if this backup needs to back up the data to be backed up in three data disks, namely data disk 1, data disk 2, and data disk 3. Then, the electronic device first reads the metadata of each data disk respectively, and obtains metadata of data disk 1, data disk 2, and data disk 3 respectively.

[0067] Of course, the specific content of the obtained meta information can be set according to actual needs, and no limitation is made here. The object for reading the meta information is not limited to the data disk mentioned above, but can also be other spaces for storing data to be backed up.

[0068] S12: Apply for at least one backup space based on the actual size.

[0069] The electronic device applies for a backup space corresponding to the actual size. The backup space can be one, that is, the size of the backup space corresponds to the actual size; or multiple backup spaces can be applied for, and the sum of the sizes of the multiple backup spaces corresponds to the actual size. The specific number of backup spaces applied for is set according to actual needs, and it is only necessary to ensure that the sizes of all backup spaces correspond to the actual size.

[0070] S13, parsing the data to be backed up, and determining the offset position and offset of each real sub-data in the data to be backed up.

[0071] The electronic device uses the corresponding file system to parse the data to be backed up, and determines the offset position and offset amount of each real sub-data in the data to be backed up. Since the data to be backed up may include multiple files, each file may be stored continuously or in pieces when stored in the target data disk. Therefore, by parsing the data to be backed up, the offset position and offset amount of each file can be determined. Of course, for a file, it can be one offset position and offset amount, or multiple offset positions and offset amounts.

[0072] There is no limitation on the specific parsing process, which can be set according to actual needs.

[0073] S14, reading each real sub-data based on the offset position and offset of each real sub-data, and storing each real sub-data in at least one backup space.

[0074] The electronic device can read each real sub-data of the data to be backed up from the target data disk by using the offset position and offset of each real sub-data. The reading process of each real sub-data can be parallel or sequential, etc. After reading each real sub-data, the electronic device stores it by using the at least one backup space applied in S12.

[0075] The specific storage method is related to the backup space applied for. If there are multiple backup spaces, they can be read and stored in parallel; if there is only one backup space, they can be read and stored sequentially, etc. The backup space can be in the form of a local private cloud, a shared cloud, or a local file system, etc.

[0076] This step will be described in detail below.

[0077] The data backup method provided in this embodiment applies for backup space based on the actual size of the data to be backed up, thereby avoiding waste of backup space resources; and reading data is based on the offset position and offset of each real sub-data, so that there is no need to address and transmit blank data during backup, thereby improving the backup speed.

[0078] In this embodiment, a data backup method is provided, which can be used in the above-mentioned electronic devices, such as clients, servers, etc. Figure 3 is a flow chart of a data backup method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0079] S21, obtaining meta information corresponding to the data to be backed up.

[0080] The meta information includes the actual size.

[0081] For details, please see Figure 1 S11 of the illustrated embodiment will not be described in detail here.

[0082] S22: Apply for at least one backup space based on the actual size.

[0083] Specifically, the above S22 includes:

[0084] S221, determining whether the actual size is greater than a preset value.

[0085] The preset value may be set based on an empirical value, or may be set based on engineering business requirements, etc. When the actual size is greater than the preset value, S222 is executed; otherwise, S223 is executed.

[0086] S222, applying for a preset amount of backup space.

[0087] S223, apply for a backup space.

[0088] For example, the preset value is 1GB, and the electronic device compares the actual size of the data to be backed up with 1GB. If the actual size of the data to be backed up is greater than 1GB, a preset number of backup spaces will be applied for; otherwise, only one backup space will be applied for. This is because, when the actual size of the data to be backed up is less than or equal to the preset value, there is not much difference between reading the data to be backed up as a whole or dividing it into data segments and storing it concurrently. On the contrary, dividing the data-end storage will bring a lot of small files, which will bring file management problems. Based on this, when the actual size of the data to be backed up is less than or equal to the preset value, the electronic device only applies for one backup space.

[0089] Among them, the preset quantity is set based on actual needs, for example, 10, 8, etc.

[0090] S23, parsing the data to be backed up, and determining the offset position and offset of each real sub-data in the data to be backed up.

[0091] For details, please see Figure 1 S13 of the illustrated embodiment will not be described in detail here.

[0092] S24, reading each real sub-data based on the offset position and offset of each real sub-data, and storing each real sub-data in at least one backup space.

[0093] Specifically, the above S24 includes:

[0094] S241, initializing a preset number of logical data buckets to correspond each logical data bucket to at least one backup space.

[0095] Because the traditional solution is a whole, it is very slow in data compression and decompression, and once the data is damaged, it is damaged, causing a high probability of damage. Therefore, this method proposes to split it into multiple files, which can improve the efficiency of compression and decompression, because they can be parallel, and the compression and decompression of small files are faster than that of a single large file. At the same time, when redundant storage is used, even if one part is damaged, it can be more easily replaced by another redundant part, thereby reducing file damage. Based on this, the processing method of logical data buckets is proposed in this solution.

[0096] At the same time, since there are many physical formats of various storage spaces, some require storage in private clouds and public clouds, and their interfaces are different, then different physical storage interfaces only need to implement their own drivers to connect to these logical data buckets, thereby improving the scalability and adaptability of this solution. Therefore, this solution uses logical buckets instead of physical buckets.

[0097] Before data backup, the electronic device is configured to obtain a preset number of logical data buckets, for example, 10 logical data buckets. Through actual engineering practice and decompression rate comparison, it is found that dividing into 10 logical data buckets is the best test solution. It should be noted that the logical data buckets are configured in advance and do not distinguish the size of the data to be backed up, but the backup space linked behind the logical data bucket will apply for different quantities due to the size of the data.

[0098] When backing up data, the electronic device initializes a preset number of logical data buckets and corresponds each logical data bucket to the backup space. As described above, when applying for one backup space, the preset number of logical data buckets are all corresponding to this backup space; when applying for a preset number of backup spaces, each logical data bucket is respectively corresponding to each backup space.

[0099] As mentioned above, the number of logical data buckets can be set according to actual needs, such as Figure 4 As shown, in the following description, 10 logical data buckets and a preset value of 1GB are used as an example. The logical data buckets are initialized, and the purpose is to initiate 1-10 backups for concurrent backup according to the initialization offset positions of the 10 logical data buckets; according to the 10 logical data buckets, the data to be backed up is stored in 10 blocks and compressed and stored separately. If the actual size of the data to be backed up is less than 1GB, the 10 logical data buckets actually correspond to one backup space.

[0100] S242, reading each real sub-data based on a preset number of logical data buckets and the offset position and offset of each real sub-data.

[0101] The electronic device addresses the target data disk, records the offset position and offset of each real sub-data, and stores it as a data metafile. The data metafile structure is an array, and each data index stores the offset position and offset of each real sub-data, such as Figure 7As shown, the data on the target data disk mainly includes MBR area, DBR area, FAT area, DIR area and DATA area according to different functions. By reading the BPB partition parameter record table in the DBR area of ​​the disk, the starting sector, ending sector, file storage format and root directory size of the current disk are obtained; and then the starting unit and file size of each file are located by combining the FAT area and DIR area of ​​the disk. These are the offset position and data size of the real data in the data disk. The electronic device can read each real sub-data in the DATA area according to these offset positions and offsets.

[0102] The electronic device writes the recorded offset position and the offset of each real sub-data into the initialized logical data bucket, and performs concurrent writing according to the number of logical data buckets. This process uses the offset position of each real sub-data and the offset of the file size obtained by addressing for backup writing, and no additional addressing of blank data areas and backup blank data areas are required, saving backup time and backup bandwidth.

[0103] In some optional implementations of this embodiment, the above S242 may include:

[0104] (1) Divide the data to be backed up into a preset number of data segments to determine the initialization offset address of each logical data bucket.

[0105] (2) Based on the initialization offset address of each logical data bucket and the offset position and offset of each real sub-data, each real sub-data is read in parallel.

[0106] Specifically, the electronic device divides the backup data using the number of logical data buckets to obtain a preset number of data segments. The lengths of the data segments obtained by the division can be the same or different. When dividing, try to divide the data belonging to the same real sub-data into the same data segment.

[0107] After the division is completed, the starting offset address of each data segment is the initialization offset address of each logical data bucket. Each logical data bucket reads each real sub-data in parallel based on the offset position and offset of each real sub-data.

[0108] The data to be backed up is read in parallel through each logical data bucket, which improves the efficiency of data backup.

[0109] S243, based on the correspondence between each logical data bucket and the backup space, the real sub-data is stored.

[0110] As described above, after the logical data buckets are initialized, each logical data bucket is associated with a backup space. During storage, each backup space corresponds to a storage queue, and each logical data bucket adds the read real sub-data to the storage queue of the corresponding backup space for storage.

[0111] If all logical data buckets correspond to one backup space, the real sub-data in all logical data buckets are added to the same storage queue; if each logical data bucket corresponds to a backup space, the real sub-data in each logical data bucket is added to the corresponding storage queue.

[0112] In some optional implementations of this embodiment, the above S243 may include:

[0113] (1) Write the real sub-data read from the logical data bucket into the corresponding backup space.

[0114] (2) Compress the data in each backup space respectively to determine the compressed data.

[0115] After the data to be backed up is successfully written into each logical data bucket, according to the user's data compression requirements, if there is a btrfs or zfs compression algorithm, select the corresponding compression algorithm to compress it into 10 data blocks. These 10 logical data buckets are based on the abstraction of the backup storage object. If the backup storage object is an object storage, then the 10 logical data buckets are the corresponding data blocks; if it is a data disk, then it is a data file.

[0116] The design concept of using a preset number of logical data buckets makes the data decompression process N times faster than existing solutions, because small files are compressed and stored faster than large files, where N is the preset number.

[0117] The data backup method provided in this embodiment, when the actual size of the data to be backed up is small, if multiple backup spaces are used for backup, more small files will be generated. Therefore, in this case, only one backup space is applied for data backup, which can improve the data backup efficiency. Because there are many physical formats for data storage, some require storage in private clouds and public clouds, and their interfaces are different, then different physical storage interfaces only need to implement their own drivers to connect to 10 logical data buckets, thereby improving the scalability and adaptability of the backup method.

[0118] In a specific application example of this embodiment, Figure 5 As shown, the data backup method includes:

[0119] Step 1: Scheduled backup triggers the data backup task and sends the backup task to the backup service;

[0120] Step 2: The backup service reads the data disk to be backed up according to the task ID and starts a data backup subprocess for each data disk;

[0121] Step 3: The data backup subprocess reads the metadata of the current data disk, writes it into the metadata file, and saves the metadata file;

[0122] Step 4: Apply for 10 logical data buckets based on the data disk metadata and apply for backup space of the actual data size. If the application fails, the backup fails. If the application succeeds, determine whether the current actual data size is less than 1GB. If so, all 10 logical data buckets point to this backup space. Otherwise, treat the backup data as 10 equal parts and store them. Connect 10 logical data buckets to 10 backup spaces respectively.

[0123] Step 5: The backup server reads the disk partition of the current data disk, performs logical processing to obtain the real file offset position and offset of the current data disk, and writes it into a file, which is the data metafile, and stores it in the backup space;

[0124] Step 6: Based on the data metafile, 10 data processes are concurrently executed to back up data to the corresponding backup space;

[0125] Step 7: After the backup data is successfully written, the zfs compression algorithm is used by default to compress the data in the 10 backup spaces respectively;

[0126] Step 8: Gzip the obtained data disk metafile, data metafile and compressed data into tar and archive them to the corresponding storage space;

[0127] Step 9: Backup completed.

[0128] This solution first obtains the offset position and offset of each real sub-data in the data to be backed up by reading the disk information recorded in the data partition, so that there is no need to address and transmit blank data during backup, thereby improving the backup speed. When the amount of data on the data disk is small, the speed of full backup is very fast. This solution only stores real sub-data, so you only need to apply for storage space of the actual size of the data to be backed up. If the source data disk is 2T, and the actual size of the data to be backed up is only 10GB, then this solution only needs to apply for a backup space of 10GB, instead of a backup space of 2T. The design concept of 10 logical data buckets is adopted. Because small files are compressed and stored faster than large files, the data decompression process can be more than 10 times faster than existing solutions.

[0129] In this embodiment, a data backup method is provided, which can be used in the above-mentioned electronic devices, such as clients, servers, etc. Figure 6 is a flow chart of a data backup method according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:

[0130] S31, obtaining meta information corresponding to the data to be backed up.

[0131] The meta information includes the actual size.

[0132] For details, please see Figure 1 S11 of the illustrated embodiment will not be described in detail here.

[0133] S32: Apply for at least one backup space based on the actual size.

[0134] For details, please see Figure 3 S22 of the illustrated embodiment will not be described in detail here.

[0135] S33, parsing the data to be backed up, and determining the offset position and offset of each real sub-data in the data to be backed up.

[0136] For details, please see Figure 1 S13 of the illustrated embodiment will not be described in detail here.

[0137] S34, reading each real sub-data based on the offset position and offset of each real sub-data, and storing each real sub-data in at least one backup space.

[0138] During the backup process, in addition to storing the backup data, the metadata file and the data metafile are also stored. Specifically,

[0139] (1) Write the metadata corresponding to the data to be backed up into the metadata file;

[0140] (2) writing the offset position and offset of each real sub-data in the data to be backed up into the data metafile;

[0141] (3) Storing metadata files and data metafiles.

[0142] Specifically, metadata file: refers to the file that stores the size, format, location, drive letter, actual data size and other information of the target data disk, which is used to apply for the physical storage size of the backup data and restore the original information of the target data disk required to rebuild the target data disk. Data metafile: refers to the file that stores the offset position and offset of each real sub-data in the target data disk, as well as the segment number and order information of the 10 logical data buckets after the backup, which is used for data recovery.

[0143] The metadata of the data to be backed up and the offset position and offset of each real sub-data are stored so that the data can be accurately restored during subsequent data recovery.

[0144] For more details, please see Figure 3 S24 of the illustrated embodiment will not be described in detail here.

[0145] S35, when disaster recovery data is required, obtaining the target backup space corresponding to the data to be recovered.

[0146] When disaster recovery data recovery is required, it is determined based on the recovery requirements whether all data or part of the data needs to be recovered. Since when the data to be backed up is backed up, it is divided into at least one backup space for storage, if only part of the data needs to be recovered, only this part of the data can be recovered without restoring all the data. Based on this, when disaster recovery data recovery is required, the electronic device first determines the target backup space corresponding to the data to be recovered.

[0147] S36, decompressing the compressed data in the target backup space.

[0148] S37, restoring the decompressed data based on the metadata file and the data metafile to determine the data to be restored.

[0149] Since the data in each backup space is stored after being compressed, it is necessary to first decompress the compressed data in the target backup space, and then restore the decompressed data based on the metadata file and the data metafile to determine the data to be restored.

[0150] Specifically, when the disaster recovery data is restored, when the data in all the backup spaces need to be restored, 10 logical data buckets are decompressed at the same time. Different from the existing scheme, this scheme divides the data to be backed up into 10 logical data buckets for compression and decompression, and its speed will be 10 times that of directly compressing and decompressing the original source data. After recovery, apply for a data disk with the same specification parameters according to the metadata file and initialize it, and then copy and restore the decompressed data according to the original offset position according to the data metadata file, and all the data to be backed up can be restored.

[0151] The data backup method provided in this embodiment can improve the efficiency of disaster recovery data recovery by decompressing the compressed data in the target backup space in parallel and then restoring the data during data recovery.

[0152] In the present embodiment, a data backup device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0153] This embodiment provides a data backup device, such as Figure 8 As shown, including:

[0154] An acquisition module 41 is used to acquire meta information corresponding to the data to be backed up, wherein the meta information includes an actual size;

[0155] An application module 42, configured to apply for at least one backup space based on the actual size;

[0156] The parsing module 43 is used to parse the data to be backed up and determine the offset position and offset of each real sub-data in the data to be backed up;

[0157] The backup module 44 is configured to read each real sub-data based on the offset position and the offset of each real sub-data, and store each real sub-data by using the at least one backup space.

[0158] The data backup device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0159] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.

[0160] The embodiment of the present invention also provides an electronic device having the above Figure 8 The data backup device shown.

[0161] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Fig. 9As shown, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, a memory 54, and at least one communication bus 52. The communication bus 52 is used to realize the connection and communication between these components. The communication interface 53 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 53 may also include a standard wired interface and a wireless interface. The memory 54 may be a high-speed RAM memory (Random Access Memory) or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 54 may optionally be at least one storage device located away from the aforementioned processor 51. The processor 51 may be combined with Figure 8 In the described device, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 to execute any of the above method steps.

[0162] The communication bus 52 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 52 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0163] Among them, the memory 54 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 54 may also include a combination of the above types of memory.

[0164] The processor 51 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.

[0165] The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0166] Optionally, the memory 54 is also used to store program instructions. The processor 51 can call the program instructions to implement the data backup method shown in any embodiment of the present application.

[0167] The embodiment of the present invention also provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the data backup method in any of the above method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.

[0168] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A data backup method, characterized in that: include: Obtaining meta information corresponding to the data to be backed up, the meta information including the actual size; Applying for at least one backup space based on the actual size; Parsing the data to be backed up to determine the offset position and offset amount of each real sub-data in the data to be backed up; Reading each real sub-data based on the offset position and the offset amount of each real sub-data, and storing each real sub-data by using the at least one backup space; The reading of each real sub-data based on the offset position and the offset of each real sub-data and storing each real sub-data by using the at least one backup space includes: Initializing a preset number of logical data buckets to correspond each of the logical data buckets to the at least one backup space, the logical data buckets being logical buckets; Based on the preset number of logical data buckets and the offset position and offset amount of each real sub-data, reading each real sub-data; Based on the correspondence between each of the logical data buckets and the backup space, the real sub-data is stored; The reading of each real sub-data based on the preset number of logical data buckets and the offset position and offset of each real sub-data includes: Dividing the data to be backed up into the preset number of data segments to determine the initialization offset address of each of the logical data buckets; Based on the initialization offset address of each of the logical data buckets and the offset position and offset amount of each of the real sub-data, the real sub-data are read in parallel.

2. The method according to claim 1, characterized in that The applying for at least one backup space based on the actual size includes: When the actual size is greater than a preset value, applying for the preset amount of backup space; When the actual size is less than or equal to the preset value, apply for the backup space.

3. The method according to claim 1, characterized in that The storing of the real sub-data based on the correspondence between each of the logical data buckets and the backup space includes: Writing the real sub-data read from the logical data bucket into the corresponding backup space; The data in each of the backup spaces is compressed respectively to determine compressed data.

4. The method according to claim 1, characterized in that The method further comprises: Writing the metadata corresponding to the data to be backed up into a metadata file; Writing the offset position and offset of each real sub-data in the data to be backed up into the data metafile; The metadata file and the data metafile are stored.

5. The method according to claim 4, characterized in that The method further comprises: When disaster recovery data is required, obtain the target backup space corresponding to the data to be recovered; Decompressing the compressed data in the target backup space; The decompressed data is restored based on the metadata file and the data metafile to determine the data to be restored.

6. A data backup device, characterized in that: include: An acquisition module, used to acquire meta information corresponding to the data to be backed up, wherein the meta information includes an actual size; An application module, configured to apply for at least one backup space based on the actual size; A parsing module, used for parsing the data to be backed up, and determining the offset position and offset amount of each real sub-data in the data to be backed up; a backup module, configured to read each real sub-data based on an offset position and an offset of each real sub-data, and store each real sub-data by using the at least one backup space; Wherein, the backup module is specifically used for: Initializing a preset number of logical data buckets to correspond each of the logical data buckets to the at least one backup space, the logical data buckets being logical buckets; Based on the preset number of logical data buckets and the offset position and offset amount of each real sub-data, reading each real sub-data; Based on the correspondence between each of the logical data buckets and the backup space, the real sub-data is stored; The reading of each real sub-data based on the preset number of logical data buckets and the offset position and offset of each real sub-data includes: Dividing the data to be backed up into the preset number of data segments to determine the initialization offset address of each of the logical data buckets; Based on the initialization offset address of each of the logical data buckets and the offset position and offset amount of each of the real sub-data, the real sub-data are read in parallel.

7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data backup method according to any one of claims 1 to 5 by executing the computer instructions.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data backup method according to any one of claims 1 to 5.