Data backup method and device, computer equipment, storage medium and computer program product

By receiving backup tasks, processing them in blocks and determining the data type, generating a sending structure, and transmitting them to the backup client for data backup, the problem of low efficiency in traditional data backup methods is solved and efficient data backup is achieved.

CN119149304AInactive Publication Date: 2024-12-17GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411332024.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional data backup methods consume a lot of time and manpower, resulting in low backup efficiency.

Method used

By receiving the backup task sent by the backup client, the target virtual machine and the target disk are determined, and the current fingerprint information, historical fingerprint information and zero data block fingerprint information of each data block are obtained. Based on this information, the data type is determined. Generate a sending structure containing segment information and transmit it to the backup client for backup processing.

Benefits of technology

It improves the efficiency of data backup, avoids manual intervention, reduces time and labor costs, and achieves efficient data backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149304A_ABST
    Figure CN119149304A_ABST
Patent Text Reader

Abstract

The invention relates to a data backup method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: receiving a backup task sent by a backup client; determining a target virtual machine corresponding to the backup task, and generating a target disk corresponding to the target virtual machine; performing block processing on the target disk to obtain a plurality of data blocks corresponding to the target disk; determining current fingerprint information of each data block; acquiring historical fingerprint information and zero data block fingerprint information corresponding to each data block, and determining a data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information; generating a sending structural body according to the data type of each data block; and sending the sending structural body to a backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structural body. By adopting the method, the data backup efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data backup method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] At present, backing up data is crucial to ensure the integrity and security of data.

[0003] In traditional technology, manual backup is generally used in the process of backing up data; however, this method easily consumes a lot of time and manpower, resulting in low data backup efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide a data backup method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve data backup efficiency in response to the above technical problems.

[0005] In a first aspect, the present application provides a data backup method, comprising:

[0006] Receive backup tasks sent by the backup client;

[0007] Determine a target virtual machine corresponding to the backup task, and generate a target disk corresponding to the target virtual machine;

[0008] Performing block processing on the target disk to obtain multiple data blocks corresponding to the target disk;

[0009] Determine the current fingerprint information of each data block;

[0010] Obtaining historical fingerprint information and zero data block fingerprint information corresponding to each data block, and determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information;

[0011] Generate a sending structure according to the data type of each data block; the sending structure is used to represent a data carrier containing segment information corresponding to the data type of each data block;

[0012] The sending structure is sent to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0013] In one embodiment, determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information includes:

[0014] In a case where the current fingerprint information is the same as the historical fingerprint information, determining that the data type of each data block is static data;

[0015] or,

[0016] When the current fingerprint information is different from the historical fingerprint information, and the current fingerprint information is different from the zero data block fingerprint information, determining that the data type of each data block is incremental data;

[0017] or,

[0018] When the current fingerprint information is different from the historical fingerprint information and the current fingerprint information is the same as the zero data block fingerprint information, it is determined that the data type of each data block is redundant data.

[0019] In one embodiment, generating a sending structure according to the data type of each data block includes:

[0020] According to the data type of each data block, query the corresponding relationship between the data type and the segment information to obtain the segment information corresponding to the data type of each data block;

[0021] The sending structure is generated according to the segment information corresponding to the data type of each data block.

[0022] In one embodiment, the obtaining of the historical fingerprint information and the zero data block fingerprint information corresponding to each data block includes:

[0023] Obtaining a data block identifier of each data block and a data amount of each data block;

[0024] Determine the historical fingerprint information corresponding to the data block identifier of each data block as the historical fingerprint information corresponding to each data block, and determine the zero data block fingerprint information corresponding to the data amount of each data block as the zero data block fingerprint information corresponding to each data block.

[0025] In one embodiment, the block processing of the target disk to obtain a plurality of data blocks corresponding to the target disk includes:

[0026] Acquire the historical block partitioning mode of the target disk as the current block partitioning mode of the target disk;

[0027] The target disk is divided into blocks according to the current block division method to obtain a plurality of data blocks corresponding to the target disk.

[0028] In one embodiment, after sending the sending structure to the backup client so that the backup client performs backup processing on the target virtual machine according to the received sending structure, the method further includes:

[0029] Receiving backup information associated with the target virtual machine sent by the backup client;

[0030] Extracting key backup information from the backup information;

[0031] When the key backup information meets a preset condition, the target disk is deleted.

[0032] In a second aspect, the present application also provides a data backup device, including:

[0033] The task receiving module is used to receive the backup tasks sent by the backup client;

[0034] A target determination module, used to determine a target virtual machine corresponding to the backup task, and to generate a target disk corresponding to the target virtual machine;

