A method, device and medium for data backup of a virtual machine

By employing the CBT backup method in virtual machine data backup, incremental data is acquired and transmitted to the slave site for backup, thus solving the problem of low virtual machine data backup efficiency and achieving the effect of improving backup efficiency.

CN116048875BActive Publication Date: 2026-07-24JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2022-11-18
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In existing technologies, the amount of data transferred during virtual machine data backup is large, which leads to a decrease in backup efficiency.

Method used

The backup method based on Track Modified Blocks (CBT) is adopted to obtain the difference between the current bitmap file and the initial bitmap file of the virtual machine, so as to obtain incremental data, and transfer the incremental data to the slave site for backup.

Benefits of technology

By backing up only incremental data, the amount of data for each backup is reduced, thus improving the efficiency of virtual machine data backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116048875B_ABST
    Figure CN116048875B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and medium for data backup of a virtual machine, and relates to the technical field of virtualization. In the method, when data of a virtual machine is backed up, only incremental data is backed up, and the data quantity of the incremental data is less than or equal to the data quantity of a current bitmap file. Specifically, the data quantity of the incremental data is equal to the data quantity of the current bitmap file when the data is backed up for the first time, and the data quantity of the incremental data is less than the data quantity of the current bitmap file when the data is backed up subsequently. It can be seen that, compared with the previous method in which all data of a virtual machine is backed up each time, that is, the current bitmap file is backed up each time, in the method, the current bitmap file is only backed up when the data is backed up for the first time, and only incremental data with a data quantity less than that of the current bitmap file is backed up in the subsequent backup process, so that the data quantity of the backup can be greatly reduced, and the backup efficiency of the data of the virtual machine is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of virtualization technology, and in particular to a method, apparatus and medium for data backup of virtual machines. Background Technology

[0002] With the widespread application of virtualization technology in industries such as education, healthcare, finance, and transportation, the need to build local disaster recovery centers and off-site disaster recovery centers for local production centers is becoming increasingly urgent, based on various business continuity protection requirements. This is achieved by supporting local storage dual-active systems while meeting the requirements of Recovery Time Objective (RTO) and Recovery Point Objective (RPO) for business continuity indicators. Additionally, the need to establish off-site data protection centers to prevent major natural disasters at the city level is becoming increasingly urgent.

[0003] Currently, each virtual machine data backup typically involves backing up all the data of the virtual machine. Because all data is backed up, the amount of data transferred is relatively large, leading to a decrease in the efficiency of virtual machine data backup.

[0004] Therefore, improving the efficiency of virtual machine data backup is a technical problem that urgently needs to be solved by those in this field. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, and medium for backing up virtual machine data, so as to improve the efficiency of virtual machine data backup.

[0006] To address the aforementioned technical problems, this application provides a method for backing up virtual machine data, applied to a main site, the method comprising:

[0007] Obtain the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup process of the data of the virtual machine to be backed up;

[0008] The difference between the current bitmap file and the initial bitmap file is obtained in order to obtain incremental data of the virtual machine's bitmap file; wherein, the amount of incremental data is less than or equal to the amount of data in the current bitmap file;

[0009] The incremental data is transmitted to the slave site so that the slave site can back up and merge the incremental data.

[0010] Preferably, before obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data to be backed up, the method further includes:

[0011] Obtain the first parameters of the virtual machine to be backed up and the second parameters of the virtual machine to be backed up from the slave site that has established a mapping relationship with the master site;

[0012] If the first parameter and the second parameter are the same, proceed to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up.

[0013] Preferably, before obtaining the current bitmap file of the virtual machine, the method further includes:

[0014] Control the virtual machine to be backed up in pause mode;

[0015] Correspondingly, after obtaining the current bitmap file of the virtual machine, the method further includes:

[0016] Control the operation of the virtual machine to be backed up.

[0017] Preferably, before obtaining the difference between the current bitmap file and the initial bitmap file to obtain incremental data of the virtual machine's bitmap file, the method further includes:

[0018] Determine whether the virtual machine data to be backed up exists in the slave site;

[0019] If so, proceed to the step of obtaining the difference between the current bitmap file and the initial bitmap file in order to obtain the incremental data of the virtual machine's bitmap file;

[0020] If not, the current bitmap file is transferred to the slave site, and the steps of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up are returned.

