Data backup method and device, electronic equipment and storage medium

By determining the memory location of data updates in the virtual machine process for snapshot and backup, the problem of low data backup efficiency of virtual machine process is solved, efficient data backup is achieved and virtual machine process and data backup is decoupled, and internal backup and agentless backup are compatible.

CN119883724APending Publication Date: 2025-04-25SANGFOR TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411686280.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

During the data backup process of virtual machine processes, the backup efficiency of the existing technology is low, and the principles and implementation mechanisms of internal backup and agentless backup are different, so the advantages of the two cannot be integrated, resulting in the backup strategy and the generated backup data cannot be shared.

Method used

The target virtual machine process determines the target memory location where data updates exist in the virtual machine memory location, and only the data at that location is snapshot to obtain the first snapshot file. Then the snapshot service process backs up the data in the first snapshot file, realizing that data backup is only performed for memory location where data updates exist.

Benefits of technology

It improves the efficiency of data backup, realizes the decoupling of virtual machine processes and data backup, avoids the mutual influence between virtual machine processes and data backup, and solves the compatibility issues between internal backup and agentless backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883724A_ABST
    Figure CN119883724A_ABST
Patent Text Reader

Abstract

The invention discloses a data backup method and device, electronic equipment and a storage medium, and the data backup method comprises the steps: in response to a data backup instruction for current data in a virtual machine memory position corresponding to a target virtual machine process, determining a target memory position with data update in the virtual machine memory position; through the target virtual machine process, only performing snapshot on target data corresponding to the target memory position to obtain a first snapshot file; and performing data backup on the target data corresponding to the target memory position in the first snapshot file through the snapshot service process. According to the method, the target memory position where data updating exists in the memory positions of the virtual machine is determined firstly, then the data of the target memory position is backed up, data backup is only carried out on the memory position where data updating exists, and the data backup efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a data backup method, device, electronic device and storage medium. Background Art

[0002] In the related art, a snapshot is taken when backing up data of a virtual machine process, and the backup efficiency of the data backup is low. Summary of the invention

[0003] In view of the above problems, the present application proposes a data backup method, device, electronic device and storage medium.

[0004] In a first aspect, an embodiment of the present application provides a data backup method, the method comprising: in response to a data backup instruction for current data in a virtual machine memory location corresponding to a target virtual machine process, determining a target memory location in the virtual machine memory location where data updates exist; taking a snapshot of only the target data corresponding to the target memory location through the target virtual machine process to obtain a first snapshot file; and backing up the target data corresponding to the target memory location in the first snapshot file through a snapshot service process.

[0005] In a second aspect, an embodiment of the present application provides a data backup device, which includes: a target memory location determination module, which is used to determine the target memory location where data updates exist in the virtual machine memory location in response to a data backup instruction for current data in the virtual machine memory location corresponding to the target virtual machine process; a first snapshot file acquisition module, which is used to take a snapshot of only the target data corresponding to the target memory location through the target virtual machine process to obtain a first snapshot file; and a data backup module, which is used to back up the target data corresponding to the target memory location in the first snapshot file through a snapshot service process.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the data backup method provided in the first aspect above.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the data backup method provided in the first aspect above.

[0008] The solution provided by the present application is that when the target virtual machine process receives a data backup instruction, the target virtual machine process first determines the target memory location where the data is updated in the virtual machine memory location, then takes a snapshot of the current data in the target memory location to obtain a first snapshot file, and then backs up the data in the first snapshot file through the snapshot service process. The target memory location where the data is updated in the virtual machine memory location is first determined, and then the data in the target memory location is backed up, thereby realizing data backup only for the memory location where the data is updated, thereby improving the efficiency of data backup. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0010] Figure 1 A flow chart of a data backup method provided in an embodiment of the present application is shown.

[0011] Figure 2 A flow chart of a data backup method provided in another embodiment of the present application is shown.

[0012] Figure 3 A data backup schematic diagram of the data backup method provided in an embodiment of the present application is shown.

[0013] Figure 4 A structural block diagram of a data backup device provided in an embodiment of the present application is shown.

[0014] Figure 5 A structural block diagram of an electronic device provided by an embodiment of the present application for executing a data backup method according to an embodiment of the present application is shown.