[0035] A disk block module, used for performing block processing on the target disk to obtain a plurality of data blocks corresponding to the target disk;

[0036] A fingerprint determination module, used to determine the current fingerprint information of each data block;

[0037] A type determination module, used to obtain the historical fingerprint information and the zero data block fingerprint information corresponding to each data block, and determine the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information;

[0038] A structure generation module, used for generating a sending structure according to the data type of each data block; the sending structure is used for representing a data carrier containing segment information corresponding to the data type of each data block;

[0039] The target backup module is used to send the sending structure to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0041] Receive backup tasks sent by the backup client;

[0042] Determine a target virtual machine corresponding to the backup task, and generate a target disk corresponding to the target virtual machine;

[0043] Performing block processing on the target disk to obtain multiple data blocks corresponding to the target disk;

[0044] Determine the current fingerprint information of each data block;

[0045] Obtaining historical fingerprint information and zero data block fingerprint information corresponding to each data block, and determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information;

[0046] Generate a sending structure according to the data type of each data block; the sending structure is used to represent a data carrier containing segment information corresponding to the data type of each data block;

[0047] The sending structure is sent to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0048] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0049] Receive backup tasks sent by the backup client;

[0050] Determine a target virtual machine corresponding to the backup task, and generate a target disk corresponding to the target virtual machine;

[0051] Performing block processing on the target disk to obtain multiple data blocks corresponding to the target disk;

[0052] Determine the current fingerprint information of each data block;

[0053] Obtaining historical fingerprint information and zero data block fingerprint information corresponding to each data block, and determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information;

[0054] Generate a sending structure according to the data type of each data block; the sending structure is used to represent a data carrier containing segment information corresponding to the data type of each data block;

[0055] The sending structure is sent to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0056] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0057] Receive backup tasks sent by the backup client;

[0058] Determine a target virtual machine corresponding to the backup task, and generate a target disk corresponding to the target virtual machine;

[0059] Performing block processing on the target disk to obtain multiple data blocks corresponding to the target disk;

[0060] Determine the current fingerprint information of each data block;

[0061] Obtaining historical fingerprint information and zero data block fingerprint information corresponding to each data block, and determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information;

[0062] Generate a sending structure according to the data type of each data block; the sending structure is used to represent a data carrier containing segment information corresponding to the data type of each data block;

[0063] The sending structure is sent to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0064] The above-mentioned data backup method, apparatus, computer equipment, storage medium and computer program product first receive the backup task sent by the backup client, and determine the target virtual machine corresponding to the backup task, and generate the target disk corresponding to the target virtual machine, then perform block processing on the target disk to obtain multiple data blocks corresponding to the target disk, and determine the current fingerprint information of each data block, then obtain the historical fingerprint information and zero data block fingerprint information corresponding to each data block, and determine the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information, then, according to the data type of each data block, generate a data carrier containing the segment information corresponding to the data type of each data block as a sending structure; finally, send the sending structure to the backup client, so that the backup client backs up the target virtual machine according to the received sending structure. In this way, in the process of backing up data, the current fingerprint information of each data block is determined, and the data type is determined by combining the historical fingerprint information and the zero data block fingerprint information, and a sending structure containing segment information is generated according to the data type, so that the backup client can determine the data type of each data block according to the segment information in the sending structure, and then the data blocks can be efficiently backed up according to different data types, which is conducive to improving the data backup efficiency; moreover, the entire process does not require human intervention, avoiding the defect of manual backup that easily consumes a lot of time and manpower, resulting in low data backup efficiency, and further improving the data backup efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0066] Figure 1 An application environment diagram of a data backup method in an embodiment;

[0067] Figure 2 A schematic diagram of a data backup method in one embodiment;

[0068] Figure 3 is a flow chart of a data backup method in another embodiment;

[0069] Figure 4 A schematic diagram of a process of a file transmission and backup method based on bitmap increments in one embodiment;

[0070] Figure 5It is a flowchart of a file transmission and backup method based on bitmap increment in another embodiment;

[0071] Figure 6 is a structural block diagram of a data backup device in one embodiment;

[0072] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0074] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0075] The system recovery method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown in FIG. 1 , the backup host 104 communicates with the backup client 102 and the storage server 106 through the network. Figure 1The backup host 104 receives the backup task sent by the backup client 102, determines the target virtual machine corresponding to the backup task, generates the target disk corresponding to the target virtual machine, performs block processing on the target disk, obtains multiple data blocks corresponding to the target disk, determines the current fingerprint information of each data block, obtains the historical fingerprint information and the zero data block fingerprint information corresponding to each data block, and determines the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information, generates a sending structure according to the data type of each data block, and sends the sending structure to the backup client 102, so that the backup client 102 performs backup processing on the target virtual machine according to the received sending structure; the backup client 102 sends the backup data obtained after the backup processing on the target virtual machine to the storage server 106, so that the storage server 106 stores the backup data. Among them, the backup client 102 refers to a client that can perform backup processing on the virtual machine in the backup host 104, which can be a terminal or a server; the backup host 104 can be a terminal or a server; the storage server 106 refers to a server that stores backup data. The terminal may be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