[0021] Preferably, before transmitting the incremental data to the slave site so that the slave site can back up and merge the incremental data, the method further includes:

[0022] Determine whether the incremental data is less than or equal to a preset value;

[0023] If so, return to the steps of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up;

[0024] If not, proceed to the step of transmitting the incremental data to the slave site so that the slave site can back up and merge the incremental data.

[0025] Preferably, transmitting the incremental data to the slave station includes:

[0026] The incremental data is transmitted to the slave site via the TCP protocol.

[0027] Preferably, after transmitting the incremental data to the slave station, the method further includes:

[0028] From the start of transmitting the incremental data to the slave station, determine whether a prompt message indicating that the incremental data has been received from the slave station is received within a first preset time period;

[0029] If not, return to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up.

[0030] To address the aforementioned technical problems, this application also provides a method for backing up virtual machine data, applied to a slave site, the method comprising:

[0031] Acquire incremental data transmitted from the master site; wherein, the incremental data is obtained by the master site from the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; obtain the difference between the current bitmap file and the initial bitmap file;

[0032] The incremental data is backed up and merged.

[0033] Preferably, before acquiring the incremental data transmitted from the main site, the method further includes:

[0034] Determine if backup data for the virtual machine exists;

[0035] If so, proceed to the step of obtaining incremental data transmitted by the main site;

[0036] If not, back up the current bitmap file; and return to the step of obtaining incremental data transmitted from the main site.

[0037] Preferably, the step of backing up and merging the incremental data includes:

[0038] Starting from the moment the incremental data transmitted by the main site is acquired, it is determined whether the incremental data has been backed up within a second preset time period;

[0039] If not, return to the step of obtaining incremental data transmitted from the main site.

[0040] Preferably, the method further includes:

[0041] After the incremental data is backed up, a prompt message indicating that the backup of the incremental data is complete is output.

[0042] Preferably, the method further includes:

[0043] After the incremental data is backed up, the information of the virtual disk where the incremental data is located is sent to the main site.

[0044] To address the aforementioned technical problems, this application also provides a virtual machine data backup apparatus, applied to a main site, the method comprising:

[0045] The first acquisition module is used to acquire the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up;

[0046] The second acquisition module is used to acquire the difference between the current bitmap file and the initial bitmap file in order to acquire incremental data of the virtual machine's bitmap file; wherein, the amount of incremental data is less than or equal to the amount of data in the current bitmap file;

[0047] A transmission module is used to transmit the incremental data to a slave station so that the slave station can back up and merge the incremental data.

[0048] To address the aforementioned technical problems, this application also provides a virtual machine data backup apparatus, applied to a slave site, the method comprising:

[0049] An acquisition module is used to acquire incremental data transmitted by the master site; wherein, the incremental data is obtained by the master site acquiring the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; and the difference between the current bitmap file and the initial bitmap file is acquired.

[0050] The backup module is used to back up the incremental data.

[0051] To address the aforementioned technical problems, this application also provides a device for backing up virtual machine data, comprising:

[0052] Memory, used to store computer programs;

[0053] A processor, used to implement the above-described method for data backup of a virtual machine when executing the computer program.

[0054] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned method for data backup of a virtual machine.

[0055] The virtual machine data backup method provided in this application is applied to a master site. The method includes: obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process; obtaining the difference between the current bitmap file and the initial bitmap file to obtain incremental data of the virtual machine's bitmap file; and transferring the incremental data to a slave site to back up the virtual machine's data. In this method, only incremental data is backed up during virtual machine data backup, and the amount of incremental data is less than or equal to the amount of data in the current bitmap file. Specifically, during the first backup, the amount of incremental data is equal to the amount of data in the current bitmap file, and during subsequent backups, the amount of incremental data is less than the amount of data in the current bitmap file. Therefore, compared to previous methods that backed up all virtual machine data (i.e., backed up the current bitmap file each time), this method only backs up the current bitmap file during the first backup, and in subsequent backups, only backs up incremental data smaller than the amount of data in the current bitmap file. This significantly reduces the amount of data to be backed up and improves the efficiency of virtual machine data backup.