[0015] Figure 6 A storage medium provided by an embodiment of the present application for storing or carrying a program code for implementing a data backup method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0016] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0017] In the related art, the data backup of the virtual machine process is completed through the virtual machine process. Therefore, the normal operation of the virtual machine process and the data backup will affect each other. When the virtual machine process fails, the data backup will be affected. Similarly, when the data backup is abnormal, it will also affect the normal operation of the virtual machine process. And the backup methods of the virtual machine process include internal backup and agentless backup. Internal backup means that during the backup period, the old data of the area to be backed up is copied to a temporary snapshot file when only writing. The snapshot file is in raw file format. After reading the entire disk without triggering the copy-on-write to be backed up area and writing it to the backup image; the old data of the temporary snapshot file will be read again and written to the backup file. Internal backup is a backup on the input / output (IO) path inside the virtual machine process. During the backup period, two IO services, backup reading and backup writing of temporary files, are added to the disk IO thread of the virtual machine process, which will also affect the extreme performance of the virtual machine process.

[0018] Agentless backup means copying old data when reading temporary snapshot files and writing them to backup files. The main principle of agentless backup is to provide a snapshot image of the virtual machine disk through the virtual machine snapshot, create a network server (such as a network disk device (Network Block Device, NBD)) for the snapshot image, and receive backup read requests from the network client (third-party disaster recovery software). The backup software on the network client reads the backup data and writes it to the backup file. The writing of agentless backup to the new area will turn one write IO into four IOs (read data + write table + write reference table + write data), which seriously affects the write performance. It is also incompatible with disk image formats without snapshot features.

[0019] Moreover, since the principles and implementation mechanisms of internal backup and agentless backup are different, it is impossible to integrate the advantages of the two, and the backup strategies and generated backup data cannot be shared.

[0020] In view of the problems in the background technology, the inventors have proposed the data backup method, device, electronic device and storage medium provided by the embodiments of the present application. When the target virtual machine process receives the data backup instruction, the target virtual machine process first determines the target memory location where the data update exists in the virtual machine memory location, then takes a snapshot of the current data in the target memory location to obtain a first snapshot file, and then backs up the data in the first snapshot file through the snapshot service process. The target memory location where the data update exists in the virtual machine memory location is first determined, and then the data in the target memory location is backed up, so that only the memory location where the data update exists is backed up, thereby improving the efficiency of data backup. Moreover, the target virtual machine process first obtains the data to be backed up, and then the snapshot service process backs up the data to be backed up, thereby decoupling the target virtual machine process from the data backup, and avoiding the mutual influence between the virtual machine process and the data backup.

[0021] The data backup method, device, electronic device and storage medium provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0022] See also Figure 2 , Figure 2 The data backup method provided in the embodiment of the present application is shown in the flowchart. The data backup method can be applied to Figure 4 The data backup device 300 and the electronic device 100 ( Figure 5 ).

[0023] The data backup method may specifically include the following steps:

[0024] Step S110: In response to a data backup instruction for current data in a virtual machine memory location corresponding to a target virtual machine process, a target memory location in the virtual machine memory location where data update exists is determined.

[0025] Among them, a virtual machine process (Virtual Machine Process, VMP) refers to one or more processes running in a virtualized environment, which simulate a complete computer system. The virtual machine process includes hardware and software, wherein the hardware includes but is not limited to memory, disk and network adapter, etc., and the software includes but is not limited to operating system and application program, etc. The target virtual machine process can be a virtual machine process running in the virtualized environment, the target virtual machine process can also be a virtual machine process specified by a user, the target virtual machine process can also be all virtual machine processes in the virtualized environment, and the target virtual machine process can be determined according to actual needs, and the target virtual machine process is not specifically limited here. And in the embodiment of the present application, the virtualized environment is preferably a virtual operating system simulator (Quick Emulator, QEMU), QEMU is an open source processor emulator and virtual machine manager. It can simulate various processor architectures on a variety of hardware platforms.

[0026] A memory location is a specific location in memory used to store data or instructions. A virtual machine memory location is a specific location used to store data or instructions for a target virtual machine process.

[0027] Furthermore, the data backup instruction may be obtained by a user inputting through a network terminal, or by a user inputting at a terminal where the virtualization environment is located, or by a data backup instruction generated after the virtual machine process reaches a preset state, for example, when the virtual machine process is turned on. The method for obtaining the data backup instruction is not specifically limited herein.