[0076] In an exemplary embodiment, Figure 2 As shown, a data backup method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the backup host in the example.

[0077] Step S201: receiving a backup task sent by a backup client.

[0078] The backup client refers to a client that can perform backup processing on the virtual machine in the backup host.

[0079] The backup task refers to the task information corresponding to the backup process of the virtual machine in the backup host.

[0080] Exemplarily, the backup host receives a connection request sent by the backup client, and performs a preliminary check on the connection request according to a preset security policy (for example, checking whether the request source is in the allowed client list, or whether it satisfies specific network access rules), and obtains an inspection result corresponding to the connection request; when the inspection result corresponding to the connection request satisfies the preset inspection result (for example, checking whether the request source is in the allowed client list and satisfies specific network access rules), a network path is established with the backup client; then, the backup host receives the backup task sent by the backup client through the network path.

[0081] Step S202: determining a target virtual machine corresponding to the backup task, and generating a target disk corresponding to the target virtual machine.

[0082] The target virtual machine refers to the virtual machine corresponding to the backup task.

[0083] The target disk is the same temporary disk as the target virtual machine. In actual scenarios, the target disk is mounted on the backup host.

[0084] Exemplarily, the backup host parses the backup task to obtain parsed information; then, the backup host extracts virtual machine identification information from the parsed information; then, the backup host screens out candidate virtual machines corresponding to the virtual machine identification information from multiple candidate virtual machines as target virtual machines corresponding to the backup task; then, the backup host uses snapshot technology to generate a temporary disk identical to the target virtual machine as a target disk corresponding to the target virtual machine.

[0085] Step S203, dividing the target disk into blocks to obtain a plurality of data blocks corresponding to the target disk.

[0086] The block processing refers to the process of obtaining multiple data blocks corresponding to the target disk according to the target disk.

[0087] Among them, data blocks are also called disk blocks.

[0088] Exemplarily, the backup host performs block processing on the target disk according to the current block mode of the target disk to obtain multiple data blocks corresponding to the target disk. For example, for a target disk of 16MB in size, the corresponding current block mode is (4MB, 4MB, 4MB, 4MB), and after the target disk is block processed, four data blocks of 4MB in size are obtained.

[0089] Step S204: determine the current fingerprint information of each data block.

[0090] The current fingerprint information refers to the fingerprint information of each data block at the current time. In actual scenarios, the fingerprint information is a hash value.

[0091] Exemplarily, the backup host uses a hash calculation tool to determine the hash value of each data block at the current moment as the current fingerprint information of each data block.

[0092] Step S205, obtaining the historical fingerprint information and the zero data block fingerprint information corresponding to each data block, and determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information.

[0093] The historical fingerprint information refers to the fingerprint information of each data block at a historical time (such as yesterday).

[0094] Wherein, the zero data block fingerprint information is used to represent the fingerprint information of the zero data block corresponding to the data amount of each data block. Wherein, the zero data block refers to a formatted data block, that is, a storage block without valid data. It should be noted that the zero data block corresponds to each data block one by one, and the data amount is equal. For example, each data block includes a data block a of 4MB, a data block b of 1MB, and a data block c of 2MB, then the data amount of the corresponding zero data block is 4MB, 1MB and 2MB respectively.

[0095] The data type of each data block is used to represent the category information of each data block, including static data, incremental data and redundant data.

[0096] Exemplarily, the backup host obtains fingerprint information of each data block at a historical time from the storage server as historical fingerprint information corresponding to each data block; then, the backup host obtains the data amount of each data block, and determines the fingerprint information of the zero data block corresponding to the data amount of each data block based on the data amount of each data block, as the zero data block fingerprint information corresponding to each data block; then, the backup host determines the data type of each data block based on the current fingerprint information, historical fingerprint information and zero data block fingerprint information of each data block.

[0097] Step S206: Generate a sending structure according to the data type of each data block; the sending structure is used to represent the data carrier containing the segment information corresponding to the data type of each data block.

[0098] The sending structure is used to represent the data carrier containing the segment information corresponding to the data type of each data block. In actual scenarios, the sending structure includes segment information such as meta (metadata) segment, data (data) segment, and identification segment. The data type of each data block corresponds to the segment information in the sending structure one by one.