[0056] In addition, this application also provides a method for backing up virtual machine data at a slave site, an apparatus for backing up virtual machine data at a master site, an apparatus for backing up virtual machine data at a slave site, and a computer-readable storage medium, which have the same or corresponding technical features as the aforementioned method for backing up virtual machine data, and have the same effects. Attached Figure Description

[0057] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 A flowchart illustrating a method for data backup of a virtual machine applied to a main site, provided as an embodiment of this application;

[0059] Figure 2 A structural diagram of a data backup device for a virtual machine applied to a main site is provided as an embodiment of this application;

[0060] Figure 3A structural diagram of a data backup device for a virtual machine applied to a slave site, provided in one embodiment of this application;

[0061] Figure 4 A structural diagram of a virtual machine data backup device provided in another embodiment of this application;

[0062] Figure 5 A flowchart illustrating a disaster recovery method for a dual-virtualized site based on CBT backup, provided in an embodiment of this application. Detailed Implementation

[0063] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0064] The core of this application is to provide a method, apparatus, and medium for backing up virtual machine data, which can improve the efficiency of virtual machine data backup.

[0065] With the widespread application of virtualization technology in industries such as education, healthcare, finance, and transportation, the need to build local and remote disaster recovery centers for local production centers, based on various business continuity protection requirements, is becoming increasingly urgent. Local active-active storage, while meeting business continuity metrics RTO and RPO requirements, necessitates the establishment of remote data protection centers to mitigate the impact of major city-level natural disasters. Typically, virtual machine data is backed up using multiple virtualization platforms, including master and slave sites. Currently, during virtual machine data backup, each backup transfers all virtual machine data from the master site to the slave site, resulting in a large data volume transferred between the master and slave sites and reduced backup efficiency. Therefore, this application employs Change-Block-Tracking (CBT) backup to reduce the data volume per backup, thereby improving backup efficiency.

[0066] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Figure 1 A flowchart illustrating a method for data backup of a virtual machine applied to a main site, as provided in this application embodiment, is shown below. Figure 1 As shown, the method includes:

[0067] S10: Obtain the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup process of the data of the virtual machine to be backed up;

[0068] S11: Obtain the difference between the current bitmap file and the initial bitmap file in order to obtain the incremental data of the virtual machine's bitmap file; wherein, the amount of incremental data is less than or equal to the amount of data in the current bitmap file;

[0069] S12: Transfer incremental data to the slave site so that the slave site can back up and merge the incremental data.

[0070] During virtual machine operation, data changes. To ensure a more complete backup of the virtual machine data, multiple backups are performed. The frequency of virtual machine data backups is not limited and is determined based on actual conditions. In this embodiment, when backing up virtual machine data, the common open-source machine emulator monitoring protocol (QEMUMonitor Protocol, QMP) is primarily used to obtain differential data. Its functions include: bitmap operations, support for multiple backup types, support for transaction operations, support for remote backup, task control, and event listening.

[0071] To back up virtual machine data, a mapping relationship needs to be established between the master and slave sites. This mapping relationship must at least record the network interconnection protocol (Internet Protocol, IP) of the master site and the IP address of the slave site whose virtual machine data is to be backed up. Both the master and slave sites contain parameters of the virtual machine to be backed up, such as its IP address.

[0072] After establishing the mapping relationship, the virtual machine data backup begins. Steps S10 to S12 constitute a data backup process. First, the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine from the previous backup are obtained. It should be noted that the initial bitmap file is used here only to distinguish it from the current bitmap file in this backup process, and does not refer solely to the bitmap file from the first backup. After obtaining the current bitmap file and the initial bitmap file, the differences between the current bitmap file and the initial bitmap file are further obtained to acquire the incremental data of the bitmap file. This incremental data is then transferred to the slave site.

[0073] If the current backup is the first backup, then the initial bitmap file of the virtual machine from the previous backup does not exist. The incremental data determined by the difference between the current bitmap file and the initial bitmap file is the current bitmap file. Finally, the current bitmap file is transferred to the slave site. If the current backup is not the first backup, assuming it is the second backup, then the initial bitmap file of the virtual machine from the previous backup refers to the bitmap file of the virtual machine from the first backup. The difference between the bitmap file from the second backup and the bitmap file from the first backup is obtained to determine the incremental data, and the incremental data is transferred to the slave site.

[0074] In practice, the process of backing up virtual machine data is as follows:

[0075] 1. Establish a mapping relationship between the master and slave sites, and configure the virtual machines to be backed up and protected;

[0076] 2. Create bitmaps and perform full backups using transactional methods;

[0077]

[0078]

[0079] 3. Obtain incremental data;

[0080]

[0081] The above method can be used to obtain base.img, inc.0.bitmap / inc.0.qcow2, inc.1.bitmap / inc.1.qcow2, ..., where base.img is the bitmap file from the first backup, inc.0.bitmap / inc.0.qcow2 represents the incremental data from the second backup, and inc.1.bitmap / inc.1.qcow2 represents the incremental data from the third backup.

[0082] 4. Transfer the above files to the slave site respectively, and merge the backup data. Specifically, the slave site reads the contents of the base.img, inc.0.bitmap, and inc.0.qcow2 files and writes them to the corresponding bits of the virtual disk; the virtual disk with the merged data is specified in the virtual machine XML.

[0083] The virtual machine data backup method provided in this embodiment is applied to a master site. The method includes: obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process; obtaining the difference between the current bitmap file and the initial bitmap file to obtain incremental data of the virtual machine's bitmap file; and transferring the incremental data to a slave site so that the slave site can back up and merge the incremental data. In this method, when backing up virtual machine data, only incremental data is backed up, and the amount of incremental data is less than or equal to the amount of data in the current bitmap file. Specifically, during the first backup, the amount of incremental data is equal to the amount of data in the current bitmap file, and during subsequent backups, the amount of incremental data is less than the amount of data in the current bitmap file. Therefore, compared to previous methods that backed up all virtual machine data (i.e., backed up the current bitmap file each time), this embodiment only backs up the current bitmap file during the first backup, and in subsequent backups, only backs up incremental data smaller than the amount of data in the current bitmap file. This significantly reduces the amount of data to be backed up and improves the efficiency of virtual machine data backup.

[0084] In practice, there may be multiple virtual machines to be backed up. When backing up the data of virtual machines on the master site from the slave site, in order to ensure that the data of virtual machines on the master site can be backed up by the slave site as much as possible, the preferred implementation method is that, before obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine in the previous backup process of the data of the virtual machine to be backed up, the virtual machine data backup method further includes:

[0085] Obtain the first parameter of the virtual machine to be backed up and the second parameter of the virtual machine to be backed up from the slave site that has established a mapping relationship with the master site;

[0086] If the first and second parameters are the same, proceed to the steps of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup process of the data of the virtual machine to be backed up.

[0087] The master site acquires virtual machine data and records the parameters of the virtual machines whose data is to be backed up. To back up the data of the virtual machines on the master site, the slave site first needs to record the parameters of the virtual machines to be backed up, including at least the virtual machine's IP address. If the parameters of the virtual machine on the master site are the same as those on the slave site, it means that the data of the current virtual machine can be backed up using both the master and slave sites. If the parameters of the virtual machine on the master site are different from those on the slave site, it means that the virtual machine protected by the master site and the virtual machine that needs to be protected by the slave site are not the same virtual machine; therefore, data backup of the virtual machine that needs to be protected by the master site cannot be performed using the slave site.

[0088] The virtual machine data backup provided in this embodiment only begins when the parameters of the virtual machine at the master site are the same as those of the virtual machine at the slave site. This ensures that the master site and the slave site can protect the same virtual machine data as much as possible, thus achieving the backup of virtual machine data.

[0089] Since the data of a virtual machine is constantly changing during its operation, in order to obtain a specific bitmap file, a preferred implementation method includes, before obtaining the current bitmap file of the virtual machine, the method for backing up the virtual machine's data further comprising:

[0090] Control the virtual machine to be backed up in pause mode;

[0091] Correspondingly, after obtaining the current bitmap file of the virtual machine, the methods for backing up the virtual machine's data also include:

[0092] Control the operation of the virtual machine to be backed up.

[0093] In the method provided in this embodiment, the virtual machine is paused before the bitmap file is acquired, meaning that the data in the virtual machine will not change. Only after the bitmap file is acquired is the virtual machine resumed to work. This prevents the data in the bitmap file from constantly changing, ensuring that a definite bitmap file can be acquired. This allows for timely acquisition of incremental data and backup of the incremental data, improving the efficiency of virtual machine data backup.