[0028] In an embodiment of the present application, the method for determining the target memory location where data is updated in the virtual machine memory location may be to traverse the virtual machine memory location and then determine the target memory location. The determination method may also be to record the memory location corresponding to the data update when the data is updated. The method for determining the target memory location where data is updated in the virtual machine memory location is not specifically limited here. It should be noted that the data update is compared to the data when the virtual machine process is started, or compared to the data after the last data backup.

[0029] Step S120: taking a snapshot of only the target data corresponding to the target memory location through the target virtual machine process to obtain a first snapshot file.

[0030] A snapshot is a shot or record of the current data state, and then the shot or recorded data is stored in a file to obtain the first snapshot file. By creating a snapshot, you can quickly restore to the state at the time of the snapshot when a process fails or data is lost, thereby reducing business interruption time and data loss.

[0031] In an embodiment of the present application, the target virtual machine process responds to a data backup instruction to take a snapshot of a target memory location where data is updated in the virtual machine memory location, and obtains a first snapshot file to back up the data at the target memory location.

[0032] Step S130: backing up the target data corresponding to the target memory location in the first snapshot file through the snapshot service process.

[0033] The snapshot service process is used to back up the data after the snapshot. The snapshot service process can be pre-set in the terminal, or created in response to the data backup instruction. The acquisition method of the snapshot service process is not specifically limited here.

[0034] Furthermore, the data backup method may be to write the data into a data file, or to store the data into a backup memory, and the data backup method is not specifically limited herein.

[0035] In the embodiment of the present application, the snapshot service process is used to back up the data in the first snapshot file, thereby decoupling the virtual machine process from the data backup and avoiding affecting the normal operation of the virtual machine process when a data backup fails.

[0036] The solution provided by this embodiment is that when the target virtual machine process receives a data backup instruction, the target virtual machine process first determines the target memory location where the data update exists in the virtual machine memory location, then takes a snapshot of the current data in the target memory location to obtain a first snapshot file, and then backs up the data in the first snapshot file through the snapshot service process. The target memory location where the data update exists in the virtual machine memory location is first determined, and then the data in the target memory location is backed up, so that only the memory location where the data update exists is backed up, thereby improving the efficiency of data backup. Moreover, the target virtual machine process first obtains the data to be backed up, and then the snapshot service process backs up the data to be backed up, thereby decoupling the target virtual machine process from the data backup, and avoiding mutual influence between the virtual machine process and the data backup.

[0037] The target memory location includes a first target memory location and a second target memory location. Figure 3 , Figure 3 A flow chart of a data backup method provided in another embodiment of the present application is shown.

[0038] Step S210: In response to a data backup instruction for current data in a virtual machine memory location corresponding to a target virtual machine process, a memory location map corresponding to the target virtual machine process at a current moment is obtained through the target virtual machine process.

[0039] Step S220: Based on the memory location map, determine a target memory location where data is updated in the virtual machine memory location.

[0040] The memory location map refers to a Changed Block Tracking (CBT) bitmap, which is used to track data blocks that have changed in the virtual machine process since the last backup, and the memory locations corresponding to the data blocks that have changed.

[0041] In an embodiment of the present application, after obtaining a data backup instruction for the current data in the virtual machine memory location corresponding to the target virtual machine process, the memory location map of the virtual machine process at the current moment is obtained through the target virtual machine process to determine the memory location where the target virtual machine process has data updates after the last data backup.

[0042] In some embodiments, in response to a data backup instruction for current data in a virtual machine memory location corresponding to a target virtual machine process, after obtaining, through the target virtual machine process, a memory location map corresponding to the target virtual machine process at the current moment, it also includes: through the target virtual machine process, switching the memory location map within the target virtual machine process to a blank memory location map to record the memory locations where data updates exist after this data backup is completed.

[0043] In this embodiment, the memory location map corresponding to the target virtual machine process is switched to a blank memory location map so as to record the memory locations where data updates exist after the data backup is completed. This makes it convenient to determine the memory locations where data updates exist based on the current blank memory location map when the data backup instruction is received next time, thereby improving the efficiency of determining the memory locations where data updates exist.