[0099] Exemplarily, the backup host determines the segment information corresponding to the data type of each data block according to the data type of each data block; then, the backup host generates a sending structure according to the segment information corresponding to the data type of each data block.

[0100] Step S207: sending the sending structure to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0101] Exemplarily, the backup host writes the send structure into the send queue; then, the backup host obtains the current network information (such as the current network usage rate), and when the current network information meets the preset conditions (such as the current network usage rate is less than the network usage rate threshold), the send structure in the send queue is sent to the backup client; the backup client sends the received send structure to the storage server, so that the storage server writes the send structure into the corresponding storage pool for data backup.

[0102] In the above data backup method, the backup task sent by the backup client is first received, and the target virtual machine corresponding to the backup task is determined, and the target disk corresponding to the target virtual machine is generated, and then the target disk is divided into blocks to obtain multiple data blocks corresponding to the target disk, and the current fingerprint information of each data block is determined, and then the historical fingerprint information and zero data block fingerprint information corresponding to each data block are obtained, and the data type of each data block is determined according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information, and then, according to the data type of each data block, a data carrier containing segment information corresponding to the data type of each data block is generated as a sending structure; finally, the sending structure is sent to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure. In this way, in the process of backing up data, the current fingerprint information of each data block is determined, and the data type is determined by combining the historical fingerprint information and the zero data block fingerprint information, and a sending structure containing segment information is generated according to the data type, so that the backup client can determine the data type of each data block according to the segment information in the sending structure, and then the data blocks can be efficiently backed up according to different data types, which is conducive to improving the data backup efficiency; moreover, the entire process does not require human intervention, avoiding the defect of manual backup that easily consumes a lot of time and manpower, resulting in low data backup efficiency, and further improving the data backup efficiency.

[0103] In an exemplary embodiment, the above step S205 determines the data type of each data block based on the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information, and specifically includes the following contents: when the current fingerprint information is the same as the historical fingerprint information, the data type of each data block is determined to be static data; or, when the current fingerprint information is different from the historical fingerprint information, and the current fingerprint information is different from the zero data block fingerprint information, the data type of each data block is determined to be incremental data; or, when the current fingerprint information is different from the historical fingerprint information, and the current fingerprint information is the same as the zero data block fingerprint information, the data type of each data block is determined to be redundant data.

[0104] Among them, static data is used to represent data blocks that have not changed.

[0105] The incremental data is used to represent data blocks that have changed and have not been formatted.

[0106] The redundant data is used to represent the formatted data block.

[0107] Exemplarily, the backup host determines the data type of each data block based on the current fingerprint information, historical fingerprint information and zero data block fingerprint information of each data block: when the current fingerprint information is the same as the historical fingerprint information, the backup host determines that the data type of each data block is static data; or, when the current fingerprint information is different from the historical fingerprint information, and the current fingerprint information is different from the zero data block fingerprint information, the backup host determines that the data type of each data block is incremental data; or, when the current fingerprint information is different from the historical fingerprint information, and the current fingerprint information is the same as the zero data block fingerprint information, the backup host determines that the data type of each data block is redundant data.

[0108] In this embodiment, the data type of each data block can be accurately determined based on the current fingerprint information, historical fingerprint information and zero data block fingerprint information of each data block, and different backup strategies and management methods can be adopted for each type of data, which is conducive to improving the efficiency of data backup.

[0109] In an exemplary embodiment, the above step S206 generates a sending structure according to the data type of each data block, and specifically includes the following contents: according to the data type of each data block, query the correspondence between the data type and the segment information to obtain the segment information corresponding to the data type of each data block; generate a sending structure according to the segment information corresponding to the data type of each data block.

[0110] The correspondence between the data type and the segment information is used to characterize the association information between the data type and the segment information. For example, the segment information corresponding to static data is the meta segment, the segment information corresponding to incremental data is the meta segment and the data segment, and the segment information corresponding to redundant data is the meta segment and the identification segment.

[0111] Exemplarily, the backup host queries the correspondence between the data type and the segment information according to the data type of each data block, and obtains the segment information corresponding to the data type of each data block; then, the backup host determines the metadata corresponding to each data block (such as block length, offset, timestamp) according to the data type of each data block; for example, the metadata of static data is the historical metadata of the corresponding data block, the metadata of incremental data is the current metadata of the corresponding data block, and the metadata of redundant data is the current metadata of the corresponding data block; then, the backup host generates a sending structure according to the segment information corresponding to the data type of each data block and the metadata corresponding to each data block.