[0094] In practice, there are cases where it's the first time backing up virtual machine data and cases where it's not the first time backing up virtual machine data. To back up virtual machine data, a preferred implementation method includes, before obtaining the difference between the current bitmap file and the initial bitmap file to obtain the incremental data of the virtual machine's bitmap file, the virtual machine data backup method further includes:

[0095] Determine if the virtual machine data to be backed up exists at the site;

[0096] If so, proceed to the step of obtaining the difference between the current bitmap file and the initial bitmap file in order to obtain the incremental data of the virtual machine's bitmap file;

[0097] If not, the current bitmap file is transferred to the slave site, and the steps for obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup of the data of the virtual machine to be backed up are returned.

[0098] Whether the virtual machine data to be backed up exists in the slave site can be determined based on the slave site's log information. If the virtual machine data to be backed up does not exist in the slave site, it means this is the first time the virtual machine data is being backed up, and there is no previous backup, i.e., no initial bitmap file. Therefore, the difference between the current bitmap file and the initial bitmap file is the current bitmap file, and the current bitmap file is directly transferred to the slave site. If the virtual machine data to be backed up exists in the slave site, it means there is a previous backup, and the process begins to obtain the difference between the current bitmap file and the initial bitmap file to obtain the incremental data of the virtual machine's bitmap file.

[0099] This embodiment provides a method to determine whether there is virtual machine data to be backed up in the site before obtaining the difference between the current bitmap file and the initial bitmap file. This allows it to determine whether it is the first time to back up the virtual machine data, and thus different methods can be used to back up the virtual machine data.

[0100] To back up virtual machine data, incremental data is backed up. In practice, when the incremental data is small, to reduce the number of backups, a preferred implementation method includes the following steps before transferring the incremental data to the slave site for backup and merging:

[0101] Determine whether the incremental data is less than or equal to a preset value;

[0102] If so, return to the steps of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup of the data of the virtual machine to be backed up;

[0103] If not, proceed to the step of transferring incremental data to the slave site so that the slave site can back up and merge the incremental data.

[0104] There is no limit to the preset value; it is determined based on the preset conditions. For example, if the preset value is set to 10M, then if the incremental data is less than 10M, this backup will not be performed. Instead, the current bitmap file and the initial bitmap file will continue to be acquired until the incremental data is greater than 10M, at which point the incremental data will be transferred to the slave site.

[0105] In the method provided in this embodiment, incremental data is not transmitted to the slave site when the incremental data is less than or equal to a preset value; incremental data is transmitted to the slave site only when the incremental data is greater than the preset value, which can reduce the frequency of data backup.

[0106] When the master site transmits data to the slave site, a preferred implementation is that transmitting incremental data to the slave site includes:

[0107] Incremental data is transmitted to the slave site via Transmission Control Protocol (TCP).

[0108] TCP is a connection-oriented transmission control protocol with high reliability, ensuring the correctness of transmitted data and preventing loss or out-of-order delivery. TCP can guarantee that the receiving station receives the byte stream sent by the receiving station without errors, providing reliable communication services for applications.

[0109] In implementation, there may be situations where the master site fails to transfer data to the slave site for an extended period, or is unable to transfer data to the slave site at all. To facilitate a clear and intuitive understanding of the data transfer status, a preferred implementation method includes, after transferring incremental data to the slave site, the virtual machine data backup method further includes:

[0110] From the start of transmitting incremental data from the site, determine whether a prompt message indicating that incremental data has been received from the site has been received within a first preset time period;

[0111] If not, return to the steps of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup of the data of the virtual machine to be backed up.

[0112] There are no restrictions on the first preset duration, the method and content of the prompt message, etc., which shall be determined according to the actual situation.

[0113] In the method provided in this embodiment, receiving a prompt message within a first preset time period allows the user to directly understand the data transmission status to the slave site; if no prompt message is received, the data is backed up again. By setting the preset time period and the prompt message, the user can avoid waiting for a long time for data to be transmitted from the master site to the slave site, thereby improving the data backup efficiency.

[0114] The above describes a method for backing up data on a virtual machine at a master site. This embodiment also provides a method for backing up data on a virtual machine at a slave site, the method comprising:

[0115] Acquire incremental data transmitted from the master site; wherein, the incremental data is obtained by the master site from the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup of the data of the virtual machine to be backed up; obtain the difference between the current bitmap file and the initial bitmap file;

[0116] Backup and merge incremental data.

[0117] Before acquiring incremental data transferred from the master site, the methods for backing up data for virtual machines at the slave site also include:

[0118] Determine if backup data for the virtual machine exists;

[0119] If so, proceed to the step of obtaining incremental data transmitted from the main site;

[0120] If not, back up the current bitmap file; and return to the step of obtaining incremental data transmitted from the main site.

[0121] Backing up and merging incremental data includes:

[0122] Starting from the moment incremental data transmitted from the main site is acquired, determine whether the incremental data has been backed up within the second preset time period;

[0123] If not, return to the step of retrieving incremental data transmitted from the main site.

[0124] Methods for backing up data from virtual machines at a site also include:

[0125] After the incremental data backup is complete, a message indicating that the backup of the incremental data is complete is output.

[0126] Methods for backing up data from virtual machines at a site also include:

[0127] After the incremental data is backed up, the information of the virtual disk where the incremental data is located is sent to the main site.

[0128] The data backup method for virtual machines applied to slave sites provided in this embodiment has corresponding technical features to the data backup method for virtual machines applied to master sites mentioned above. The embodiments of the data backup method for virtual machines applied to master sites have been described in detail above, and the embodiments of the data backup method for virtual machines applied to slave sites will not be repeated here. In fact, the beneficial effects are the same as those of the data backup method for virtual machines applied to master sites mentioned above.

[0129] In the above embodiments, the data backup method for virtual machines has been described in detail. This application also provides embodiments corresponding to a data backup device for virtual machines. It should be noted that this application describes the embodiments of the device part from two perspectives: one is based on functional modules, and the other is based on hardware.

[0130] Figure 2 This application provides a structural diagram of a data backup device for a virtual machine applied to a main site, according to one embodiment of the present application. This embodiment, based on functional modules, includes:

[0131] The first acquisition module 10 is used to acquire the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup process of the data of the virtual machine to be backed up;

[0132] The second acquisition module 11 is used to acquire the difference between the current bitmap file and the initial bitmap file in order to acquire the incremental data of the virtual machine's bitmap file; wherein, the amount of incremental data is less than or equal to the amount of data in the current bitmap file;

[0133] The transmission module 12 is used to transmit incremental data to the slave station so that the slave station can back up and merge the incremental data.

[0134] also, Figure 3 A structural diagram of a data backup device for a virtual machine at a slave site, provided in one embodiment of this application, is shown. The device includes:

[0135] The acquisition module 13 is used to acquire incremental data transmitted by the master site; wherein, the incremental data is obtained by the master site acquiring the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup process of the data of the virtual machine to be backed up; the difference between the current bitmap file and the initial bitmap file is obtained.

[0136] Backup module 14 is used to back up incremental data.

[0137] Since the embodiments of the device part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the device part, which will not be repeated here, and it has the same beneficial effects as the virtual machine data backup method mentioned above.

[0138] Figure 4 This is a structural diagram of a virtual machine data backup device provided in another embodiment of this application. This embodiment is based on a hardware perspective, such as... Figure 4 As shown, the virtual machine data backup device includes:

[0139] Memory 20 is used to store computer programs;

[0140] Processor 21 is configured to implement the steps of the method for data backup of a virtual machine as described in the above embodiments when executing a computer program.

[0141] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0142] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the virtual machine data backup method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary storage or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the aforementioned virtual machine data backup method.

[0143] In some embodiments, the virtual machine data backup device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0144] Those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the data backup device for virtual machines and may include more or fewer components than illustrated.

[0145] The virtual machine data backup device provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: virtual machine data backup method, with the same effect as above.

[0146] This application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments (which may be a method corresponding to the master site side, a method corresponding to the slave site side, or a method corresponding to both the master site side and the slave site side).

[0147] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0148] The computer-readable storage medium provided in this application includes the aforementioned virtual machine data backup method, with the same effect.