[0044] Step S230: taking a snapshot of only the target data corresponding to the target memory location through the target virtual machine process to obtain a first snapshot file.

[0045] For the detailed description of step S230, please refer to step S120 in the aforementioned embodiment, which will not be repeated here.

[0046] Step S240: For the first target memory location in the target memory location where data is updated after the snapshot is taken, the first target data corresponding to the first target memory location in the first snapshot file is written into a shared memory through the target virtual machine process, and the shared memory is created in response to the data backup instruction.

[0047] Step S250: In response to a write instruction of a backup file, the first target data in the shared memory is written into the backup file through the snapshot service process.

[0048] The shared memory is a memory created in response to a data backup instruction and is used to temporarily store data.

[0049] In the embodiment of the present application, when the first target memory location is snapshotted, the target virtual machine process writes new data again, at this time, the copy-on-write function of the snapshot is triggered, and the data corresponding to the first target memory location in the first snapshot file is written into the shared memory. After obtaining the write instruction, the data in the shared memory is written into the backup file to complete the data backup.

[0050] Furthermore, Copy On Write (COW) means that after creating a snapshot, the current state of the virtual machine process is retained, and data is not backed up in real time. Instead, when the virtual machine process subsequently performs a write service, the old data is copied to complete the backup of the old data. In an embodiment of the present application, when the virtual machine process subsequently performs a write service, the old data at the memory location is first written to the shared memory, and then the old data at the memory location is written to the backup file in response to a write instruction to perform data backup.

[0051] In some embodiments, in response to the backup file write instruction, writing the first target data in the shared memory to the backup file through the snapshot service process includes: writing the first target data in the shared memory to a second snapshot file through the snapshot service process, the second snapshot file being created in response to the data backup instruction. Obtaining a memory bitmap corresponding to the second snapshot file through the snapshot service process according to a memory location corresponding to the data in the second data file. In response to the backup file write instruction, writing the first target data in the second snapshot file to the backup file through the snapshot service process and according to the first target memory location and the memory bitmap.

[0052] In the implementation manner of the present application, after the data is stored in the shared memory, the data in the shared memory is written into the second snapshot file through the snapshot service process, and the memory bitmap corresponding to the second snapshot file is obtained according to the memory position corresponding to the data in the second snapshot file. Finally, according to the relationship between the memory bitmap and the first target memory position, the first target data in the second snapshot file is written into the backup file. By further verifying the first target data of the second snapshot file according to the relationship between the memory bitmap and the first target memory position, the accuracy of the data backup is ensured.

[0053] Further, the relationship between the memory bitmap and the first target memory location can be a subordinate relationship. For example, if the memory bitmap includes the first target memory location, the first data in the second snapshot file is written into the backup file. If the memory bitmap does not include the first target memory location, it is determined that the memory location corresponding to the first data in the second snapshot file does not match the first target memory location. At this time, the data needs to be verified and cannot be backed up to avoid data backup errors. The relationship can also be an association relationship. For example, if the memory location corresponding to the first target data in the second snapshot file is memory location 1, and the first target memory location includes memory location 1, at this time, it is determined that the first target memory location has an association relationship with memory location 1, and the first target data is written into the backup file in response to the write instruction. The relationship between the memory bitmap and the first target memory location is not specifically limited herein.

[0054] In a feasible implementation manner, in response to the write instruction of the backup file, the first target data in the second snapshot file is written to the backup file through the snapshot service process and according to the first target memory location and the memory bitmap, including: in response to the write instruction of the backup file, if the memory bitmap includes the first target memory location, obtaining the first target data corresponding to the first target memory location from the second snapshot file through the snapshot service process, and writing the first target data to the backup file.

[0055] In this embodiment, it is first determined whether the first target data is in the memory bitmap. If so, the first target data in the second snapshot file is written into the backup file through the snapshot service process. If not, the first target data in the second snapshot file needs to be verified to ensure the accuracy of the data backup.

[0056] Step S260: For the second target memory location in the target memory location that has no data updated after the snapshot is taken, in response to the write instruction, the second target data corresponding to the second target memory location in the data disk is written into the backup file through the snapshot service process, and the data disk is the data disk corresponding to the target virtual machine process.