[0112] In this embodiment, by querying the correspondence between the data type and the segment information, it is possible to ensure that the segment information of each data block accurately matches its data type; a sending structure is generated according to the segment information corresponding to the data type of each data block, so that the sending structure can be highly customized to include the key information required for each data block, which is convenient for the subsequent backup process.

[0113] In an exemplary embodiment, the above step S205, obtaining historical fingerprint information and zero data block fingerprint information corresponding to each data block, specifically includes the following contents: obtaining the data block identifier of each data block, and the data amount of each data block; determining the historical fingerprint information corresponding to the data block identifier of each data block as the historical fingerprint information corresponding to each data block, and determining the zero data block fingerprint information corresponding to the data amount of each data block as the zero data block fingerprint information corresponding to each data block.

[0114] The data block identifier refers to information that uniquely distinguishes a data block, such as the block order.

[0115] The data volume is used to indicate the size of the data block.

[0116] Exemplarily, the backup host obtains the data block identifier of each data block and the data amount of each data block; then, the backup host obtains the fingerprint bitmap information of the last backup of the target disk, and determines the historical fingerprint information corresponding to the data block identifier of each data block in the fingerprint bitmap information according to the data block identifier of each data block, as the historical fingerprint information corresponding to each data block; then, the backup host generates a zero data block corresponding to the data amount of each data block according to the data amount of each data block, and performs hash calculation on these zero data blocks through the MurmurHash3 (a non-encrypted hash function) algorithm to obtain the fingerprint information corresponding to these zero data blocks, as the zero data block fingerprint information corresponding to each data block.

[0117] In this embodiment, by using the data block identifier and data volume of each data block, the historical fingerprint information and zero data block fingerprint information corresponding to each data block can be accurately determined, which is beneficial to improving the accuracy of determining the historical fingerprint information and zero data block fingerprint information, and further providing an accurate data basis for subsequent processing processes.

[0118] In an exemplary embodiment, the above step S203, performs block processing on the target disk to obtain multiple data blocks corresponding to the target disk, specifically includes the following contents: obtaining the historical block method of the target disk as the current block method of the target disk; according to the current block method, performing block processing on the target disk to obtain multiple data blocks corresponding to the target disk.

[0119] The historical block partitioning method refers to the block partitioning method of the target disk at a historical time (such as yesterday).

[0120] The current block partitioning mode refers to the block partitioning mode of the target disk at the current time.

[0121] Exemplarily, the backup host obtains a configuration file of the target disk, and extracts the block partitioning method of the target disk at a historical time from the configuration file as the historical block partitioning method of the target disk; then, the backup host uses the historical block partitioning method as the current block partitioning method of the target disk; then, the backup host obtains the current status information of the target disk, and, under the condition that the current status information satisfies preset status information (such as a readable and writable status), the target disk is partitioned according to the current block partitioning method to obtain multiple data blocks corresponding to the target disk.

[0122] In this embodiment, the historical blocking mode of the target disk is obtained and directly used as the current blocking mode, avoiding the complex calculation and decision-making process required to redetermine the blocking mode, so that multiple data blocks corresponding to the target disk can be obtained more quickly, which is beneficial to improving the blocking efficiency of the target disk.

[0123] In an exemplary embodiment, the above step S207, after sending the sending structure to the backup client so that the backup client performs backup processing on the target virtual machine according to the received sending structure, specifically includes the following contents: receiving backup information associated with the target virtual machine sent by the backup client; extracting key backup information from the backup information; and deleting the target disk when the key backup information meets preset conditions.

[0124] The backup information refers to the information related to the backup process of the target virtual machine, including the backup file size, the backup file hash value, the backup time, the virtual machine identifier, etc.

[0125] Among them, key backup information refers to backup information whose importance is greater than a preset importance, such as backup file size and backup file hash value.

[0126] The preset condition refers to a pre-set judgment condition used to judge key backup information, such as the backup file size and hash value being the same as before the backup. It should be noted that the preset condition depends on the situation.

[0127] Exemplarily, the backup host receives backup information associated with the target virtual machine sent by the backup client; then, the backup host determines the importance corresponding to the backup information, and filters out the backup information whose corresponding importance is greater than a preset importance from the backup information as key backup information; then, when the key backup information meets the preset conditions, the backup host deletes the target disk.

[0128] In this embodiment, by deleting the target disk when the key backup information meets the preset conditions, the storage space occupied by the disk associated with the target virtual machine can be directly released, which is beneficial to improving the resource utilization of the storage space of the backup host and further improving the overall management efficiency of the backup host.

[0129] In an exemplary embodiment, Figure 3 As shown, another data backup method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the backup host in the example:

[0130] Step S301: receiving a backup task sent by a backup client.