[0149] To enable those skilled in the art to better understand the present application, the following description is provided in conjunction with the appendix. Figure 5 The present application will be further described in detail with reference to specific embodiments. Figure 5 A flowchart illustrating a disaster recovery method for a dual-virtualization site based on CBT backup, provided as an embodiment of this application. Figure 5 As shown, at the main site, the active image is divided into multiple bitmaps, and incremental data is obtained through the QEMU process for backup management. The main site transmits the incremental data to the slave site via the network, and the slave site performs backup management and stores the incremental data on a virtual disk.

[0150] As can be seen, this embodiment achieves disaster recovery for virtualized dual sites through CBT backup, ensuring data protection for virtualized sites with a smaller amount of data backup, which can greatly enhance the security of enterprise data.

[0151] The foregoing has provided a detailed description of a method, apparatus, and medium for backing up virtual machine data provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0152] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for backing up data in a virtual machine, characterized in that, Applied to the main site, the method includes: Obtain the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the last backup process of the data of the virtual machine to be backed up; The difference between the current bitmap file and the initial bitmap file is obtained in order to obtain incremental data of the virtual machine's bitmap file; wherein, the amount of incremental data is less than or equal to the amount of data in the current bitmap file; specifically, the incremental data is obtained through the QEMU process; The incremental data is transferred to the slave site so that the slave site can back up and merge the incremental data; virtual machine data is backed up using backup based on tracking modified data blocks to reduce the amount of data per backup, thereby improving the backup efficiency of virtual machine data; Before obtaining the difference between the current bitmap file and the initial bitmap file to obtain incremental data of the virtual machine's bitmap file, the method further includes: Determine whether the virtual machine data to be backed up exists in the slave site; If so, proceed to the step of obtaining the difference between the current bitmap file and the initial bitmap file in order to obtain the incremental data of the virtual machine's bitmap file; If not, the current bitmap file is transferred to the slave site, and the steps of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up are returned; Before obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data to be backed up, the method further includes: Obtain the first parameters of the virtual machine to be backed up and the second parameters of the virtual machine to be backed up from the slave site that has established a mapping relationship with the master site; If the first parameter and the second parameter are the same, proceed to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; Before transmitting the incremental data to the slave site so that the slave site can back up and merge the incremental data, the method further includes: Determine whether the incremental data is less than or equal to a preset value; If so, return to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; If not, proceed to the step of transmitting the incremental data to the slave site so that the slave site can back up and merge the incremental data.

2. The method for data backup of a virtual machine according to claim 1, characterized in that, Before obtaining the current bitmap file of the virtual machine, the method further includes: Control the virtual machine to be backed up in pause mode; Correspondingly, after obtaining the current bitmap file of the virtual machine, the method further includes: Control the operation of the virtual machine to be backed up.

3. The method for data backup of a virtual machine according to claim 2, characterized in that, The step of transmitting the incremental data to the slave station includes: The incremental data is transmitted to the slave site via the TCP protocol.

4. The method for backing up virtual machine data according to claim 3, characterized in that, After transmitting the incremental data to the slave station, the method further includes: From the start of transmitting the incremental data to the slave station, determine whether a prompt message indicating that the incremental data has been received from the slave station is received within a first preset time period; If not, return to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up.

5. A method for backing up data in a virtual machine, characterized in that, Applied to a site, the method includes: The incremental data is obtained from the master site; wherein, the incremental data is obtained by the master site from the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; the difference between the current bitmap file and the initial bitmap file is obtained; specifically, the incremental data is obtained through the QEMU process; The incremental data is backed up and merged; virtual machine data is backed up using backup based on tracking modified data blocks to reduce the amount of data per backup, thereby improving the backup efficiency of virtual machine data; Before obtaining the difference between the current bitmap file and the initial bitmap file, the main site also includes: The master site determines whether the virtual machine data to be backed up exists in the slave site; if yes, it proceeds to the step of obtaining the difference between the current bitmap file and the initial bitmap file; if no, it transmits the current bitmap file to the slave site and returns to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine in the previous backup process of the data to be backed up. Before obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data to be backed up, the method further includes: Obtain the first parameters of the virtual machine to be backed up and the second parameters of the virtual machine to be backed up from the slave site that has established a mapping relationship with the master site; If the first parameter and the second parameter are the same, proceed to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; Before the master site transmits the incremental data to the slave site so that the slave site can back up and merge the incremental data, the method further includes: Determine whether the incremental data is less than or equal to a preset value; If so, return to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; If not, the master site transmits the incremental data to the slave site so that the slave site can back up and merge the incremental data.