[0057] Among them, data disk refers to virtual data disk, which is used to store data or instructions of operating system and application in virtual machine process for a long time, and can ensure that data can be retained even after the virtual machine is shut down or migrated.

[0058] In an embodiment of the present application, when there is no data update at the second target memory location after a snapshot is taken, it indicates that the second target memory location will not trigger write-time copy. At this time, in response to a write instruction, the data corresponding to the second target memory location in the data disk is written into a backup file to complete the data backup of the second target memory location.

[0059] In some implementations, for the second target memory location in the target memory location where no data is updated after the snapshot is taken, in response to the write instruction, the second target data corresponding to the second target memory location in the data disk is written into the backup file through the snapshot service process, and the data disk is the data disk corresponding to the target virtual machine process, including: for the second target memory location in the target memory location where no data is updated after the snapshot is taken, in response to the write instruction, a request for obtaining the second target data is sent to the shared memory through the snapshot service process, and the request for obtaining the second target data is used to request obtaining the second target data from the data disk corresponding to the target virtual machine process. The second target data obtained from the shared memory through the obtain request is written into the backup file through the snapshot service process.

[0060] In the embodiment of the present application, in response to a write instruction, a request to obtain the second target data is sent to the data disk through the shared memory, and the second target data obtained through the acquisition request is written into the shared memory, and then the second target data is written into the backup file from the shared memory through the snapshot service process. This avoids the target virtual machine process being affected by the data backup when it is working, and realizes the decoupling of the work of the target virtual machine process and the data backup.

[0061] The solution provided by this embodiment is that when the target virtual machine process receives a data backup instruction, the target virtual machine process first determines the target memory location where the data is updated in the virtual machine memory location, and then takes a snapshot of the current data in the target memory location to obtain a first snapshot file. When the first target memory location has new data after the snapshot is taken, write-time copy is triggered, and the old data of the first target memory location is written to the shared memory. The first target data in the shared memory is backed up by the snapshot service process. When the second target memory location has no new data after the snapshot is taken, a request to obtain the second target data is sent to the shared memory through the snapshot service to obtain the second target data from the data disk corresponding to the target virtual machine process, and the backup of the second target data is completed. This not only solves the impact of the coupling between the target virtual machine process and the data backup in the internal backup, but also solves the problem of the disk image format that is incompatible with the snapshot feature in the agentless backup. In addition, data backup is only performed on the memory location where the data is updated, thereby improving the efficiency of data backup.

[0062] Based on the above embodiments, please refer to Figure 3 , Figure 3 A data backup schematic diagram of a data backup method provided by an embodiment of the present application is shown. After responding to the data backup instruction of the target virtual machine process, a snapshot is taken of the target memory location where the current data in the virtual machine memory location corresponding to the target virtual machine process has data updates, and a first snapshot file is obtained. And a shared memory and a second snapshot file are created in response to the data backup instruction. When the target virtual machine process continues to work and writes new data to a certain target memory location, a write-time copy is triggered, and the data and the memory location map of the target memory location in the first snapshot file are stored in the shared memory, and the data in the shared memory is written into the second snapshot file. Moreover, the memory location map in the target virtual machine is switched to a blank memory location map to record the memory location where there is data update next time, so as to facilitate the next data backup. According to the data in the second snapshot file and the memory location map in the shared memory, the memory location of the data in the second snapshot file is determined, and then the memory bitmap corresponding to the data in the second snapshot file is determined. If a certain target memory location has not been written with new data after the snapshot is taken, at this time, the snapshot service process will send a data acquisition request to the data disk corresponding to the target virtual machine process through the shared memory to obtain the data corresponding to the target memory location, and then complete the data backup of the target memory location. Since the data backup instruction can be issued by a third-party terminal or the terminal where the target virtual machine is located, if the data backup instruction is issued by a third-party terminal, the data at the target memory location is written into the backup file through the third-party data backup process. If the data backup instruction is issued by the terminal where the target virtual machine process is located, the data at the target memory location is written into the backup file through the data backup process of the terminal to complete the data backup of the target virtual machine process. After the backup is completed, the shared memory and the second snapshot file will be deleted to save memory space. The target virtual machine process is decoupled from the data backup to avoid the impact of backup anomalies on the virtual machine process.