[0131] Step S302: determining a target virtual machine corresponding to the backup task, and generating a target disk corresponding to the target virtual machine.

[0132] Step S303, obtaining the historical block division mode of the target disk as the current block division mode of the target disk; performing block division processing on the target disk according to the current block division mode to obtain multiple data blocks corresponding to the target disk.

[0133] Step S304: determine the current fingerprint information of each data block.

[0134] Step S305: obtaining the data block identifier of each data block and the data volume of each data block.

[0135] Step S306, determine the historical fingerprint information corresponding to the data block identifier of each data block as the historical fingerprint information corresponding to each data block, and determine the zero data block fingerprint information corresponding to the data amount of each data block as the zero data block fingerprint information corresponding to each data block.

[0136] Step S307: when the current fingerprint information is the same as the historical fingerprint information, it is determined that the data type of each data block is static data.

[0137] Step S308: When the current fingerprint information is different from the historical fingerprint information and the current fingerprint information is different from the zero data block fingerprint information, it is determined that the data type of each data block is incremental data.

[0138] Step S309: when the current fingerprint information is different from the historical fingerprint information and the current fingerprint information is the same as the zero data block fingerprint information, it is determined that the data type of each data block is redundant data.

[0139] Step S310: According to the data type of each data block, the corresponding relationship between the data type and the segment information is queried to obtain the segment information corresponding to the data type of each data block.

[0140] Step S311, generating a sending structure according to the segment information corresponding to the data type of each data block; the sending structure is used to represent the data carrier containing the segment information corresponding to the data type of each data block.

[0141] Step S312: sending the sending structure to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0142] In the above data backup method, during the process of backing up data, the current fingerprint information of each data block is determined, and the data type is determined by combining the historical fingerprint information and the zero data block fingerprint information, and a sending structure containing segment information is generated according to the data type, so that the backup client can determine the data type of each data block according to the segment information in the sending structure, and then the data blocks can be efficiently backed up according to different data types, which is conducive to improving the data backup efficiency; moreover, the whole process does not require human intervention, avoiding the defect of manual backup that easily consumes a lot of time and manpower, resulting in low data backup efficiency, and further improving the data backup efficiency.

[0143] In an exemplary embodiment, in order to more clearly illustrate the data backup method provided by the embodiment of the present application, the data backup method is specifically described below with a specific embodiment. Figure 4 and Figure 5As shown, the present application also provides a file transfer and backup method based on bitmap increments. In the process of backing up data, the backup task sent by the backup client is first received, and the target virtual machine corresponding to the backup task is determined, and the target disk corresponding to the target virtual machine is generated. The target disk is then divided into blocks to obtain multiple data blocks corresponding to the target disk, and the current fingerprint information of each data block is determined. Then, the historical fingerprint information and zero data block fingerprint information corresponding to each data block are obtained, and the data type of each data block is determined based on the current fingerprint information, historical fingerprint information and zero data block fingerprint information. Then, based on the data type of each data block, a data carrier containing segment information corresponding to the data type of each data block is generated as a sending structure; finally, the sending structure is sent to the backup client, so that the backup client backs up the target virtual machine according to the received sending structure. Specifically including the following contents:

[0144] 1. When the backup task starts, a temporary disk identical to the original virtual machine is quickly generated from the virtual machine snapshot and mounted to the backup host.

[0145] 2. The backup host divides the currently mounted disk into blocks according to the size of the disk blocks in the last backup, and synchronously calculates the fingerprint (hash value) of each disk to generate the fingerprint bitmap for this time.

[0146] 3. The backup host requests the fingerprint bitmap of the last backup from the storage server, calculates the fingerprint of the zero data block (the entire block has no valid data) and records it as zero fingerprint. The two fingerprint bitmaps are compared. Blocks with the same fingerprint are hits, otherwise they are misses.

[0147] 4. If the fingerprint hits, use the metadata (block length, offset, timestamp) of the last backup. If it doesn’t hit, update to the new metadata.

[0148] 5. Set the metadata to the meta segment of the sending structure. When the fingerprint does not hit and is not equal to zero fingerprint, it is incremental data, and the incremental data is written to the data segment of the sending structure. When the fingerprint does not hit and is equal to zero fingerprint, the new data is invalid redundant data, and the zero data identification segment of the sending structure is set, and only metadata is transmitted. No processing is performed when the fingerprint hits, and only metadata is transmitted. Write the sending structure to the sending queue, and the sending queue sends the data to the storage server at the appropriate time to complete the incremental data backup.

[0149] 6. The storage server receives the data, updates the bitmap information based on the metadata for the next incremental backup, and writes the incremental data to the corresponding storage pool.

