Data backup method, device, electronic device and readable storage medium
By continuously monitoring the source virtual machine during the data backup process and generating incremental data identification, the problems of time-consuming data backup and data loss in the existing technology are solved, and an efficient and complete data backup process is achieved.
Patent Information
- Application Number
- CN202411875844.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-04
AI Technical Summary
The prior art consumes a lot of time and computing resources during data backup, and under network delay, it is easy to cause data loss in the target virtual machine, making it difficult to ensure the integrity of data during transmission.
By continuously monitoring each virtual disk of the source virtual machine on the source computer device, incremental data within the preset time period is obtained, and identification is generated for each incremental data, saved to the log file to be transferred, and transferred to the target computer device. The target computer device determines the write order based on the identification of the incremental data and writes the incremental data to the target virtual disk of the target virtual machine.
It reduces time and computing resources during transmission, avoids data loss caused by network delay, ensures the integrity of data during transmission, and enables the target computer equipment to correctly write data based on the identification of incremental data, achieving the accuracy and efficiency of data backup.
Smart Images

Figure CN119759660A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a data backup method, device, electronic device and readable storage medium. Background Art
[0002] As the scale of enterprises expands, local data backup of source virtual machines can no longer meet the business needs for system availability, practicality, and security. When the local backup data of the source virtual machine is damaged, it is crucial to improve the ability of data to resist risks.
[0003] Related technologies usually use periodic or manual backup methods for the data of the source virtual machine, back up the full data in each virtual disk of the source virtual machine, and then transfer the backed-up full data to the target virtual machine to achieve off-site data backup.
[0004] However, the data backup method adopted by the related technology directly backs up the full data, which consumes a lot of time and computing resources during the backup process. In addition, during the transmission of the full data, the full data actually received at the backup point is determined by the time period. In the case of network delays, the data of each target virtual disk in the target virtual machine will be lost at the backup point, making it difficult to ensure the integrity of the data during the transmission process. Summary of the invention
[0005] The present application aims to provide a data method, device, electronic device and readable storage medium, which at least solve the problem that the method in the prior art consumes a lot of time and computing resources during the backup process, and in the event of network delays, the data of each target virtual disk in the target virtual machine will be lost at the backup point, making it difficult to ensure the integrity of the data during the transmission process.
[0006] In a first aspect, an embodiment of the present application discloses a data backup method, which is applied to a source computer device, and the method includes:
[0007] Receiving a configuration instruction sent by a target computer device; the configuration instruction is used to instruct the target computer device to complete the same virtual machine configuration as the source computer device;
[0008] In response to the configuration instruction, continuously monitor the data of each virtual disk of the source virtual machine of the source computer device according to a preset time period, and obtain incremental data corresponding to each virtual disk within the preset time period; the incremental data is data added or modified since the last preset time period;
[0009] Generate an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data, and save each incremental data and the identifier of each incremental data in the log file to be transmitted;
[0010] According to the preset time period, the log file to be transmitted is transmitted to the target computer device, so that the target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to back up the data of the source virtual machine.
[0011] In a second aspect, an embodiment of the present application discloses a data backup method, which is applied to a target computer device, and the method includes:
[0012] In the case where the target computer device and the source computer device have the same virtual machine configuration, generating a configuration instruction;
[0013] Sending the configuration instruction to the source computer device so that the source computer device continuously monitors the data of each virtual disk of the source virtual machine of the source computer device to obtain incremental data corresponding to each virtual disk within a preset time period; the incremental data is data added or modified since the last preset time period;
[0014] According to the preset time period, receiving the log file to be transmitted transmitted by the source computer device; the log file to be transmitted includes each incremental data of the source virtual machine, and generating an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data;
[0015] Based on the identifier of each incremental data, the writing order of each incremental data is determined, and according to the writing order of each incremental data, each incremental data included in the received log file to be transmitted is written into the target virtual disk of the target virtual machine corresponding to the target computer device, so as to back up the data of the source virtual machine.
[0016] In a third aspect, an embodiment of the present application discloses a data backup device, which is applied to a source computer device, and the device includes:
[0017] A receiving module, used to receive a configuration instruction sent by a target computer device; the configuration instruction is used to indicate that the target computer device has completed the same virtual machine configuration as the source computer device;
[0018] A data monitoring module, configured to respond to the configuration instruction and continuously monitor the data of each virtual disk of the source virtual machine of the source computer device according to a preset time period, and obtain incremental data corresponding to each virtual disk within the preset time period; the incremental data is data added or modified since the last preset time period;
[0019] A generating module, configured to generate an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data, and save each incremental data and the identifier of each incremental data into a log file to be transmitted;
[0020] The first transmission module is used to transmit the log file to be transmitted to the target computer device according to the preset time period, so that the target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to back up the data of the source virtual machine.
[0021] In a fourth aspect, an embodiment of the present application discloses a data backup device, which is applied to a target computer device, and the device includes:
[0022] A first generating module, configured to generate a configuration instruction when the target computer device and the source computer device have completed the same virtual machine configuration;
[0023] A sending module, configured to send the configuration instruction to the source computer device, so that the source computer device continuously monitors the data of each virtual disk of the source virtual machine of the source computer device, and obtains the incremental data corresponding to each virtual disk within a preset time period; the incremental data is the data newly added or modified since the last preset time period;
[0024] A receiving module, configured to receive the log file to be transmitted transmitted by the source computer device according to the preset time period; the log file to be transmitted includes each incremental data of the source virtual machine, and generates an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data;
[0025] A processing module is used to determine the writing order of each incremental data based on the identifier of each incremental data, and write each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to back up the data of the source virtual machine.
[0026] In a fifth aspect, an embodiment of the present application further discloses an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0027] In a sixth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0028] In summary, the embodiment of the present application continuously monitors the data of each virtual disk of the source virtual machine of the source computer device according to the preset time period, obtains the incremental data corresponding to each virtual disk within the preset time period, generates an identifier for each incremental data, saves each incremental data and the identifier of each incremental data in the log file to be transmitted, and transmits it to the target computer device. In the process of data transmission, on the one hand, since the application transmits incremental data during the transmission process, that is, the data newly added or modified compared with the last time period, rather than the full amount of data, the time and computing resources in the transmission process can be reduced. On the other hand, the application generates an identifier for the incremental data generated by the source virtual machine within the preset time period, and determines the incremental data within the preset time period by the identifier, which can avoid the problem of data loss caused by network delay, thereby ensuring the integrity of the data during the transmission process, so that the target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data received to the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, and backs up the data of the source virtual machine, so that the data in each virtual disk of the source virtual machine is consistent with the data of the target virtual disk of the corresponding target virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In the attached picture:
[0030] Figure 1 It is a flowchart of the steps of a data backup method provided by an embodiment of the present application;
[0031] Figure 2 It is a system block diagram of a data backup method provided by an embodiment of the present application;
[0032] Figure 3 is a flowchart of another data backup method provided by an embodiment of the present application;
[0033] Figure 4 It is a flow chart of the interactive steps of a data backup method provided in an embodiment of the present application;
[0034] Figure 5 It is a structural block diagram of a data backup device provided in an embodiment of the present application;
[0035] Figure 6 is a structural block diagram of another data backup device provided in an embodiment of the present application;
[0036] Figure 7 is a block diagram of an electronic device according to an embodiment of the present application;
[0037] Figure 8 It is a block diagram of an electronic device of another embodiment provided by the embodiments of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0040] With the rapid development of cloud computing and big data technology, the scale of data centers continues to expand, and the demand for data security and business continuity is becoming increasingly urgent. In data center operations, virtualization technology is widely used to improve resource utilization and management efficiency.
[0041] However, in a virtualized environment, a major challenge is how to ensure the consistency and business continuity of key applications when the data of the source virtual machine of the source computer device is damaged. Traditional virtual machine data recovery solutions generally use local scheduled periodic backup or user manual backup to protect data. When the data of the source virtual machine is damaged, it can be restored through the data of the scheduled backup point or manual backup point. Since periodic backups are usually backed up in days or hours, newly added and modified data after the backup point will be lost. In addition, periodic backups and manual backups can only ensure consistency at the data level, that is, crash consistency, but cannot ensure data application consistency.
[0042] The embodiment of the present application continuously monitors the data of each virtual disk of the source virtual machine deployed in the source computer device according to the preset time period, obtains the incremental data corresponding to each virtual disk within the preset time period, generates an identifier for each incremental data, saves each incremental data and the identifier of each incremental data in the log file to be transmitted, and transmits it to the target computer device. In the process of data transmission, on the one hand, since the application transmits incremental data during the transmission process, that is, the data newly added or modified compared with the last time period, rather than the full amount of data, the time and computing resources in the transmission process can be reduced. On the other hand, the application generates an identifier for the incremental data generated by the source virtual machine within the preset time period, and determines the incremental data within the preset time period by the identifier, which can avoid the problem of data loss caused by network delay, thereby ensuring the integrity of the data during the transmission process, so that the target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data received into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, and backs up the data of the source virtual machine, so that the data in each virtual disk of the source virtual machine is consistent with the data of the target virtual disk of the corresponding target virtual machine.
[0043] Figure 1 is a flowchart of a data backup method provided by an embodiment of the present application, referring to Figure 1 , applied to a source computer device, the method may include the following steps:
[0044] Step 101: Receive a configuration instruction sent by a target computer device; the configuration instruction is used to indicate that the target computer device has completed the same virtual machine configuration as the source computer device.
[0045] In the embodiment of the present application, the target computer device may be a computer device that is pre-set and corresponds to the source computer device. The same virtual machine configuration may be that the number of target virtual machines in the target computer device is the same as the number of source virtual machines in the source computer device, or the data content of each disk of the target virtual machine in the target computer device is the same as the data content of each virtual disk of the source virtual machine in the source computer device, or both of the above may be the same.
[0046] For example, the data content used by the virtual disk is obtained after authorization by the user or the data owner.
[0047] See also Figure 2 , the number of source virtual machines is 1, and the number of target virtual machines is also 1. The number of virtual disks of the source virtual machine is 3, and the number of target virtual disks of the target virtual machine is also 3. The embodiment of the present application only takes the number of source virtual machines as 1 and the number of virtual disks of the source virtual machine as 3 as an example, and does not specifically limit the number of source virtual machines and the number of virtual disks of the source virtual machines.
[0048] In the embodiment of the present application, after the target computer device completes the same virtual machine configuration as the source computer device, a configuration instruction is generated and sent to the source computer device. After the source computer device receives the configuration instruction, the data content of the source computer device virtual machine can be backed up to the target virtual machine of the target computer device, thereby realizing off-site backup.
[0049] Step 102, in response to the configuration instruction, continuously monitor the data of each virtual disk of the source virtual machine of the source computer device according to a preset time period, and obtain incremental data corresponding to each virtual disk within the preset time period; the incremental data is data added or modified since the last preset time period.
[0050] In the embodiment of the present application, the preset time period may be an interval based on the second level, for example, 30 seconds. The number of source virtual machines included in the source computer device may be 1 or more. The virtual disks of the source virtual machine may be 1 or more. For example, the number of source virtual machines included in the source computer device is 1 and the number of virtual disks of the source virtual machine is 3. Figure 2 After the source computer device receives the configuration instruction, it continuously monitors the data of virtual disk 1, virtual disk 2, and virtual disk 3 of the source virtual machine at intervals of 30 seconds, and obtains the newly added or modified data corresponding to virtual disk 1, virtual disk 2, and virtual disk 3 respectively compared with the full data after the previous 30 seconds, as the incremental data corresponding to virtual disk 1, virtual disk 2, and virtual disk 3, namely incremental data 1, incremental data 2, and incremental data 3.
[0051] In an embodiment of the present application, after obtaining incremental data 1, incremental data 2, and incremental data 3, incremental data 1, incremental data 2, and incremental data 3 are independently transmitted to the target virtual machine, so that the target virtual machine can write incremental data 1, incremental data 2, and incremental data 3 to target virtual disk 1, target virtual disk 2, and target virtual disk 3, which can reduce the time and computing resources consumed during data recovery and ensure the integrity of data recovery in the source virtual machine.
[0052] Step 103: Generate an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data, and save each incremental data and the identifier of each incremental data in the log file to be transmitted.
[0053] In the embodiment of the present application, the identifier can be the basis for distinguishing the incremental data written to the target virtual disk. After obtaining the incremental data 1, incremental data 2, and incremental data 3, the timestamps corresponding to the incremental data 1, incremental data 2, and incremental data 3 are obtained, and the corresponding identifiers are generated for the incremental data 1, incremental data 2, and incremental data 3 according to the order of the timestamps, so as to determine the order in which the incremental data 1, incremental data 2, and incremental data 3 are written to the target virtual disk according to the identifier, thereby ensuring that at each backup point, the data in the target virtual disk is consistent with the data on the virtual disk, and achieving data crash consistency.
[0054] Step 104: according to the preset time period, the log file to be transmitted is transmitted to the target computer device, so that the target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to realize data backup of the source virtual machine.
[0055] In an embodiment of the present application, taking the preset time period of 30 seconds as an example, the log file to be transmitted is transmitted to the target computer device every 30 seconds, and the incremental data of the source virtual machine is sent down at the same time to ensure the application consistency of the data in each continuous data monitoring process at the backup point.
[0056] The embodiment of the present application continuously monitors the data of each virtual disk of the source virtual machine, and generates an identifier for the incremental data generated by each virtual disk within a preset time period, so that the target virtual machine can write the received incremental data to the corresponding target virtual disk based on the identifier of each incremental data within the preset time period. During the data transmission process, on the one hand, since the present application transmits incremental data, that is, data that is newly added or modified compared with the previous time period, rather than the full data, during the transmission process, the time and computing resources of the transmission process can be reduced. On the other hand, the present application generates an identifier for the incremental data generated by the source virtual machine within the preset time period. By identifying the incremental data within the preset time period, the problem of data loss caused by network delay can be avoided, thereby ensuring the integrity of the data during the transmission process.
[0057] Figure 3 The step flow chart of another data backup method provided by the embodiment of the present application is as follows: Figure 3 , applied to a target computer device, the method may include the following steps:
[0058] Step 201 : generating a configuration instruction when the target computer device and the source computer device have completed the same virtual machine configuration.
[0059] This step may refer to the above step 101 and will not be described in detail here.
[0060] Step 202: Send the configuration instruction to the source computer device, so that the source computer device continuously monitors the data of each virtual disk of the source virtual machine deployed in the source computer device, and obtains the incremental data corresponding to each virtual disk within a preset time period; the incremental data is the data added or modified since the last preset time period.
[0061] This step may refer to the above step 102 and will not be described in detail here.
[0062] Step 203: receiving the log file to be transmitted from the source computer device according to the preset time period; the log file to be transmitted includes each incremental data of the source virtual machine, and generating an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data.
[0063] In an embodiment of the present application, taking the preset time period of 30 seconds as an example, every 30 seconds, the target computer device will receive the log file to be transmitted by the source computer device. After receiving the log file to be transmitted by the source computer device, the incremental data in the log file to be transmitted is written into the target virtual disk corresponding to the virtual disk to which the incremental data belongs, so as to realize off-site data backup.
[0064] Step 204: Based on the identifier of each incremental data, determine the writing order of each incremental data, and write each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to back up the data of the source virtual machine.
[0065] In an embodiment of the present application, the identifier of the incremental data may include a number, which indicates the order in which each incremental data is written to the target disk corresponding to the virtual disk to which the incremental data belongs.
[0066] For example, the writing order of incremental data 1, incremental data 2, and incremental data 3 is to write incremental data 1 first, then incremental data 3, and finally incremental data 2. Figure 2 After the target computer device receives the log file to be transmitted, the target virtual machine writes incremental data 1 to target virtual disk 1, incremental data 3 to target virtual disk 3, and incremental data 2 to target virtual disk 2 to back up the data of the source virtual machine.
[0067] The embodiment of the present application continuously monitors the data of each virtual disk of the source virtual machine, and generates an identifier for the incremental data generated by each virtual disk within a preset time period, so that the target virtual machine can write the received incremental data to the corresponding target virtual disk based on the identifier of each incremental data within the preset time period. During the data transmission process, on the one hand, since the present application transmits incremental data, that is, data that is newly added or modified compared with the previous time period, rather than the full data, during the transmission process, the time and computing resources of the transmission process can be reduced. On the other hand, the present application generates an identifier for the incremental data generated by the source virtual machine within the preset time period. By identifying the incremental data within the preset time period, the problem of data loss caused by network delay can be avoided, thereby ensuring the integrity of the data during the transmission process.
[0068] Figure 4 is a flowchart of the interactive steps of a data backup method provided in an embodiment of the present application, referring to Figure 4 , the method may include the following steps:
[0069] Step 301: When the target computer device and the source computer device have completed the same virtual machine configuration, the target computer device generates a configuration instruction.
[0070] This step may refer to the above step 101 and will not be described in detail here.
[0071] Step 302: The target computer device sends the configuration instruction to the source computer device, so that the source computer device continuously monitors the data of each virtual disk of the source virtual machine of the source computer device to obtain incremental data corresponding to each virtual disk within a preset time period; the incremental data is data added or modified since the last preset time period.
[0072] This step may refer to the above step 102 and will not be described in detail here.
[0073] Step 303: The source computer device receives the configuration instruction sent by the target computer device; the configuration instruction is used to indicate that the target computer device has completed the same virtual machine configuration as the source computer device.
[0074] This step may refer to the above step 101 and will not be described in detail here.
[0075] Step 304: The source computer device responds to the configuration instruction and continuously monitors the data of each virtual disk of the source virtual machine of the source computer device according to a preset time period to obtain incremental data corresponding to each virtual disk within the preset time period; the incremental data is data added or modified since the last preset time period.
[0076] This step may refer to the above step 102 and will not be described in detail here.
[0077] Optionally, step 304 may specifically include:
[0078] Sub-step 3041, start a monitoring process for each virtual disk of the source virtual machine, continuously capture data changes of each virtual disk within the preset time period by using a continuous data protection method, and obtain incremental data corresponding to each virtual disk within the preset time period.
[0079] In the embodiment of the present application, the continuous data protection method is to continuously capture the changes of each virtual disk data of the source virtual machine, and then save these changed data independently. This method can achieve data recovery with finer time granularity.
[0080] See also Figure 2, a monitoring process is started for virtual disk 1, virtual disk 2, and virtual disk 3 of the source virtual machine, and the data changes of virtual disk 1, virtual disk 2, and virtual disk 3 are captured respectively through the continuous data protection method, and the incremental data 1 generated by virtual disk 1, incremental data 2 generated by virtual disk 2, and incremental data 3 generated by virtual disk 3 within 30 seconds are obtained, and then incremental data 1, incremental data 2, and incremental data 3 are saved in the cache device. In this solution, incremental data will be continuously captured and tracked, and the incremental data will be stored in an independent location different from the primary storage location, which can ensure that data can be restored to any point in time in the past.
[0081] Step 305: Each time the source computer device obtains incremental data within the preset time period, it controls the source virtual machine corresponding to the incremental data to suspend operation within a preset pause duration, so that each of the virtual disks of the source virtual machine stops generating incremental data within the preset pause duration; the source virtual machine resumes operation after the preset pause duration expires.
[0082] In the embodiment of the present application, the preset pause time may be 1 second, which is much shorter than the time period of 30 seconds. Figure 2 Within every 30 seconds, after the virtual disk 1, virtual disk 2, and virtual disk 3 of the source virtual machine generate incremental data 1, incremental data 2, and incremental data 3 respectively, the source virtual machine is controlled to suspend work within 1 second. During this 1 second, virtual disk 1, virtual disk 2, and virtual disk 3 all stop generating incremental data. The source virtual machine can mark incremental data 1, incremental data 2, and incremental data 3, thereby improving the integrity of data during transmission.
[0083] Step 306: The source computer device generates a name serial number arranged in the order of timestamps for each incremental data in accordance with the arrangement order of the timestamps of each incremental data in all the incremental data within the preset time period, uses the name serial number as an identifier of the incremental data, and saves each incremental data and the identifier of each incremental data in the log file to be transmitted.
[0084] In the embodiment of the present application, it is assumed that the timestamp of incremental data 1 is earlier than the timestamp of incremental data 3, and the timestamp of incremental data 3 is earlier than the timestamp of incremental data 2. A name sequence number may be generated for incremental data 1, incremental data 2, and incremental data 3, respectively, namely second_1, second_3, and second_2. Wherein second represents the second time period, second_1 represents that the first incremental data written to the target virtual machine in the second time period is incremental data 1, second_2 represents that the second incremental data written to the target virtual machine in the second time period is incremental data 3, and second_3 represents that the third incremental data written to the target virtual machine in the second time period is incremental data 2.
[0085] Optionally, step 306 may specifically include:
[0086] Sub-step 3061: The source computer device encrypts the incremental data using the identifier of the incremental data to obtain the encrypted incremental data.
[0087] Sub-step 3062: After the source computer device encrypts each incremental data, each encrypted incremental data is saved in a log file to be transmitted.
[0088] In an embodiment of the present application, the source computer device encrypts the incremental data by utilizing the identifier of the incremental data, and saves each encrypted incremental data in a log file to be transmitted, so that the target computer device decrypts the encrypted incremental data based on the identifier of the incremental data. On the one hand, the security of the data during the transmission process can be improved, and on the other hand, the reception of other data during the transmission process can be avoided.
[0089] Step 307: The source computer device transmits the log file to be transmitted to the target computer device according to the preset time period.
[0090] In an embodiment of the present application, when the log file to be transmitted is transmitted according to a preset time period, the log file to be transmitted can be compressed first and then transmitted to the target virtual machine through a high-speed network to reduce bandwidth consumption.
[0091] In the examples of this application, see Figure 2 The log file to be transmitted can be stored in the cache device. After a preset time period is reached, the cache device transmits the log file to be transmitted to the data sending module, and the data sending module transmits the log file to be transmitted to the data receiving module. After the data receiving module receives the log file to be transmitted, the log file to be transmitted is transmitted to the target virtual machine.
[0092] Step 308: The target computer device receives the log file to be transmitted from the source computer device according to the preset time period; the log file to be transmitted includes each incremental data of the source virtual machine, and generates an identifier for each incremental data according to the arrangement order of the timestamps of all the incremental data.
[0093] In the embodiment of the present application, the log file to be transmitted includes incremental data 1, incremental data 2, incremental data 3, and second_1, second_3, and second_2. Among them, second_1, second_3, and second_2 reflect the arrangement order of the timestamps of incremental data 1, incremental data 2, and incremental data 3. That is, the timestamp of incremental data 1 is earlier than the timestamp of incremental data 3, and the timestamp of incremental data 3 is earlier than the timestamp of incremental data 2.
[0094] In an embodiment of the present application, the target computer device receives the log file to be transmitted from the source computer device according to a preset time period, which can improve the integrity of the data and ensure business consistency.
[0095] Step 309: The target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to back up the data of the source virtual machine.
[0096] In the embodiment of the present application, the target computer device can determine the writing order of incremental data 1, incremental data 2, and incremental data 3 based on the identifier second_1 of incremental data 1, the identifier second_3 of incremental data 2, and the identifier second_2 of incremental data 3, that is, first write incremental data 1, then write incremental data 3, and finally write incremental data 2. In accordance with the writing order of incremental data 1, incremental data 2, and incremental data 3, incremental data 1 is written to target virtual machine 1, incremental data 3 is written to target virtual machine 3, and incremental data 2 is written to target virtual machine 2, and the data of the source virtual machine is backed up.
[0097] Optionally, the method further includes:
[0098] Step 310: Obtain an identifier of the target virtual machine corresponding to the source virtual machine, and obtain an identifier of the target virtual disk corresponding to the virtual disk of the source virtual machine.
[0099] Step 311: according to the identifier of the target virtual machine corresponding to the source virtual machine, transmit the log file to be transmitted to the target virtual machine corresponding to the source virtual machine.
[0100] Step 312: Determine the target virtual disk corresponding to the virtual disk according to the identifier of the target virtual disk corresponding to the virtual disk of the source virtual machine, so that the target virtual machine writes each incremental data into the target virtual disk corresponding to the virtual disk corresponding to the incremental data according to the writing order represented by the identifier of each incremental data.
[0101] For steps 310 to 312, in the embodiment of the present application, see Figure 2 , determine that the source virtual machine corresponds to the target virtual machine through the identifier of the target virtual machine corresponding to the source virtual machine. Determine that virtual disk 1 corresponds to target virtual disk 1, virtual disk 2 corresponds to target virtual disk 2, and virtual disk 3 corresponds to target virtual disk 3 through the identifier of the target virtual disk corresponding to the virtual disk of the source virtual machine. The correspondence here means that the data of the virtual disk needs to be written to the corresponding target virtual disk. In the order of writing incremental data 1 first, then writing incremental data 3, and finally writing incremental data 2, incremental data 1 is written to target virtual machine 1, incremental data 3 is written to target virtual machine 3, and incremental data 2 is written to target virtual machine 2 to back up the data of the source virtual machine.
[0102] Optionally, the method further includes:
[0103] Step 313: After each of the incremental data and the identifier of each of the incremental data is saved in the log file to be transmitted, the log file to be transmitted is saved in a cache device.
[0104] Step 314: first obtain the log file to be transmitted from the cache device, and calculate the hash value of the log file to be transmitted according to the information digest algorithm.
[0105] Step 315: After the log file to be transmitted is transmitted to the target computer device, the transmitted log file is obtained.
[0106] Step 316: Calculate the hash value of the transmitted log file according to the information digest algorithm.
[0107] Step 317: If the hash value of the log file to be transmitted is inconsistent with the hash value of the transmitted log file, reacquire the log file to be transmitted from the cache device.
[0108] Step 318: If the hash value of the log file to be transmitted is consistent with the hash value of the transmitted log file, or the hash value of the new log file to be transmitted is consistent with the hash value of the new transmitted log file, the new log file to be transmitted is retransmitted to the target computer device.
[0109] Step 319: If no new log file to be transmitted is obtained, a snapshot is taken of the data of each virtual disk of the source virtual machine to obtain the full data of each virtual disk within the current preset time period, and the full data of each virtual disk within the previous preset time period is obtained.
[0110] Step 320: compare the full data of each virtual disk in the current preset time period with the full data of each virtual disk in the previous preset time period, take the newly added or modified data in the full data of each virtual disk in the current preset time period as the incremental data of each virtual disk, save it to the new log file to be transferred, and transfer the new log file to be transferred to the target computer device.
[0111] Optionally, for step 313-step 320, in an embodiment of the present application, after generating incremental data 1, incremental data 2, incremental data 3, and corresponding identifiers second_1, second_3, and second_2, the two are saved in the log file to be transmitted, and the log file to be transmitted is saved in a cache device, and the log file to be transmitted is transmitted to the target computer device. After the log file to be transmitted is transmitted to the target computer device, the transmitted log file is obtained. The MD5 value of the log file to be transmitted and the MD5 value of the transmitted log file are calculated according to the message digest algorithm (MD5, Message-Digest Algorithm) respectively. If the MD5 value of the log file to be transmitted is consistent with the MD5 value of the transmitted log file, it indicates that there is no data loss during the transmission process. If the MD5 value of the log file to be transmitted is inconsistent with the MD5 value of the transmitted log file, it indicates that there is data loss during the transmission process, then the log file to be transmitted is retrieved from the cache device. Until the MD5 value of the log file to be transferred is consistent with the MD5 value of the transferred log file, or the MD5 value of the new log file to be transferred is consistent with the MD5 value of the new transferred log file, the new log file to be transferred is transferred to the target computer device again. If the new log file to be transferred cannot be obtained, a snapshot of the data of virtual disk 1, virtual disk 2, and virtual disk 3 of the source virtual machine is taken to obtain the full data of each virtual disk within the current 30 seconds, and the full data of each virtual disk within the last 30 seconds is obtained, and the full data of each virtual disk within the current 30 seconds is compared with the full data of each virtual disk within the last 30 seconds, and the newly added or modified data in the full data of each virtual disk within the current 30 seconds is saved as the incremental data of each virtual disk in the new log file to be transferred, and the new log file to be transferred is transferred to the target computer device. The integrity of the data is improved by verifying the log file to be transferred.
[0112] Optionally, the method further includes:
[0113] Step 321, obtain a recovery point, and receive a backup file sent by the target computer device; the backup file includes backup data; the backup data is backup data generated after each target virtual disk of the target virtual machine writes the incremental data within the preset time period; the recovery point is a timestamp generated after the preset time period has passed.
[0114] Step 322: Acquire the backup data corresponding to the recovery point from the backup file, and determine the writing order of each target virtual disk data in the backup data based on the identifier of each incremental data in the backup data.
[0115] Step 323: Write each target virtual disk data into the virtual disk of the source virtual machine corresponding to the target virtual disk according to the writing order of each target virtual disk data.
[0116] With respect to steps 321 to 323, in some implementations, the recovery point may be a time point after the data of the source virtual machine is destroyed. After obtaining the recovery point and the backup file sent by the target computer device, the target backup data in the backup file is obtained based on the recovery point. Based on the identifier second_1 of the incremental data 1 of the target virtual disk 1, the identifier second_3 of the incremental data 2 of the target virtual disk 2, and the identifier second_2 of the incremental data 3 of the target virtual disk 3, it is determined to first write the data of the target virtual disk 1, then write the data of the target virtual disk 3, and finally write the data of the target virtual disk 2. According to the writing order of the target virtual disk data, the data of the target virtual disk 1 is written to the virtual disk 1 of the source virtual machine, the data of the target virtual disk 3 is written to the virtual disk 3 of the source virtual machine, and the data of the target virtual disk 2 is written to the virtual disk 2 of the source virtual machine. After the data of all the target virtual disks of the recovery point are written to the corresponding virtual disks of the source virtual machine, the recovery of the data of the recovery point is completed.
[0117] In other implementations, the recovery point may be a time point before the source virtual machine data is destroyed, and the recovery point may be a time point that the user wants to recover. The user may select a recoverable time point to meet the needs of different users. After obtaining the recovery point and the backup file sent by the target computer device, the target backup data corresponding to the recovery point in the backup file is obtained based on the recovery point. Based on the identifier second_1 of the incremental data 1 of the target virtual disk 1, the identifier second_3 of the incremental data 2 of the target virtual disk 2, and the identifier second_2 of the incremental data 3 of the target virtual disk 3, it is determined to write the data of the target virtual disk 1 first, then the data of the target virtual disk 3, and finally the data of the target virtual disk 2. According to the writing order of the target virtual disk data, the data of the target virtual disk 1 is written to the virtual disk 1 of the source virtual machine, the data of the target virtual disk 3 is written to the virtual disk 3 of the source virtual machine, and the data of the target virtual disk 2 is written to the virtual disk 2 of the source virtual machine. After the data of the recovery point and all the target virtual disks are written to the corresponding virtual disks of the source virtual machine, the recovery of the data of the recovery point is completed.
[0118] Optionally, the method further includes:
[0119] Step 324: Obtain the number of the source virtual machines and the number of each virtual disk in the source virtual machines, and configure in the target computer device the same number of target virtual machines as the source virtual machines and the same number of target virtual disks as the number of each virtual disk in the source virtual machines.
[0120] Step 325: Acquire the data of each virtual disk in the source virtual machine, and write the data of each virtual disk into the target virtual disk corresponding to the virtual disk.
[0121] For steps 324 and 325, obtain the number of source virtual machines and the number of virtual disks in the source virtual machines, see Figure 2 , taking the case where the number of source virtual machines is 1 and the number of virtual disks in the source virtual machine is 3 as an example, in the target computer device, 1 target virtual machine and 3 target virtual disks are configured, and the initial data content contained in each target virtual disk is the same as the initial data content of the corresponding source virtual machine, so as to ensure that the configuration of the target virtual machine is the same as the configuration of the source virtual machine.
[0122] Optionally, the method further includes:
[0123] Step 326: After the incremental data is written to each target virtual disk within the preset time period, a backup data is generated.
[0124] Step 327: Take a snapshot of the backup data and save it in a backup file.
[0125] Step 328: If the amount of backup data in the backup file is greater than a preset value, the backup data first saved in the backup file is deleted until the amount of backup data in the backup file is equal to the preset value, and then the backup data is stopped from being deleted.
[0126] With respect to step 326-step 328, in the embodiment of the present application, taking the preset value of 10 as an example, after every 30 seconds, after the target virtual disk 1, the target virtual disk 2, and the target virtual disk 3 have all written incremental data, a backup data is generated, and a snapshot of the backup data is taken and saved in the backup file. When the number of backup data in the backup file is greater than 10, the backup data first saved in the backup file is deleted in the order in which the backup data is saved, until the number of backup data in the backup file is equal to 10, and then the backup data is stopped from being deleted. In the backup file of the embodiment of the present application, by updating a certain amount of backup data, the storage pressure of the computer device can be reduced.
[0127] The embodiment of the present application continuously monitors the data of each virtual disk of the source virtual machine, and generates an identifier for the incremental data generated by each virtual disk within a preset time period, so that the target virtual machine can write the received incremental data to the corresponding target virtual disk based on the identifier of each incremental data within the preset time period. During the data transmission process, on the one hand, since the present application transmits incremental data, that is, data that is newly added or modified compared with the previous time period, rather than the full data, during the transmission process, the time and computing resources of the transmission process can be reduced. On the other hand, the present application generates an identifier for the incremental data generated by the source virtual machine within the preset time period. By identifying the incremental data within the preset time period, the problem of data loss caused by network delay can be avoided, thereby ensuring the integrity of the data during the transmission process.
[0128] refer to Figure 5 , which shows a data backup device 40 provided in an embodiment of the present application, the device 40 is applied to a source computer device, and the device 40 includes:
[0129] The receiving module 401 is used to receive a configuration instruction sent by a target computer device; the configuration instruction is used to indicate that the target computer device has completed the same virtual machine configuration as the source computer device;
[0130] The data monitoring module 402 is used to respond to the configuration instruction and continuously monitor the data of each virtual disk of the source virtual machine deployed in the source computer device according to a preset time period, and obtain the incremental data corresponding to each virtual disk within the preset time period; the incremental data is the data added or modified since the last preset time period;
[0131] A generating module 403 is used to generate an identifier for each incremental data according to the arrangement order of the timestamps of all the incremental data, and save each incremental data and the identifier of each incremental data into a log file to be transmitted;
[0132] The first transmission module 404 is used to transmit the log file to be transmitted to the target computer device according to the preset time period, so that the target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to realize data backup of the source virtual machine.
[0133] Optionally, the device further comprises:
[0134] A first acquisition module, used to acquire an identifier of the target virtual machine corresponding to the source virtual machine, and to acquire an identifier of the target virtual disk corresponding to the virtual disk of the source virtual machine;
[0135] A second transmission module, configured to transmit the log file to be transmitted to the target virtual machine corresponding to the source virtual machine according to the identifier of the target virtual machine corresponding to the source virtual machine;
[0136] The first determination module is used to determine the target virtual disk corresponding to the virtual disk according to the identifier of the target virtual disk corresponding to the virtual disk of the source virtual machine, so that the target virtual machine writes each incremental data into the target virtual disk corresponding to the virtual disk corresponding to the incremental data according to the writing order represented by the identifier of each incremental data.
[0137] Optionally, the first generating module includes:
[0138] The control submodule is used to control the source virtual machine corresponding to the incremental data to suspend operation within a preset suspension time each time the incremental data within the preset time is obtained, so that each virtual disk of the source virtual machine stops generating incremental data within the preset suspension time; the source virtual machine resumes operation after the preset suspension time ends;
[0139] A generation submodule is used to generate a name serial number arranged in the order of timestamps for each incremental data in the preset time period according to the arrangement order of timestamps of each incremental data among all the incremental data, and use the name serial number as the identifier of the incremental data.
[0140] Optionally, the device further comprises:
[0141] A saving module, configured to save each incremental data and an identifier of each incremental data to a log file to be transmitted, and then save the log file to be transmitted to a cache device;
[0142] A first calculation module, used to first obtain the log file to be transmitted from the cache device, and calculate the hash value of the log file to be transmitted according to the information digest algorithm;
[0143] A second acquisition module, used for acquiring the transmitted log file after the to-be-transmitted log file is transmitted to the target computer device;
[0144] A second calculation module, used for calculating the hash value of the transmitted log file according to the information digest algorithm;
[0145] A third acquisition module, configured to reacquire the log file to be transmitted from the cache device if the hash value of the log file to be transmitted is inconsistent with the hash value of the transmitted log file;
[0146] A third transmission module, configured to retransmit the new log file to be transmitted to the target computer device if the hash value of the log file to be transmitted is consistent with the hash value of the transmitted log file, or the hash value of the new log file to be transmitted is consistent with the hash value of the new transmitted log file;
[0147] The fourth acquisition module is used to take a snapshot of the data of each virtual disk of the source virtual machine if no new log file to be transmitted can be obtained, obtain the full data of each virtual disk in the current preset time period, and obtain the full data of each virtual disk in the previous preset time period;
[0148] The fourth transmission module is used to compare the full data of each virtual disk within the current preset time period with the full data of each virtual disk within the previous preset time period, and save the newly added or modified data in the full data of each virtual disk within the current preset time period as the incremental data of each virtual disk to the new log file to be transmitted, and transmit the new log file to be transmitted to the target computer device.
[0149] Optionally, the device further comprises:
[0150] A fifth acquisition module is used to acquire a recovery point and receive a backup file sent by the target computer device; the backup file includes backup data; the backup data is backup data generated after each target virtual disk of the target virtual machine writes the incremental data within the preset time period; the recovery point is a timestamp generated after the preset time period has passed;
[0151] A second determination module is used to obtain the backup data corresponding to the recovery point from the backup file, and determine the writing order of each target virtual disk data in the backup data based on the identifier of each incremental data in the backup data;
[0152] The writing module is used to write each target virtual disk data into the virtual disk of the source virtual machine corresponding to the target virtual disk according to the writing order of each target virtual disk data.
[0153] Optionally, the data monitoring module includes:
[0154] The data monitoring submodule is used to start a monitoring process for each virtual disk of the source virtual machine, continuously capture the data changes of each virtual disk by using a continuous data protection method within the preset time period, and obtain the incremental data corresponding to each virtual disk within the preset time period.
[0155] The embodiment of the present application continuously monitors the data of each virtual disk of the source virtual machine, and generates an identifier for the incremental data generated by each virtual disk within a preset time period, so that the target virtual machine can write the received incremental data to the corresponding target virtual disk based on the identifier of each incremental data within the preset time period. During the data transmission process, on the one hand, since the present application transmits incremental data, that is, data that is newly added or modified compared with the previous time period, rather than the full data, during the transmission process, the time and computing resources of the transmission process can be reduced. On the other hand, the present application generates an identifier for the incremental data generated by the source virtual machine within the preset time period. By identifying the incremental data within the preset time period, the problem of data loss caused by network delay can be avoided, thereby ensuring the integrity of the data during the transmission process.
[0156] refer to Figure 6 , which shows another data backup device 50 provided in an embodiment of the present application, the device 50 is applied to a target computer device, and the device 50 includes:
[0157] A first generating module, configured to generate a configuration instruction when the target computer device and the source computer device have completed the same virtual machine configuration;
[0158] A sending module, configured to send the configuration instruction to the source computer device, so that the source computer device continuously monitors the data of each virtual disk of the source virtual machine deployed in the source computer device, and obtains the incremental data corresponding to each virtual disk within a preset time period; the incremental data is the data newly added or modified since the last preset time period;
[0159] A receiving module, configured to receive the log file to be transmitted transmitted by the source computer device according to the preset time period; the log file to be transmitted includes each incremental data of the source virtual machine, and an identifier generated for each incremental data according to the arrangement order of the respective timestamps of all the incremental data;
[0160] A processing module is used to determine the writing order of each incremental data based on the identifier of each incremental data, and write each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to back up the data of the source virtual machine.
[0161] Optionally, the device further comprises:
[0162] A first acquisition module is used to acquire the number of the source virtual machines and the number of each virtual disk in the source virtual machines, and configure the target virtual machines with the same number as the source virtual machines and the target virtual disks with the same number as each virtual disk in the source virtual machines in the target computer device;
[0163] The second acquisition module is used to acquire the data of each virtual disk in the source virtual machine, and write the data of each virtual disk into the target virtual disk corresponding to the virtual disk.
[0164] Optionally, the device further comprises:
[0165] A second generating module, configured to generate a backup data after each of the target virtual disks has written the incremental data within the preset time period;
[0166] A saving module, used for taking a snapshot of the backup data and saving it in a backup file;
[0167] The deleting module is used to delete the backup data first saved in the backup file if the amount of backup data in the backup file is greater than a preset value, and stop deleting the backup data until the amount of backup data in the backup file is equal to the preset value.
[0168] The embodiment of the present application continuously monitors the data of each virtual disk of the source virtual machine, and generates an identifier for the incremental data generated by each virtual disk within a preset time period, so that the target virtual machine can write the received incremental data to the corresponding target virtual disk based on the identifier of each incremental data within the preset time period. During the data transmission process, on the one hand, since the present application transmits incremental data, that is, data that is newly added or modified compared with the previous time period, rather than the full data, during the transmission process, the time and computing resources of the transmission process can be reduced. On the other hand, the present application generates an identifier for the incremental data generated by the source virtual machine within the preset time period. By identifying the incremental data within the preset time period, the problem of data loss caused by network delay can be avoided, thereby ensuring the integrity of the data during the transmission process.
[0169] Reference Figure 7 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0170] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0171] The memory 604 is used to store various types of data to support the operation of the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, multimedia, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0172] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.
[0173] The multimedia component 608 includes an interface that provides an output interface between the electronic device 600 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0174] The audio component 610 is used to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC, Microphone), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0175] The input / output I / O interface 612 provides an interface between the processing component 602 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0176] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of user contact with the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0177] The communication component 616 is used to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0178] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to implement a data backup method provided in an embodiment of the present application.
[0179] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0180] Figure 8 is a block diagram of an electronic device 700 according to another embodiment of the present invention. For example, the electronic device 700 may be provided as a server. Figure 8The electronic device 700 includes a processing component 722, which further includes one or more processors, and a memory resource represented by a memory 732 for storing instructions executable by the processing component 722, such as an application. The application stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 722 is configured to execute instructions to perform a data backup method provided in an embodiment of the present application.
[0181] The electronic device 700 may also include a power supply component 726 configured to perform power management of the electronic device 700, a wired or wireless network interface 750 configured to connect the electronic device 700 to a network, and an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0182] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0183] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data backup method, characterized in that: Applied to a source computer device, the method comprises: Receiving a configuration instruction sent by a target computer device; the configuration instruction is used to indicate that the target computer device has completed the same virtual machine configuration as the source computer device; In response to the configuration instruction, continuously monitor the data of each virtual disk of the source virtual machine deployed in the source computer device according to a preset time period, and obtain incremental data corresponding to each virtual disk within the preset time period; the incremental data is data added or modified since the last preset time period; Generate an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data, and save each incremental data and the identifier of each incremental data in the log file to be transmitted; According to the preset time period, the log file to be transmitted is transmitted to the target computer device, so that the target computer device determines the writing order of each incremental data based on the identifier of each incremental data, and writes each incremental data included in the received log file to be transmitted into the target virtual disk of the target virtual machine corresponding to the target computer device according to the writing order of each incremental data, so as to realize data backup of the source virtual machine.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining an identifier of the target virtual machine corresponding to the source virtual machine, and obtaining an identifier of the target virtual disk corresponding to the virtual disk of the source virtual machine; According to the identifier of the target virtual machine corresponding to the source virtual machine, the log file to be transmitted is transmitted to the target virtual machine corresponding to the source virtual machine; According to the identifier of the target virtual disk corresponding to the virtual disk of the source virtual machine, determine the target virtual disk corresponding to the virtual disk, so that the target virtual machine writes each incremental data into the target virtual disk corresponding to the virtual disk corresponding to the incremental data in the writing order represented by the identifier of each incremental data.
3. The method according to claim 1, characterized in that Generating an identifier for each incremental data according to the arrangement order of the respective timestamps of all the incremental data includes: Each time when the incremental data within the preset time period is obtained, the source virtual machine corresponding to the incremental data is controlled to suspend operation within the preset suspension time, so that each of the virtual disks of the source virtual machine stops generating incremental data within the preset suspension time; the source virtual machine resumes operation after the preset suspension time ends; According to the arrangement order of the timestamps of each incremental data in all the incremental data within the preset time period, a name sequence number arranged in the order of the timestamps is generated for each incremental data in turn, and the name sequence number is used as the identifier of the incremental data.
4. The method according to claim 1, characterized in that: The method further comprises: After each of the incremental data and the identifier of each of the incremental data is saved in the log file to be transmitted, the log file to be transmitted is saved in a cache device; First, the log file to be transmitted is obtained from the cache device, and a hash value of the log file to be transmitted is calculated according to an information digest algorithm; After the to-be-transmitted log file is transmitted to the target computer device, obtaining the transmitted log file; Calculating a hash value of the transmitted log file according to the information digest algorithm; If the hash value of the log file to be transmitted is inconsistent with the hash value of the transmitted log file, reacquiring the log file to be transmitted from the cache device; If the hash value of the log file to be transmitted is consistent with the hash value of the transmitted log file, or the hash value of the new log file to be transmitted is consistent with the hash value of the new transmitted log file, then the new log file to be transmitted is retransmitted to the target computer device; If no new log file to be transmitted can be obtained, a snapshot is taken of the data of each virtual disk of the source virtual machine to obtain the full data of each virtual disk within the current preset time period, and the full data of each virtual disk within the previous preset time period is obtained; The full data of each of the virtual disks in the current preset time period is compared with the full data of each of the virtual disks in the previous preset time period, and the newly added or modified data in the full data of each of the virtual disks in the current preset time period is used as the incremental data of each virtual disk, saved in the new log file to be transferred, and the new log file to be transferred is transferred to the target computer device.
5. The method according to claim 1, characterized in that The method further comprises: Acquire a recovery point, and receive a backup file sent by the target computer device; the backup file includes backup data; the backup data is backup data generated after each target virtual disk of the target virtual machine writes the incremental data within the preset time period; the recovery point is a timestamp generated after the preset time period has passed; Acquire the backup data corresponding to the recovery point from the backup file, and determine the writing order of each target virtual disk data in the backup data based on the identifier of each incremental data in the backup data; According to the writing order of each target virtual disk data, each target virtual disk data is written into the virtual disk of the source virtual machine corresponding to the target virtual disk.
6. The method according to claim 1, characterized in that The continuously monitoring the data of each virtual disk of the source virtual machine of the source computer device to obtain the incremental data corresponding to each virtual disk within the preset time period includes: A monitoring process is started for each virtual disk of the source virtual machine, and data changes of each virtual disk are continuously captured by using a continuous data protection method within the preset time period to obtain incremental data corresponding to each virtual disk within the preset time period.
7. A data backup method, characterized in that: Applied to a target computer device, the method comprises: generating a configuration instruction when the target computer device and the source computer device have the same virtual machine configuration; Sending the configuration instruction to the source computer device so that the source computer device continuously monitors the data of each virtual disk of the source virtual machine deployed in the source computer device, and obtains the incremental data corresponding to each virtual disk within a preset time period; the incremental data is the data added or modified since the last preset time period; According to the preset time period, receiving the log file to be transmitted transmitted by the source computer device; the log file to be transmitted includes each incremental data of the source virtual machine, and an identifier generated for each incremental data according to the arrangement order of the respective timestamps of all the incremental data; Based on the identifier of each incremental data, the writing order of each incremental data is determined, and according to the writing order of each incremental data, each incremental data included in the received log file to be transmitted is written into the target virtual disk of the target virtual machine corresponding to the target computer device, so as to back up the data of the source virtual machine.
8. The method according to claim 7, characterized in that The method further comprises: Obtaining the number of the source virtual machines and the number of each virtual disk in the source virtual machines, and configuring the target virtual machines having the same number as the source virtual machines and the target virtual disks having the same number as the virtual disk in the source virtual machines in the target computer device; The data of each virtual disk in the source virtual machine is obtained, and the data of each virtual disk is written into the target virtual disk corresponding to the virtual disk.
9. The method according to claim 7, characterized in that: The method further comprises: After each of the target virtual disks has written the incremental data within the preset time period, generating a backup data; Taking a snapshot of the backup data and saving it in a backup file; If the amount of backup data in the backup file is greater than a preset value, the backup data first saved in the backup file is deleted until the amount of backup data in the backup file is equal to the preset value, and then the backup data is stopped from being deleted.
10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 9 are implemented.
11. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.