[0063] See also Figure 4 , which shows a structural block diagram of a data backup device provided by an embodiment of the present application. The data backup device 300 is applied to the electronic device 100, and the data backup device 300 includes: a target memory location determination module 310, which is used to determine the target memory location where data updates exist in the virtual machine memory location in response to a data backup instruction for the current data in the virtual machine memory location corresponding to the target virtual machine process; a first snapshot file acquisition module 320, which is used to take a snapshot of only the target data corresponding to the target memory location through the target virtual machine process to obtain a first snapshot file; a data backup module 330, which is used to perform data backup of the target data corresponding to the target memory location in the first snapshot file through a snapshot service process.

[0064] In some embodiments of the present application, the target memory location includes a first target memory location and a second target memory location, and the data backup module 330 includes: a shared memory write submodule, which is used to write the first target data corresponding to the first target memory location in the first snapshot file into the shared memory through the target virtual machine process for the first target memory location that has data updated after the snapshot is taken in the target memory location, and the shared memory is created in response to the data backup instruction; a first backup file write submodule, which is used to write the first target data in the shared memory into the backup file through the snapshot service process in response to the backup file write instruction; a second backup file write submodule, which is used to write the second target data corresponding to the second target memory location in the data disk into the backup file through the snapshot service process in response to the write instruction for the second target memory location that has no data updated after the snapshot is taken in the target memory location, and the data disk is the data disk corresponding to the target virtual machine process.

[0065] In some embodiments of the present application, the first backup file writing submodule includes: a second snapshot file writing unit, used to write the first target data in the shared memory into a second snapshot file through the snapshot service process, the second snapshot file being created in response to the data backup instruction; a memory bitmap determination unit, used to obtain the memory bitmap corresponding to the second snapshot file through the snapshot service process according to the memory position corresponding to the data in the second data file; the first backup file writing unit, used to write the first target data in the second snapshot file into the backup file through the snapshot service process and according to the first target memory position and the memory bitmap in response to the write instruction of the backup file.

[0066] In some embodiments of the present application, the first backup file writing unit includes: a first backup file writing sub-unit, which is used to obtain the first target data corresponding to the first target memory location from the second snapshot file through the snapshot service process if the memory bitmap includes the first target memory location, and write the first target data into the backup file.

[0067] In some embodiments of the present application, the second backup file writing submodule includes: an acquisition request sending unit, which is used to send an acquisition request for the second target data to the shared memory through the snapshot service process in response to the write instruction for the second target memory location in which no data has been updated after a snapshot is taken in the target memory location, and the acquisition request is used to request to obtain the second target data from the data disk corresponding to the target virtual machine process; and a second backup file writing unit, which is used to write the second target data obtained from the shared memory through the acquisition request into the backup file through the snapshot service process.

[0068] In some embodiments of the present application, the target memory location determination module 310 includes: a memory location map acquisition sub-module, which is used to respond to a data backup instruction for the current data in the virtual machine memory location corresponding to the target virtual machine process, and obtain the memory location map corresponding to the target virtual machine process at the current moment through the target virtual machine process; and a target memory location determination sub-module, which is used to determine the target memory location where data updates exist in the virtual machine memory location based on the memory location map.

[0069] In some embodiments of the present application, the target memory location determination module 310 also includes: a memory location map switching sub-module, which is used to switch the memory location map within the target virtual machine process to a blank memory location map through the target virtual machine process to record the memory location where data is updated after the data backup is completed.

[0070] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0071] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0072] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0073] A structural block diagram of an electronic device provided in an embodiment of the present application. Please refer to Figure 5, which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 can be an electronic device such as a computer, a server, etc. that can run an application. The electronic device 100 in the present application may include one or more of the following components: a processor 101, a memory 102, and one or more applications, wherein the one or more applications may be stored in the memory 102 and configured to be executed by one or more processors 101, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0074] The processor 101 may include one or more processing cores. The processor 101 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 101 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 101 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 101, but may be implemented separately through a communication chip.

[0075] The memory 102 may include a random access memory (RAM) or a read-only memory (ROM). The memory 102 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.