[0150] 7. The backup host releases and deletes the temporary disk.

[0151] For example, assume that the storage server has saved chunks (data blocks), namely chunk1 (fingerprint: fp1, data: data1), chunk3 (fingerprint: fp3_, data: data3_); the backup host backs up three data blocks on the temporary disk, namely chunk1 (fingerprint: fp1, data: data1), chunk2 (fingerprint: fp2, data: data2), chunk3 (fingerprint: fp3, data: data3). It should be noted that the fp3 fingerprint is equal to the zero fingerprint.

[0152] When processing chunk1, the backup host finds that the chunk1 fingerprint fp1 is the same as the fingerprint fp1 sent by the storage server, and a hit occurs. The backup host does not send the actual data of chunk1, but only sends a message indicating that it has been hit, and writes the metadata of chunk1 into the sending queue.

[0153] When processing chunk2, the backup host finds that the chunk2 fingerprint is different from the fingerprint (zero fingerprint) sent by the storage server, and a miss occurs. The backup host prepares to send the actual data data2 of chunk2, sets a message indicating that it missed, and writes the metadata and actual data into the sending queue together.

[0154] When processing chunk3, the backup host finds that the chunk3 fingerprint fp3 is different from the fingerprint fp3_ sent by the storage server, and fp3 is equal to the zero fingerprint, that is, data3 is a new data block, but the actual zero data will not be sent. Instead, a message marked as zero data is sent and the message hit is set, and only the metadata is written to the send queue.

[0155] Through the above method, the use of bitmaps to compare only fingerprints each time to decide whether to send actual data greatly reduces the resource consumption of the scanning technology comparison operation. The introduction of backup host and snapshot technology will generate a temporary disk to regenerate the bitmap only during backup. Although the fingerprint calculation is increased, the instability of the original monitoring program is greatly reduced and the compatibility problem is solved. The new zero data concept further compresses the transmission data and solves the data redundancy problem.

[0156] In the above embodiment, during the process of backing up data, the current fingerprint information of each data block is determined, and the data type is determined by combining the historical fingerprint information and the zero data block fingerprint information, and a sending structure containing segment information is generated according to the data type, so that the backup client can determine the data type of each data block according to the segment information in the sending structure, and then the data blocks can be efficiently backed up according to different data types, which is conducive to improving the efficiency of data backup; moreover, the whole process does not require manual intervention, avoiding the defect of manual backup that is easy to consume a lot of time and manpower, resulting in low data backup efficiency, and further improving the efficiency of data backup. At the same time, through the above technology, the stability and accuracy of incremental backup can be significantly improved, the amount of data and transmission time of incremental data transmission can be reduced, and the time and consumption of comparing data block differences can be reduced, so as to achieve the effect of accurately and quickly completing incremental data backup.

[0157] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0158] Based on the same inventive concept, the embodiment of the present application also provides a data backup device for implementing the data backup method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data backup device embodiments provided below can refer to the limitations on the data backup method above, and will not be repeated here.

[0159] In an exemplary embodiment, Figure 6 As shown, a data backup device is provided, including: a task receiving module 601, a target determining module 602, a disk block module 603, a fingerprint determining module 604, a type determining module 605, a structure generating module 606 and a target backup module 607, wherein:

[0160] The task receiving module 601 is used to receive the backup task sent by the backup client.

[0161] The target determination module 602 is used to determine the target virtual machine corresponding to the backup task and generate a target disk corresponding to the target virtual machine.

[0162] The disk block module 603 is used to perform block processing on the target disk to obtain multiple data blocks corresponding to the target disk.

[0163] The fingerprint determination module 604 is used to determine the current fingerprint information of each data block.

[0164] The type determination module 605 is used to obtain the historical fingerprint information and the zero data block fingerprint information corresponding to each data block, and determine the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information.

[0165] The structure generation module 606 is used to generate a sending structure according to the data type of each data block; the sending structure is used to represent the data carrier containing the segment information corresponding to the data type of each data block.

[0166] The target backup module 607 is used to send the sending structure to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

[0167] In an exemplary embodiment, the type determination module 605 is also used to determine that the data type of each data block is static data when the current fingerprint information is the same as the historical fingerprint information; or, when the current fingerprint information is different from the historical fingerprint information and the current fingerprint information is different from the zero data block fingerprint information, determine that the data type of each data block is incremental data; or, when the current fingerprint information is different from the historical fingerprint information and the current fingerprint information is the same as the zero data block fingerprint information, determine that the data type of each data block is redundant data.

[0168] In an exemplary embodiment, the structure generation module 606 is also used to query the correspondence between the data type and the segment information according to the data type of each data block, and obtain the segment information corresponding to the data type of each data block; and generate a sending structure according to the segment information corresponding to the data type of each data block.