6. The method for backing up virtual machine data according to claim 5, characterized in that, Before acquiring the incremental data transmitted from the main site, the method further includes: Determine if backup data for the virtual machine exists; If so, proceed to the step of obtaining incremental data transmitted by the main site; If not, back up the current bitmap file; and return to the step of obtaining incremental data transmitted from the main site.

7. The method for backing up virtual machine data according to claim 6, characterized in that, The process of backing up and merging the incremental data includes: Starting from the moment the incremental data transmitted by the main site is acquired, it is determined whether the incremental data has been backed up within a second preset time period; If not, return to the step of obtaining incremental data transmitted from the main site.

8. The method for backing up virtual machine data according to any one of claims 5 to 7, characterized in that, The method further includes: After the incremental data is backed up, a prompt message indicating that the backup of the incremental data is complete is output.

9. The method for backing up virtual machine data according to claim 8, characterized in that, The method further includes: After the incremental data is backed up, the information of the virtual disk where the incremental data is located is sent to the main site.

10. A device for backing up virtual machine data, characterized in that, Applied to the main site, the device includes: The first acquisition module is used to acquire the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; The second acquisition module is used to acquire the difference between the current bitmap file and the initial bitmap file in order to acquire incremental data of the virtual machine's bitmap file; wherein, the amount of incremental data is less than or equal to the amount of data in the current bitmap file; specifically, the incremental data is obtained through the QEMU process; The transmission module is used to transmit the incremental data to the slave site so that the slave site can back up and merge the incremental data; to back up the virtual machine data by using backup based on tracking modified data blocks, so as to reduce the amount of data in each backup and thus improve the backup efficiency of the virtual machine data; Also includes: Determine whether the virtual machine data to be backed up exists in the slave site; If so, then the second acquisition module is triggered; If not, the current bitmap file is transferred to the slave station, and the first acquisition module is triggered. Before obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data to be backed up, the method further includes: Obtain the first parameters of the virtual machine to be backed up and the second parameters of the virtual machine to be backed up from the slave site that has established a mapping relationship with the master site; If the first parameter and the second parameter are the same, proceed to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; Before transmitting the incremental data to the slave site so that the slave site can back up and merge the incremental data, the method further includes: Determine whether the incremental data is less than or equal to a preset value; If so, return to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; If not, proceed to the step of transmitting the incremental data to the slave site so that the slave site can back up and merge the incremental data.

11. A device for backing up virtual machine data, characterized in that, Applied to a site, the device includes: The acquisition module is used to acquire incremental data transmitted by the master site; wherein, the incremental data is obtained by the master site acquiring the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; the difference between the current bitmap file and the initial bitmap file is obtained; specifically, the incremental data is obtained through the QEMU process; The backup module is used to back up the incremental data; it uses backup based on tracking modified data blocks to back up virtual machine data, thereby reducing the amount of data in each backup and improving the backup efficiency of virtual machine data. Before obtaining the difference between the current bitmap file and the initial bitmap file, the main site also includes: The master site determines whether the virtual machine data to be backed up exists in the slave site; if yes, it proceeds to the step of obtaining the difference between the current bitmap file and the initial bitmap file; if no, it transmits the current bitmap file to the slave site and returns to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine in the previous backup process of the data to be backed up. Before obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data to be backed up, the method further includes: Obtain the first parameters of the virtual machine to be backed up and the second parameters of the virtual machine to be backed up from the slave site that has established a mapping relationship with the master site; If the first parameter and the second parameter are the same, proceed to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; Before the master site transmits the incremental data to the slave site so that the slave site can back up and merge the incremental data, the process also includes: Determine whether the incremental data is less than or equal to a preset value; If so, return to the step of obtaining the current bitmap file of the virtual machine and the initial bitmap file of the virtual machine during the previous backup process of the data of the virtual machine to be backed up; If not, the master site transmits the incremental data to the slave site so that the slave site can back up and merge the incremental data.

12. A device for backing up virtual machine data, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method for data backup of a virtual machine as described in any one of claims 1 to 9 when executing the computer program.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for data backup of a virtual machine as described in any one of claims 1 to 9.