[0076] Please refer to Figure 6, which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable storage medium 200 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0077] The computer-readable storage medium 200 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 200 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 200 has storage space for program code 210 that performs any method steps of the above method. These program codes can be read from or written to one or more computer program products. The program code 210 can be compressed, for example, in an appropriate form.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data backup method, characterized in that: The method comprises: In response to a data backup instruction for current data in a virtual machine memory location corresponding to a target virtual machine process, determining a target memory location in the virtual machine memory location where data update exists; By using the target virtual machine process, only the target data corresponding to the target memory location is snapshotted to obtain a first snapshot file; The target data corresponding to the target memory location in the first snapshot file is backed up through the snapshot service process.

2. The method according to claim 1, characterized in that The target memory location includes a first target memory location and a second target memory location, and backing up the target data corresponding to the target memory location in the first snapshot file through the snapshot service process includes: For a first target memory location in the target memory location where data is updated after a snapshot is taken, writing, through the target virtual machine process, first target data corresponding to the first target memory location in the first snapshot file into a shared memory, where the shared memory is created in response to the data backup instruction; In response to a backup file write instruction, writing the first target data in the shared memory into the backup file through the snapshot service process; For the second target memory location in the target memory location where no data has been updated after the snapshot is taken, in response to the write instruction, the second target data corresponding to the second target memory location in the data disk is written into the backup file through the snapshot service process, and the data disk is the data disk corresponding to the target virtual machine process.

3. The method according to claim 2, characterized in that The step of responding to the backup file write instruction, writing the first target data in the shared memory into the backup file through the snapshot service process, comprises: Writing the first target data in the shared memory into a second snapshot file through the snapshot service process, where the second snapshot file is created in response to the data backup instruction; Obtaining, by the snapshot service process, a memory bitmap corresponding to the second snapshot file according to a memory location corresponding to the data in the second data file; In response to the backup file write instruction, the first target data in the second snapshot file is written into the backup file through the snapshot service process and according to the first target memory location and the memory bitmap.

4. The method according to claim 3, characterized in that The step of responding to the backup file write instruction, writing the first target data in the second snapshot file into the backup file through the snapshot service process and according to the first target memory location and the memory bitmap, comprises: If the memory bitmap includes the first target memory location, first target data corresponding to the first target memory location is obtained from the second snapshot file through the snapshot service process, and the first target data is written into the backup file.

5. The method according to claim 2, characterized in that: For the second target memory location where no data is updated after the snapshot is taken in the target memory location, in response to the write instruction, the second target data corresponding to the second target memory location in the data disk is written into the backup file through the snapshot service process, and the data disk is a data disk corresponding to the target virtual machine process, including: For a second target memory location in the target memory location where no data has been updated after a snapshot is taken, in response to the write instruction, a request for obtaining the second target data is sent to the shared memory through the snapshot service process, wherein the request for obtaining the second target data is used to request obtaining the second target data from a data disk corresponding to the target virtual machine process; The second target data obtained from the shared memory through the acquisition request is written into the backup file through the snapshot service process.

6. The method according to any one of claims 1 to 5, characterized in that: The step of determining a target memory location in the virtual machine memory location where data update exists in response to a data backup instruction for current data in the virtual machine memory location corresponding to the target virtual machine process comprises: In response to a data backup instruction for current data in a virtual machine memory location corresponding to a target virtual machine process, obtaining, through the target virtual machine process, a memory location map corresponding to the target virtual machine process at a current moment; Based on the memory location map, a target memory location where data update exists in the virtual machine memory location is determined.

7. The method according to claim 6, characterized in that After obtaining, through the target virtual machine process, a memory location map corresponding to the target virtual machine process at the current moment in response to the data backup instruction for the current data in the virtual machine memory location corresponding to the target virtual machine process, the method further includes: Through the target virtual machine process, the memory location map in the target virtual machine process is switched to a blank memory location map to record the memory location where data is updated after the data backup is completed.

8. A data backup device, characterized in that: The device comprises: a target memory location determination module, configured to determine a target memory location where data update exists in the virtual machine memory location in response to a data backup instruction for current data in the virtual machine memory location corresponding to the target virtual machine process; A first snapshot file acquisition module, configured to take a snapshot of only the target data corresponding to the target memory location through the target virtual machine process to obtain a first snapshot file; The data backup module is used to back up the target data corresponding to the target memory location in the first snapshot file through the snapshot service process.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.