[0169] In an exemplary embodiment, the type determination module 605 is also used to obtain the data block identifier of each data block and the data amount of each data block; determine the historical fingerprint information corresponding to the data block identifier of each data block as the historical fingerprint information corresponding to each data block, and determine the zero data block fingerprint information corresponding to the data amount of each data block as the zero data block fingerprint information corresponding to each data block.

[0170] In an exemplary embodiment, the disk partitioning module 603 is also used to obtain the historical partitioning mode of the target disk as the current partitioning mode of the target disk; according to the current partitioning mode, the target disk is partitioned to obtain multiple data blocks corresponding to the target disk.

[0171] In an exemplary embodiment, the data backup device also includes a disk deletion module for receiving backup information associated with a target virtual machine sent by a backup client; extracting key backup information from the backup information; and deleting the target disk when the key backup information meets preset conditions.

[0172] Each module in the above data backup device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0173] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as historical fingerprint information and zero data block fingerprint information. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data backup method is implemented.

[0174] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0175] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0176] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0177] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0178] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0179] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0180] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data backup method, characterized in that: Applied to a backup host, the method comprises: Receive backup tasks sent by the backup client; Determine a target virtual machine corresponding to the backup task, and generate a target disk corresponding to the target virtual machine; Performing block processing on the target disk to obtain multiple data blocks corresponding to the target disk; Determine the current fingerprint information of each data block; Obtaining historical fingerprint information and zero data block fingerprint information corresponding to each data block, and determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information; Generate a sending structure according to the data type of each data block; the sending structure is used to represent a data carrier containing segment information corresponding to the data type of each data block; The sending structure is sent to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

2. The method according to claim 1, characterized in that The determining the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information includes: In a case where the current fingerprint information is the same as the historical fingerprint information, determining that the data type of each data block is static data; or, When the current fingerprint information is different from the historical fingerprint information, and the current fingerprint information is different from the zero data block fingerprint information, determining that the data type of each data block is incremental data; or, When the current fingerprint information is different from the historical fingerprint information and the current fingerprint information is the same as the zero data block fingerprint information, it is determined that the data type of each data block is redundant data.

3. The method according to claim 1, characterized in that The generating a sending structure according to the data type of each data block includes: According to the data type of each data block, query the corresponding relationship between the data type and the segment information to obtain the segment information corresponding to the data type of each data block; The sending structure is generated according to the segment information corresponding to the data type of each data block.

4. The method according to claim 1, characterized in that: The obtaining of the historical fingerprint information and the zero data block fingerprint information corresponding to each data block includes: Obtaining a data block identifier of each data block and a data amount of each data block; Determine the historical fingerprint information corresponding to the data block identifier of each data block as the historical fingerprint information corresponding to each data block, and determine the zero data block fingerprint information corresponding to the data amount of each data block as the zero data block fingerprint information corresponding to each data block.

5. The method according to claim 1, characterized in that The block processing of the target disk to obtain a plurality of data blocks corresponding to the target disk includes: Obtaining a historical block partitioning mode of the target disk as a current block partitioning mode of the target disk; The target disk is divided into blocks according to the current block division method to obtain a plurality of data blocks corresponding to the target disk.

6. The method according to any one of claims 1 to 5, characterized in that After sending the sending structure to the backup client so that the backup client performs a backup process on the target virtual machine according to the received sending structure, the method further includes: Receiving backup information associated with the target virtual machine sent by the backup client; Extracting key backup information from the backup information; When the key backup information meets a preset condition, the target disk is deleted.

7. A data backup device, characterized in that: The device comprises: The task receiving module is used to receive the backup tasks sent by the backup client; A target determination module, used to determine a target virtual machine corresponding to the backup task, and to generate a target disk corresponding to the target virtual machine; A disk block module, used for performing block processing on the target disk to obtain a plurality of data blocks corresponding to the target disk; A fingerprint determination module, used to determine the current fingerprint information of each data block; A type determination module, used to obtain the historical fingerprint information and the zero data block fingerprint information corresponding to each data block, and determine the data type of each data block according to the current fingerprint information, the historical fingerprint information and the zero data block fingerprint information; A structure generation module, used for generating a sending structure according to the data type of each data block; the sending structure is used for representing a data carrier containing segment information corresponding to the data type of each data block; The target backup module is used to send the sending structure to the backup client, so that the backup client performs backup processing on the target virtual machine according to the received sending structure.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Virtual machine backup control device, system and method

    CN112181729A

  • Method and device for protecting virtual machine on Cloud OS platform and server

    CN117909139A