Data backup method, device, electronic device and storage medium
By monitoring the data transmission mode and network status of production virtual machines and dynamically adjusting the backup method, the problem of excessive dependence on network performance in off-site disaster recovery data transmission is solved, the stability and security of data backup are achieved, and the data transmission needs of complex scenarios are adapted.
Patent Information
- Application Number
- CN202411454165.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2044-10-17
AI Technical Summary
Existing technologies rely too heavily on network performance in off-site disaster recovery data transmission, resulting in unstable data backup and difficulty adapting to the challenges of complex scenarios.
By monitoring the data transmission mode and network status of production virtual machines, dynamically adjust the data backup method, adopt memory backup, cache backup, differential backup or full backup methods, combined with encryption and verification algorithms, reduce dependence on network performance.
It achieves the stability and security of data backup under different network conditions, reduces the impact of network performance on the backup process, and improves the reliability and integrity of data transmission.
Smart Images

Figure CN119512811B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtual machine technology, and in particular to a data backup method, device, electronic device, and storage medium. Background Art
[0002] Generally speaking, dual-site disaster recovery data transmission refers to establishing data centers in two different geographical locations and taking corresponding technical measures to ensure that when a failure or disaster occurs at the production site, the virtual machines and their related data at the production site are quickly and reliably transmitted to the disaster recovery site through a high-speed network connection, achieving real-time data synchronization and backup, thereby ensuring business continuity and data integrity.
[0003] However, since the production site and disaster recovery site are located in different locations for disaster recovery, the distance between them is relatively far, and the use of network transmission to back up data places high requirements on the network performance between the production site and the disaster recovery site, which brings great challenges to the safe switching of dual-site disaster recovery.
[0004] Therefore, there is an urgent need to propose a data backup method, device, electronic device and storage medium that can adapt to data backup in a variety of complex scenarios, minimize dependence on network performance, and ensure the stability of data backup. Summary of the Invention
[0005] Based on this, it is necessary to provide a data backup method, device, electronic device and storage medium that can adapt to data backup in a variety of complex scenarios, minimize dependence on network performance, and ensure the stability of data backup in response to the above technical problems.
[0006] In a first aspect, a data backup method is provided, which is applied to a data backup system. The data backup system includes a production site and a disaster recovery site. A production virtual machine is deployed at the production site, and a corresponding placeholder virtual machine is deployed at the disaster recovery site. The placeholder virtual machine is used to back up data of the production virtual machine. The method includes:
[0007] Monitoring the production virtual machine to obtain a data transmission mode of the production virtual machine;
[0008] In response to the data transmission mode being the incremental transmission mode, evaluating a network status between the production virtual machine and the placeholder virtual machine, and determining a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode;
[0009] In response to the data transmission mode being the full transmission mode, a second data backup mode is determined according to whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode.
[0010] In one embodiment, evaluating the network status between the production virtual machine and the placeholder virtual machine includes:
[0011] Obtaining preset network indicators, and monitoring network performance between the production virtual machine and the placeholder virtual machine based on the preset network indicators to obtain network performance data, wherein the preset network indicators include at least one of network transmission bandwidth, network transmission delay, network transmission packet loss rate, and network transmission throughput;
[0012] Obtaining a preset performance standard, and determining whether the network performance data meets the preset performance standard;
[0013] In response to the network performance data meeting the preset performance standard, determining that the network between the production virtual machine and the placeholder virtual machine is in a normal state;
[0014] In response to the network performance data not meeting the preset performance standard, it is determined that a network between the production virtual machine and the placeholder virtual machine is in an abnormal state.
[0015] In one embodiment, the data backup system further includes a transmission module, and the determining of a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode, includes:
[0016] In response to a network between the production virtual machine and the placeholder virtual machine being in a normal state, determining that the first data backup mode is a memory backup mode, wherein the memory backup mode includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data in a memory of the production virtual machine, and sending the incremental snapshot data in the memory to the placeholder virtual machine for backup through the transmission module;
[0017] In response to the network between the production virtual machine and the placeholder virtual machine being in an abnormal state, it is determined that the first data backup method is a cache backup method, wherein the cache backup method includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data to the cache of the production virtual machine, and sending the incremental snapshot data in the cache to the placeholder virtual machine for backup through the transmission module.
[0018] In one embodiment, determining a second data backup mode based on whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode, includes:
[0019] In response to the presence of baseline snapshot data in the production virtual machine, determining that the second data backup mode is a differential backup mode, wherein the differential backup mode includes: obtaining full snapshot data in the production virtual machine, comparing the full snapshot data with the baseline snapshot data to obtain differential snapshot data, and sending the differential snapshot data to the placeholder virtual machine for backup through the transmission module;
[0020] In response to the absence of baseline snapshot data in the production virtual machine, it is determined that the second data backup method is a full backup method, wherein the full backup method includes: obtaining the full snapshot data in the production virtual machine, and sending the full snapshot data to the placeholder virtual machine for backup through the transmission module.
[0021] In one embodiment, the method further comprises:
[0022] Generate a pair of public and private keys in the placeholder virtual machine according to a preset encryption algorithm, and send the public key to the production virtual machine through the transmission module;
[0023] Encrypting the incremental snapshot data / full snapshot data / differential snapshot data using the public key to obtain encrypted data, and sending the encrypted data to the placeholder virtual machine through the transmission module;
[0024] The encrypted data is decrypted using the private key to obtain decrypted data, and the decrypted data is written into the virtual disk in the placeholder virtual machine.
[0025] In one embodiment, the method further comprises:
[0026] Calculate the incremental snapshot data / full snapshot data / differential snapshot data sent by the production virtual machine according to a preset verification algorithm to obtain a standard verification value;
[0027] Calculate the incremental snapshot data / full snapshot data / differential snapshot data received by the placeholder virtual machine according to the preset verification algorithm to obtain an actual verification value;
[0028] Comparing the actual verification value with the standard verification value to generate a verification result;
[0029] In response to the actual check value being consistent with the standard check value, determining that the check result of the incremental snapshot data / full snapshot data / differential snapshot data is a successful check;
[0030] In response to the actual check value being inconsistent with the standard check value, it is determined that the check result of the incremental snapshot data / full snapshot data / differential snapshot data is a check failure.
[0031] In one embodiment, the method includes:
[0032] Monitoring the production virtual machine, obtaining operating status data of the production virtual machine, and determining the operating status of the production virtual machine based on the operating status data;
[0033] In response to an abnormality in the running state of the production virtual machine, a data transmission task is generated according to the running state data, wherein the running state data includes a failure time period of the production virtual machine and specified snapshot data within the failure time period, and the specified snapshot data includes incremental snapshot data / full snapshot data / differential snapshot data corresponding to the data transmission mode;
[0034] Sending the data transmission task of the production site to the disaster recovery site according to a preset transmission protocol, wherein the preset transmission protocol includes an identification bit, protocol information, and data information;
[0035] The identification bit includes a first identification bit, a second identification bit, a third identification bit, and a fourth identification bit, wherein the first identification bit is used to identify the placeholder virtual machine corresponding to the production virtual machine, the second identification bit is used to identify the type of the specified snapshot data transmitted by the production site to the disaster recovery site, the third identification bit is used to indicate that the production site notifies the disaster recovery site that an error has occurred in the transmission of the specified snapshot data, and the fourth identification bit is used to indicate that the production site notifies the disaster recovery site that the data transmission task is complete;
[0036] The protocol information includes memory information, cache information, and virtual disk information of the production virtual machine, and virtual disk information of the placeholder virtual machine;
[0037] The data information includes the failure time period of the production virtual machine and designated snapshot data.
[0038] In a second aspect, a data backup device is provided, the device comprising:
[0039] A monitoring module, configured to monitor the production virtual machine and obtain a data transmission mode of the production virtual machine;
[0040] an evaluation module, configured to evaluate a network status between the production virtual machine and the placeholder virtual machine in response to the data transmission mode being the incremental data transmission mode;
[0041] a first determining module, configured to determine, in response to the data transmission mode being the incremental data transmission mode, a first data backup mode according to the network state, wherein the first data backup mode includes a memory backup mode and a cache backup mode;
[0042] The second determination module is used to determine the second data backup method in response to the data transmission mode being the full data transmission mode, according to whether there is baseline snapshot data in the production virtual machine, wherein the second data backup method includes a differential backup method and a full backup method.
[0043] In a third aspect, an electronic device is provided, comprising one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, which, when read and executed by the one or more processors, execute the steps of the method described in any one of the first aspects above.
[0044] In a fourth aspect, 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 of the method described in any one of the above-mentioned first aspects are performed.
[0045] In a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.
[0046] The above-mentioned data backup method, device, electronic device and storage medium determine the first data backup method according to the data transmission mode of the production virtual machine, and when the data transmission mode is the incremental transmission mode, combine the network status between the production virtual machine and the placeholder virtual machine; when the data transmission mode is the full transmission mode, combine whether the production virtual machine contains baseline snapshot data to determine the second data backup method, thereby minimizing the dependence of data backup on network performance and ensuring the stability of data backup. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 1 is a flow chart of a data backup method according to an embodiment;
[0048] Figure 2 A flowchart of a data backup system in one embodiment;
[0049] Figure 3 is a structural block diagram of a data backup device in one embodiment;
[0050] Figure 4 FIG. 1 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0052] Example 1
[0053] In one embodiment, Figure 1 As shown, a data backup method is provided, which is applied to Figure 2 The data backup system shown includes a production site and a disaster recovery site, wherein a production virtual machine is deployed at the production site and a corresponding placeholder virtual machine is deployed at the disaster recovery site. The placeholder virtual machine is used to back up data of the production virtual machine. The method includes:
[0054] Monitoring the production virtual machine to obtain a data transmission mode of the production virtual machine;
[0055] In response to the data transmission mode being the incremental transmission mode, evaluating a network status between the production virtual machine and the placeholder virtual machine, and determining a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode;
[0056] In response to the data transmission mode being the full transmission mode, a second data backup mode is determined according to whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode.
[0057] Specifically, the first data backup method is determined based on the data transmission mode of the production virtual machine, and when the data transmission mode is the incremental transmission mode, the network status between the production virtual machine and the placeholder virtual machine is combined; when the data transmission mode is the full transmission mode, the second data backup method is determined based on whether the production virtual machine contains baseline snapshot data, thereby minimizing the dependence of data backup on network performance and ensuring the security, stability and reliability of data backup.
[0058] In one embodiment, evaluating the network status between the production virtual machine and the placeholder virtual machine includes:
[0059] Obtaining preset network indicators, and monitoring network performance between the production virtual machine and the placeholder virtual machine based on the preset network indicators to obtain network performance data, wherein the preset network indicators include at least one of network transmission bandwidth, network transmission delay, network transmission packet loss rate, and network transmission throughput;
[0060] Obtaining a preset performance standard, and determining whether the network performance data meets the preset performance standard;
[0061] In response to the network performance data meeting the preset performance standard, determining that the network between the production virtual machine and the placeholder virtual machine is in a normal state;
[0062] In response to the network performance data not meeting the preset performance standard, it is determined that a network between the production virtual machine and the placeholder virtual machine is in an abnormal state.
[0063] In a specific embodiment, the preset network indicators and preset performance standards include: Network bandwidth, monitoring indicator: monitoring the network bandwidth usage in and out of the virtual machine, including upload and download speeds; evaluation standard: whether the network bandwidth meets business requirements and whether there is sufficient margin to cope with sudden traffic. Network latency, monitoring indicator: measuring the time required for data packets to transmit in the network, including indicators such as round-trip time (RTT); evaluation standard: network latency should be kept at a low level to ensure rapid application response. Packet loss rate, monitoring indicator: counting the proportion of data packets lost during data transmission; evaluation standard: the packet loss rate should be as low as possible, as a high packet loss rate will affect the integrity and reliability of data transmission. Concurrent connections, monitoring indicator: monitoring the number of concurrent network connections established on the virtual machine; evaluation standard: the number of concurrent connections should meet business requirements to avoid performance bottlenecks caused by too many connections. Network error rate, monitoring indicator: counting the number of errors that occur during network transmission, such as CRC errors; evaluation standard: the network error rate should be as low as possible, as a high error rate may indicate problems with network hardware or configuration.
[0064] Specifically, network performance data is first obtained according to preset performance indicators, and then the network performance data is compared with the preset performance standards to accurately determine the network status between the production virtual machine and the placeholder virtual machine.
[0065] In one embodiment, the data backup system further includes a transmission module, and the determining of a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode, includes:
[0066] In response to a network between the production virtual machine and the placeholder virtual machine being in a normal state, determining that the first data backup mode is a memory backup mode, wherein the memory backup mode includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data in a memory of the production virtual machine, and sending the incremental snapshot data in the memory to the placeholder virtual machine for backup through the transmission module;
[0067] In response to the network between the production virtual machine and the placeholder virtual machine being in an abnormal state, it is determined that the first data backup method is a cache backup method, wherein the cache backup method includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data to the cache of the production virtual machine, and sending the incremental snapshot data in the cache to the placeholder virtual machine for backup through the transmission module.
[0068] Specifically, in incremental transfer mode, if the current network status is normal, the production virtual machine will be shut down and the unsynchronized incremental snapshot data will be transferred to the virtual disk of the placeholder virtual machine; if the current network status is abnormal, the incremental snapshot data will be stored in the cache first, and then the data will be synchronized through the cache, which minimizes the dependence of incremental snapshot data on network performance during transmission and ensures stability during data backup.
[0069] In one embodiment, determining a second data backup mode based on whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode, includes:
[0070] In response to the presence of baseline snapshot data in the production virtual machine, determining that the second data backup mode is a differential backup mode, wherein the differential backup mode includes: obtaining full snapshot data in the production virtual machine, comparing the full snapshot data with the baseline snapshot data to obtain differential snapshot data, and sending the differential snapshot data to the placeholder virtual machine for backup through the transmission module;
[0071] In response to the absence of baseline snapshot data in the production virtual machine, it is determined that the second data backup method is a full backup method, wherein the full backup method includes: obtaining the full snapshot data in the production virtual machine, and sending the full snapshot data to the placeholder virtual machine for backup through the transmission module.
[0072] In a specific embodiment, in full transfer mode, the production virtual machine is first shut down and a full snapshot data backup is performed. If baseline snapshot data exists in the production virtual machine, differential snapshot data is extracted for data transfer. If baseline snapshot data does not exist, the full snapshot backup data is transferred, reducing network pressure during data transfer.
[0073] In one embodiment, the method further comprises:
[0074] Generate a pair of public and private keys in the placeholder virtual machine according to a preset encryption algorithm, and send the public key to the production virtual machine through the transmission module;
[0075] Encrypting the incremental snapshot data / full snapshot data / differential snapshot data using the public key to obtain encrypted data, and sending the encrypted data to the placeholder virtual machine through the transmission module;
[0076] The encrypted data is decrypted using the private key to obtain decrypted data, and the decrypted data is written into the virtual disk in the placeholder virtual machine.
[0077] In a specific embodiment, the preset encryption algorithm includes but is not limited to an asymmetric encryption algorithm, which ensures the security of data backup by encrypting and decrypting incremental snapshot data / full snapshot data / differential snapshot data during transmission.
[0078] In one embodiment, the method further comprises:
[0079] Calculate the incremental snapshot data / full snapshot data / differential snapshot data sent by the production virtual machine according to a preset verification algorithm to obtain a standard verification value;
[0080] Calculate the incremental snapshot data / full snapshot data / differential snapshot data received by the placeholder virtual machine according to the preset verification algorithm to obtain an actual verification value;
[0081] Comparing the actual verification value with the standard verification value to generate a verification result;
[0082] In response to the actual check value being consistent with the standard check value, determining that the check result of the incremental snapshot data / full snapshot data / differential snapshot data is a successful check;
[0083] In response to the actual check value being inconsistent with the standard check value, it is determined that the check result of the incremental snapshot data / full snapshot data / differential snapshot data is a check failure.
[0084] In a specific embodiment, the preset verification algorithm includes but is not limited to a cyclic redundancy check algorithm, a message digest algorithm, and a secure hash algorithm. By comparing the actual verification value with the standard verification value, the integrity of the data backup is ensured.
[0085] In one embodiment, the method includes:
[0086] Monitoring the production virtual machine, obtaining operating status data of the production virtual machine, and determining the operating status of the production virtual machine based on the operating status data;
[0087] In response to an abnormality in the running state of the production virtual machine, a data transmission task is generated according to the running state data, wherein the running state data includes a failure time period of the production virtual machine and specified snapshot data within the failure time period, and the specified snapshot data includes incremental snapshot data / full snapshot data / differential snapshot data corresponding to the data transmission mode;
[0088] Sending the data transmission task of the production site to the disaster recovery site according to a preset transmission protocol, wherein the preset transmission protocol includes an identification bit, protocol information, and data information;
[0089] The identification bit includes a first identification bit, a second identification bit, a third identification bit, and a fourth identification bit, wherein the first identification bit is used to identify the placeholder virtual machine corresponding to the production virtual machine, the second identification bit is used to identify the type of the specified snapshot data transmitted by the production site to the disaster recovery site, the third identification bit is used to indicate that the production site notifies the disaster recovery site that an error has occurred in the transmission of the specified snapshot data, and the fourth identification bit is used to indicate that the production site notifies the disaster recovery site that the data transmission task is complete;
[0090] The protocol information includes memory information, cache information, and virtual disk information of the production virtual machine, and virtual disk information of the placeholder virtual machine;
[0091] The data information includes the failure time period of the production virtual machine and designated snapshot data.
[0092] Specifically, by presetting the format of the transmission protocol, the data transmission task is transferred from the production virtual machine to the placeholder virtual machine to facilitate subsequent data backup operations.
[0093] In one embodiment, Figure 2 As shown, a continuous data protection server is further deployed in the production site, and each production virtual machine is connected to the continuous data protection server. The method further includes:
[0094] In response to the data transmission mode being the incremental transmission mode, obtaining, through the continuous data protection server, incremental snapshot data in the production virtual machine, and saving the incremental snapshot data to a memory or cache in the production virtual machine based on a network status between the production virtual machine and the placeholder virtual machine;
[0095] Sending the incremental snapshot data in the memory or cache to the virtual disk of the placeholder virtual machine;
[0096] In response to the data transmission mode being the full transmission mode, the full snapshot data is obtained from the virtual disk of the production virtual machine, and based on whether there is baseline snapshot data in the production virtual machine, the full snapshot data or the differential snapshot data is sent to the virtual disk of the placeholder virtual machine.
[0097] In one embodiment, the method further comprises:
[0098] Monitoring the production site and generating a data backup request, wherein the data backup request includes a unique identifier of the production virtual machine in the production site;
[0099] Obtaining preset priorities of virtual machines in the disaster recovery site, and using virtual machines whose preset priorities meet preset conditions as placeholder virtual machines;
[0100] Determining whether there is a placeholder virtual machine in the disaster recovery site that matches the production virtual machine;
[0101] In response to the presence of a placeholder virtual machine matching the production virtual machine in the disaster recovery site, determining the placeholder virtual machine as a backup virtual machine corresponding to the production target virtual machine;
[0102] In response to the disaster recovery site not having a placeholder virtual machine that matches the production virtual machine, sending configuration information of the production virtual machine to the disaster recovery site, and controlling the disaster recovery site to create a backup virtual machine corresponding to the production virtual machine based on the configuration information of the production virtual machine;
[0103] In response to the disaster recovery site not having a placeholder virtual machine that matches the production virtual machine, synchronizing the full snapshot data of the production virtual machine to the created backup virtual machine;
[0104] In response to the disaster recovery site having a placeholder virtual machine that matches the production virtual machine, the incremental data of the production virtual machine is synchronized to the matching virtual machine.
[0105] In a specific embodiment, the preset priority can be to rank all virtual machines at the disaster recovery site based on the network status between the production virtual machines and each virtual machine at the disaster recovery site; and the preset condition can be to select virtual machines whose network performance data meets business requirements as backup virtual machines. Using these preset priorities and conditions, placeholder virtual machines corresponding to production virtual machines can be determined or created, fully utilizing the virtual machine resources at the disaster recovery site.
[0106] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0107] Example 2
[0108] In one embodiment, Figure 3 As shown, a data backup device is provided, the device comprising:
[0109] A monitoring module, configured to monitor the production virtual machine and obtain a data transmission mode of the production virtual machine;
[0110] an evaluation module, configured to evaluate a network status between the production virtual machine and the placeholder virtual machine in response to the data transmission mode being the incremental data transmission mode;
[0111] a first determining module, configured to determine, in response to the data transmission mode being the incremental data transmission mode, a first data backup mode according to the network state, wherein the first data backup mode includes a memory backup mode and a cache backup mode;
[0112] The second determination module is used to determine the second data backup method in response to the data transmission mode being the full data transmission mode, according to whether there is baseline snapshot data in the production virtual machine, wherein the second data backup method includes a differential backup method and a full backup method.
[0113] In one embodiment, the evaluation module is configured to evaluate the network status between the production virtual machine and the placeholder virtual machine, including:
[0114] Obtaining preset network indicators, and monitoring network performance between the production virtual machine and the placeholder virtual machine based on the preset network indicators to obtain network performance data, wherein the preset network indicators include at least one of network transmission bandwidth, network transmission delay, network transmission packet loss rate, and network transmission throughput;
[0115] Obtaining a preset performance standard, and determining whether the network performance data meets the preset performance standard;
[0116] In response to the network performance data meeting the preset performance standard, determining that the network between the production virtual machine and the placeholder virtual machine is in a normal state;
[0117] In response to the network performance data not meeting the preset performance standard, it is determined that a network between the production virtual machine and the placeholder virtual machine is in an abnormal state.
[0118] In one embodiment, the data backup system further includes a transmission module, and the first determination module is configured to determine a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode, including:
[0119] In response to a network between the production virtual machine and the placeholder virtual machine being in a normal state, determining that the first data backup mode is a memory backup mode, wherein the memory backup mode includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data in a memory of the production virtual machine, and sending the incremental snapshot data in the memory to the placeholder virtual machine for backup through the transmission module;
[0120] In response to the network between the production virtual machine and the placeholder virtual machine being in an abnormal state, it is determined that the first data backup method is a cache backup method, wherein the cache backup method includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data to the cache of the production virtual machine, and sending the incremental snapshot data in the cache to the placeholder virtual machine for backup through the transmission module.
[0121] In one embodiment, the second determining module is configured to determine a second data backup mode based on whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode, including:
[0122] In response to the presence of baseline snapshot data in the production virtual machine, determining that the second data backup mode is a differential backup mode, wherein the differential backup mode includes: obtaining full snapshot data in the production virtual machine, comparing the full snapshot data with the baseline snapshot data to obtain differential snapshot data, and sending the differential snapshot data to the placeholder virtual machine for backup through the transmission module;
[0123] In response to the absence of baseline snapshot data in the production virtual machine, it is determined that the second data backup method is a full backup method, wherein the full backup method includes: obtaining the full snapshot data in the production virtual machine, and sending the full snapshot data to the placeholder virtual machine for backup through the transmission module.
[0124] In one embodiment, the apparatus further comprises:
[0125] a generation module, configured to generate a pair of public and private keys in the placeholder virtual machine according to a preset encryption algorithm, and to send the public key to the production virtual machine via the transmission module;
[0126] an encryption module, configured to encrypt the incremental snapshot data / full snapshot data / differential snapshot data using the public key to obtain encrypted data;
[0127] The transmission module is further configured to send the encrypted data to the placeholder virtual machine via the transmission module;
[0128] a decryption module, configured to decrypt the encrypted data using the private key to obtain decrypted data;
[0129] A writing module is used to write the decrypted data into the virtual disk in the placeholder virtual machine.
[0130] In one embodiment, the apparatus further comprises:
[0131] A calculation module, configured to calculate the incremental snapshot data / full snapshot data / differential snapshot data sent by the production virtual machine according to a preset verification algorithm to obtain a standard verification value;
[0132] The calculation module is further configured to calculate the incremental snapshot data / full snapshot data / differential snapshot data received by the placeholder virtual machine according to the preset verification algorithm to obtain an actual verification value;
[0133] A comparison module, configured to compare the actual verification value with the standard verification value to generate a verification result;
[0134] a judgment module, configured to determine, in response to the actual check value being consistent with the standard check value, that a check result of the incremental snapshot data / full snapshot data / differential snapshot data is successful;
[0135] The judgment module is further configured to determine that a verification result of the incremental snapshot data / full snapshot data / differential snapshot data is a verification failure in response to the actual verification value being inconsistent with the standard verification value.
[0136] In one embodiment, the apparatus further comprises:
[0137] The monitoring module is further configured to monitor the production virtual machine and obtain operation status data of the production virtual machine;
[0138] a third determining module, configured to determine an operating state of the production virtual machine according to the operating state data;
[0139] The generating module is further configured to generate a data transmission task according to the operating status data in response to an abnormality in the operating status of the production virtual machine, wherein the operating status data includes a failure time period of the production virtual machine and specified snapshot data within the failure time period, and the specified snapshot data includes incremental snapshot data / full snapshot data / differential snapshot data corresponding to the data transmission mode;
[0140] The transmission module is further configured to send the data transmission task of the production site to the disaster recovery site according to a preset transmission protocol, wherein the preset transmission protocol includes an identification bit, protocol information, and data information;
[0141] The identification bit includes a first identification bit, a second identification bit, a third identification bit, and a fourth identification bit, wherein the first identification bit is used to identify the placeholder virtual machine corresponding to the production virtual machine, the second identification bit is used to identify the type of the specified snapshot data transmitted by the production site to the disaster recovery site, the third identification bit is used to indicate that the production site notifies the disaster recovery site that an error has occurred in the transmission of the specified snapshot data, and the fourth identification bit is used to indicate that the production site notifies the disaster recovery site that the data transmission task is complete;
[0142] The protocol information includes memory information, cache information, and virtual disk information of the production virtual machine, and virtual disk information of the placeholder virtual machine;
[0143] The data information includes the failure time period of the production virtual machine and designated snapshot data.
[0144] The specific definition of the data backup device can be found in the definition of the data backup method above and will not be repeated here. Each module in the above-mentioned data backup device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the electronic device in hardware form, or can be stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0145] Example 3
[0146] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0147] Monitoring the production virtual machine to obtain a data transmission mode of the production virtual machine;
[0148] In response to the data transmission mode being the incremental transmission mode, evaluating a network status between the production virtual machine and the placeholder virtual machine, and determining a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode;
[0149] In response to the data transmission mode being the full transmission mode, a second data backup mode is determined according to whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode.
[0150] When the program instructions are read and executed by the one or more processors, the program instructions may also perform operations corresponding to the various steps in the above method embodiments. Please refer to the above description and will not be repeated here. Figure 4 , which exemplarily shows the architecture of an electronic device, which may specifically include a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, and a memory 420. The processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420 may be communicatively connected via a communication bus 430.
[0151] Among them, the processor 410 can be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., to execute relevant programs to implement the technical solutions provided in this application.
[0152] The memory 420 can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 420 can store an operating system 421 for controlling the operation of the electronic device 400, and a basic input and output system (BIOS) 422 for controlling the low-level operations of the electronic device 400. In addition, a web browser 423, a data storage management 424, and an icon font processing system 425, etc. can also be stored. The above-mentioned icon font processing system 425 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 420 and is called and executed by the processor 410.
[0153] The input / output interface 413 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0154] The network interface 414 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0155] The bus 430 comprises a pathway for transmitting information between the various components of the device (eg, the processor 410 , the video display adapter 411 , the disk drive 412 , the input / output interface 413 , the network interface 414 , and the memory 420 ).
[0156] In addition, the electronic device 400 can also obtain information on specific collection conditions from the virtual resource object collection condition information database 441 for use in condition judgment, etc.
[0157] It should be noted that although the electronic device 400 shown above only includes a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, a memory 420, a bus 430, etc., in a specific implementation, the electronic device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the solution of the present application, and does not necessarily include all the components shown in the figure.
[0158] Through the description of the above implementation methods, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application can be essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling an electronic device (which can be a personal computer, a cloud server, or a network device, etc.) to execute the methods described in various embodiments of the present application or certain parts of the embodiments.
[0159] Example 4
[0160] 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 following steps are implemented:
[0161] Monitoring the production virtual machine to obtain a data transmission mode of the production virtual machine;
[0162] In response to the data transmission mode being the incremental transmission mode, evaluating a network status between the production virtual machine and the placeholder virtual machine, and determining a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode;
[0163] In response to the data transmission mode being the full transmission mode, a second data backup mode is determined according to whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode.
[0164] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. 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 memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0165] The technical features of the above embodiments can 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.
[0166] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
[0167] Example 5
[0168] In one embodiment, a computer program product is provided, wherein a computer program is stored on the product, and when the computer program is executed by a processor, the following steps are performed:
[0169] Monitoring the production virtual machine to obtain a data transmission mode of the production virtual machine;
[0170] In response to the data transmission mode being the incremental transmission mode, evaluating a network status between the production virtual machine and the placeholder virtual machine, and determining a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode;
[0171] In response to the data transmission mode being the full transmission mode, a second data backup mode is determined according to whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode.
[0172] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a computer program product. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0173] The technical features of the above embodiments can 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.
[0174] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A data backup method, applied to a data backup system, wherein the data backup system includes a production site and a disaster recovery site, wherein a production virtual machine is deployed at the production site, and a corresponding placeholder virtual machine is deployed at the disaster recovery site, wherein the placeholder virtual machine is used to back up data of the production virtual machine, characterized in that: The method comprises: Monitoring the production virtual machine to obtain a data transmission mode of the production virtual machine; In response to the data transmission mode being the incremental transmission mode, evaluating a network status between the production virtual machine and the placeholder virtual machine, and determining a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode; In response to the data transmission mode being the full transmission mode, a second data backup mode is determined according to whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode.
2. The method according to claim 1, characterized in that The evaluating the network status between the production virtual machine and the placeholder virtual machine includes: Obtaining preset network indicators, and monitoring network performance between the production virtual machine and the placeholder virtual machine based on the preset network indicators to obtain network performance data, wherein the preset network indicators include at least one of network transmission bandwidth, network transmission delay, network transmission packet loss rate, and network transmission throughput; Obtaining a preset performance standard, and determining whether the network performance data meets the preset performance standard; In response to the network performance data meeting the preset performance standard, determining that the network between the production virtual machine and the placeholder virtual machine is in a normal state; In response to the network performance data not meeting the preset performance standard, it is determined that a network between the production virtual machine and the placeholder virtual machine is in an abnormal state.
3. The method according to claim 2, characterized in that The data backup system further includes a transmission module, which determines a first data backup mode according to the network status, wherein the first data backup mode is a memory backup mode or a cache backup mode, including: In response to a network between the production virtual machine and the placeholder virtual machine being in a normal state, determining that the first data backup mode is a memory backup mode, wherein the memory backup mode includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data in a memory of the production virtual machine, and sending the incremental snapshot data in the memory to the placeholder virtual machine for backup through the transmission module; In response to the network between the production virtual machine and the placeholder virtual machine being in an abnormal state, it is determined that the first data backup method is a cache backup method, wherein the cache backup method includes: obtaining incremental snapshot data in the production virtual machine, saving the incremental snapshot data to the cache of the production virtual machine, and sending the incremental snapshot data in the cache to the placeholder virtual machine for backup through the transmission module.
4. The method according to claim 3, characterized in that Determining a second data backup mode according to whether baseline snapshot data exists in the production virtual machine, wherein the second data backup mode is a differential backup mode or a full backup mode, including: In response to the presence of baseline snapshot data in the production virtual machine, determining that the second data backup mode is a differential backup mode, wherein the differential backup mode includes: obtaining full snapshot data in the production virtual machine, comparing the full snapshot data with the baseline snapshot data to obtain differential snapshot data, and sending the differential snapshot data to the placeholder virtual machine for backup through the transmission module; In response to the absence of baseline snapshot data in the production virtual machine, it is determined that the second data backup method is a full backup method, wherein the full backup method includes: obtaining the full snapshot data in the production virtual machine, and sending the full snapshot data to the placeholder virtual machine for backup through the transmission module.
5. The method according to claim 4, characterized in that: The method further comprises: Generate a pair of public and private keys in the placeholder virtual machine according to a preset encryption algorithm, and send the public key to the production virtual machine through the transmission module; Encrypting the incremental snapshot data / full snapshot data / differential snapshot data using the public key to obtain encrypted data, and sending the encrypted data to the placeholder virtual machine through the transmission module; The encrypted data is decrypted using the private key to obtain decrypted data, and the decrypted data is written into the virtual disk in the placeholder virtual machine.
6. The method according to claim 4, characterized in that: The method further comprises: Calculate the incremental snapshot data / full snapshot data / differential snapshot data sent by the production virtual machine according to a preset verification algorithm to obtain a standard verification value; Calculate the incremental snapshot data / full snapshot data / differential snapshot data received by the placeholder virtual machine according to the preset verification algorithm to obtain an actual verification value; Comparing the actual verification value with the standard verification value to generate a verification result; In response to the actual check value being consistent with the standard check value, determining that the check result of the incremental snapshot data / full snapshot data / differential snapshot data is a successful check; In response to the actual check value being inconsistent with the standard check value, it is determined that the check result of the incremental snapshot data / full snapshot data / differential snapshot data is a check failure.
7. The method according to claim 1, characterized in that: The method comprises: Monitoring the production virtual machine, obtaining operating status data of the production virtual machine, and determining the operating status of the production virtual machine based on the operating status data; In response to an abnormality in the running state of the production virtual machine, a data transmission task is generated according to the running state data, wherein the running state data includes a failure time period of the production virtual machine and specified snapshot data within the failure time period, and the specified snapshot data includes incremental snapshot data / full snapshot data / differential snapshot data corresponding to the data transmission mode; Sending the data transmission task of the production site to the disaster recovery site according to a preset transmission protocol, wherein the preset transmission protocol includes an identification bit, protocol information, and data information; The identification bit includes a first identification bit, a second identification bit, a third identification bit, and a fourth identification bit, wherein the first identification bit is used to identify the placeholder virtual machine corresponding to the production virtual machine, the second identification bit is used to identify the type of the specified snapshot data transmitted by the production site to the disaster recovery site, the third identification bit is used to indicate that the production site notifies the disaster recovery site that an error has occurred in the transmission of the specified snapshot data, and the fourth identification bit is used to indicate that the production site notifies the disaster recovery site that the data transmission task is complete; The protocol information includes memory information, cache information, and virtual disk information of the production virtual machine, and virtual disk information of the placeholder virtual machine; The data information includes the failure time period of the production virtual machine and designated snapshot data.
8. A data backup device, characterized in that: The device comprises: A monitoring module, configured to monitor the production virtual machine and obtain a data transmission mode of the production virtual machine; an evaluation module, configured to evaluate a network status between the production virtual machine and the placeholder virtual machine in response to the data transmission mode being the incremental data transmission mode; a first determining module, configured to determine, in response to the data transmission mode being the incremental data transmission mode, a first data backup mode according to the network state, wherein the first data backup mode includes a memory backup mode and a cache backup mode; The second determination module is used to determine the second data backup method in response to the data transmission mode being the full data transmission mode, according to whether there is baseline snapshot data in the production virtual machine, wherein the second data backup method includes a differential backup method and a full backup method.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. 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 7 are implemented.
Citation Information
Patent Citations
Virtual machine disaster recovery protection method and device, electronic equipment and storage medium
CN117389692A
Disaster recovery data transmission method, device and equipment
CN118467250A