Virtual machine file backup method and device, equipment, storage medium and program product

By running backup Agent in the file system layer of the virtual machine, capture the file change event and send file metadata and block data to the backup server, solve the problem of low efficiency of traditional virtual machine files and high resource occupation, and achieve efficient file backup backup process.

CN119356946APending Publication Date: 2025-01-24CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411640337.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When backing up files in a virtual machine, traditional methods require re-reading file data, resulting in low backup efficiency and high occupancy of virtual machine resources.

Method used

By running a lightweight backup Agent in the file system of the virtual machine, capture file change events and obtain file metadata, trigger the backup program to obtain the latest block data, and send metadata and block data to the backup server for backup.

Benefits of technology

The resource consumption sharing is realized, the occupation of virtual machine resources is reduced, and the efficiency of file backup is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356946A_ABST
    Figure CN119356946A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine file backup method and device, equipment, a storage medium and a program product. The method comprises the steps of obtaining first file metadata corresponding to a change event after the change event of a virtual machine file is detected based on a file system layer of a virtual machine; determining second file metadata of the file to be backed up according to the first file metadata, and adding the second file metadata to a virtual machine manager to trigger a backup program; under the condition of determining that the second file metadata indicates that the block data of the file to be backed up is changed based on the backup program, obtaining the latest changed block data in the file to be backed up; and sending the second file metadata and the block data to a backup server to indicate the backup server to back up the to-be-backed-up file based on the second file metadata and the block data. According to the method and the device, when the file of the virtual machine is backed up, occupation of resources of the virtual machine is reduced, and the file 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 cloud computing technology, and in particular to a virtual machine file backup method, device, equipment, storage medium and program product. Background Art

[0002] File backup can ensure the security and availability of key files when unexpected events occur. In cloud computing, file backup of virtual machines is required.

[0003] When backing up files on a virtual machine, traditional solutions generally use file event monitoring or file change log query methods to implement it. The problem with traditional solutions is that the file backup program works in the virtual machine operating system. When receiving a file write notification, it needs to re-read the file data from the disk and then copy it to other storage media. Therefore, the backup effect is low, and the entire backup process occupies a large amount of virtual machine resources.

[0004] Therefore, when backing up files of a virtual machine, how to reduce the occupation of virtual machine resources and improve the efficiency of file backup still needs to be solved. Summary of the invention

[0005] Based on this, it is necessary to provide a virtual machine file backup method, device, equipment, storage medium and program product that can reduce the occupancy of virtual machine resources and improve file backup efficiency when backing up files of the virtual machine in response to the above technical problems.

[0006] In a first aspect, a virtual machine file backup method is provided, the method comprising:

[0007] After detecting a change event of a virtual machine file based on the file system layer of the virtual machine, obtaining first file metadata corresponding to the change event;

[0008] Determine second file metadata of the file to be backed up according to the first file metadata, and trigger a backup program after adding the second file metadata to the virtual machine manager;

[0009] When it is determined based on the backup program that the second file metadata indicates that block data of the file to be backed up has changed, obtaining the block data of the file to be backed up that has changed the most recently;

[0010] The second file metadata and the block data are sent to a backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

[0011] In one embodiment, determining the second file metadata of the file to be backed up according to the first file metadata includes:

[0012] Acquire second file metadata that satisfies a preset file rule in the first file metadata; wherein the preset file rule is set based on at least one of a file name, a file size, or a file change time.

[0013] In one embodiment, the obtaining of first file metadata corresponding to the change event includes:

[0014] Determine a changed file in the virtual machine file according to the change event;

[0015] Obtaining third file metadata of the changed file;

[0016] The third file metadata is converted into first file metadata conforming to a preset format.

[0017] In one embodiment, before obtaining the block data that has changed most recently in the file to be backed up, the method further includes:

[0018] adding the block data to a virtual block device;

[0019] The obtaining of the block data that has been changed most recently in the file to be backed up includes:

[0020] Based on the backup program, the block data is read from the virtual block device.

[0021] In one embodiment, before sending the second file metadata and the block data to the backup server, the method further includes:

[0022] The second file metadata and the block data are stored.

[0023] In one embodiment, sending the second file metadata and the block data to the backup server includes:

[0024] The second file metadata and the block data are sent to the backup server in real time or periodically.

[0025] In a second aspect, a virtual machine file backup device is provided, the device comprising:

[0026] An acquisition module, configured to acquire first file metadata corresponding to a change event of a virtual machine file after a change event of the virtual machine file is detected based on the file system layer of the virtual machine;

[0027] A processing module, configured to determine second file metadata of a file to be backed up according to the first file metadata, and trigger a backup program after adding the second file metadata to the virtual machine manager;

[0028] The acquisition module is further configured to acquire the latest changed block data in the file to be backed up when it is determined based on the backup program that the second file metadata indicates that the block data of the file to be backed up has changed;

[0029] The communication module is used to send the second file metadata and the block data to the backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

[0030] According to a third aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.

[0031] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0032] In a fifth aspect, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0033] The above-mentioned virtual machine file backup method, device, equipment, storage medium and program product run a lightweight backup agent in the file system layer of the virtual machine. The backup agent sends the second file metadata to the backup program of the host machine when the virtual machine file changes. The backup program uses efficient block data backup to transfer block data to the backup service. The backup service rebuilds the file record in the file system of the backup server and writes the block data to the block device to achieve file backup. The method provided in this embodiment uses the method of separating the file metadata and block data and merging and rebuilding the file record to achieve resource consumption sharing. And the virtual machine file backup is achieved through block data backup, which improves the file backup efficiency and reduces the virtual machine resource occupation. Therefore, when backing up the files of the virtual machine, the method provided in this embodiment has the advantages of less virtual machine resource occupation and high file backup efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0035] Figure 1 A diagram of an application environment of a virtual machine file backup method in an embodiment;

[0036] Figure 2 A flowchart of a method for backing up virtual machine files in one embodiment;

[0037] Figure 3 A schematic diagram of virtual machine file backup in one embodiment;

[0038] Figure 4 Another schematic diagram of virtual machine file backup in another embodiment;

[0039] Figure 5 A structural block diagram of a virtual machine file backup device in an embodiment;

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

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

[0042] The virtual machine file backup method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0043] In an exemplary embodiment, Figure 2 As shown, a virtual machine file backup method is provided, and the method is applied to Figure 1 The terminal 102 or the server 104 in the example is used to illustrate, including the following steps 201 to 204. Among them:

[0044] Step 201: After a change event of a virtual machine file is detected based on the file system layer of the virtual machine, first file metadata corresponding to the change event is obtained.

[0045] Among them, a virtual machine is a software or hardware environment that simulates a complete computer system, including processors, memory, storage devices, and other peripherals. This simulated computer system is created on an existing computer (called a host) and allows multiple virtual machine instances to run on the host at the same time. A host is a physical computer or server that runs virtual machines in a virtualized environment. It is used to create and manage virtual machines and provide hardware resources such as computing, storage, and networking for virtual machines.

[0046] File-level backup is the process of copying files in a computer system to another location or storage medium to prevent the files from being lost, damaged, or inaccessible. File backup can ensure the security and availability of key file data when unexpected events (such as hard drive failure, virus infection, accidental deletion, etc.) occur.

[0047] File metadata refers to descriptive information related to a file, which describes the file's attributes and organizes the file's storage. File metadata information usually includes file name, file type, file size, creation time, modification time, access time, permissions and owner information, file pointer (or block number), and file status.

[0048] The operating system of the virtual machine includes an application layer, a file system layer, and a virtual device driver layer. In this embodiment, the backup agent is set at the file system layer. The backup agent is a component, also commonly referred to as a backup agent or a backup client, and is an important part of the backup software. It is responsible for communicating with the backup server during the backup process and performing data backup tasks according to the instructions of the backup software. The backup agent is usually installed on the computer or server where the data to be backed up is located, and it can capture and transmit data to the specified backup storage location.

[0049] The backup agent of this embodiment works at the file system layer and can be implemented as a cross-platform to support different virtual machine operating systems. The backup agent can be implemented at the VFS (Virtual File System) abstract layer to support different file systems.

[0050] See also Figure 3 The backup Agent provided in this embodiment mainly includes a file event monitoring module, a file metadata generation module, a file filtering module, and a file metadata sending module.

[0051] The file event monitoring module is responsible for capturing the file attribute modification, file content modification and other change events of the application program on the virtual machine file. Optionally, the file event monitoring module can use the file event monitoring hook interface provided by the operating system and file system running on the virtual machine to reduce the intrusive modification to the file system.

[0052] The file metadata generation module is responsible for generating the first file metadata corresponding to the change event.

[0053] Optionally, the file event monitoring module determines the changed file in the virtual machine file based on the change event. The file metadata generation module obtains the third file metadata of the changed file, and then converts the third file metadata into the first file metadata that conforms to a preset format. For example, the file metadata generation module reads the third file metadata corresponding to the change event in the virtual machine file system, and can also convert the read third file metadata into a unified and standardized (conforming to a preset format) file metadata to obtain the first file metadata. The conversion into a unified and standardized file metadata can support on-demand streamlining of the file metadata content and be independent of a specific file system. Optionally, the third file metadata can be read directly from the memory data structure cached by the file system.

[0054] Step 202: determining second file metadata of the file to be backed up according to the first file metadata, and adding the second file metadata to the virtual machine manager to trigger a backup program.

[0055] It is understandable that some data in the first file metadata may not meet the preset file rules, so it is necessary to filter these data that do not meet the preset file rules, and the second file metadata that meets the preset file rules is the file metadata of the file to be backed up.

[0056] Exemplarily, second file metadata satisfying a preset file rule is obtained from the first file metadata, wherein the preset file rule is set based on at least one of a file name, a file size, or a file change time.

[0057] The file filtering module filters the first file metadata according to the preset file rules, and the files that do not meet the preset file rules are directly ignored. The preset file rules can implement rich filtering conditions based on file metadata such as file name, file size, file time, etc. to meet the user's personalized file backup scenario. Optionally, the file filtering rules can support dynamic updates. Optionally, when filtering the first file metadata, filtering conditions such as exact matching, fuzzy matching, and range matching can be supported. Adding a file filtering module to the backup agent can support custom file backup conditions.

[0058] The file metadata sending module is responsible for transmitting the second file metadata of the file to be backed up to the backup program of the host machine. The data transmission method is not limited, and network communication, memory address mapping, etc. can be used. Optionally, only the file metadata in which the second file metadata has changed can be sent. The file metadata sending module can send the second file metadata in real time to achieve real-time file backup. Optionally, the file metadata sending module can also send periodically to achieve regular file backup. Optionally, when performing regular file backup, the file metadata of the same file can be sorted and merged, and only the latest sent file metadata is saved.

[0059] The backup program works on the host machine and runs in the kernel layer in the form of a kernel module. Figure 3 The backup program mainly includes a file metadata receiving module, a block data reading module, and a data sending module. Generally, only one instance of the backup program needs to be run, because it needs to process the file backup of all virtual machines on the host machine. Therefore, it is optional to run multiple instances and bind independent processors (Central Processing Unit, referred to as CPU) according to the business volume.

[0060] Step 203: when it is determined based on the backup program that the second file metadata indicates that the block data of the file to be backed up has changed, the block data of the file to be backed up that has changed the most recently is obtained.

[0061] The file metadata receiving module in the backup program is responsible for receiving the second file metadata sent by the backup Agent.

[0062] The block data reading module in the backup program is responsible for obtaining the block data that has changed most recently in the file to be backed up. The block data that has changed most recently in the file to be backed up is obtained only when it is determined that the second file metadata indicates that the block data of the file to be backed up has changed. Optionally, the block data reading module may read the block data that has changed most recently from the page cache of the operating system.

[0063] Step 204: Send the second file metadata and the block data to the backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

[0064] The data sending module in the backup program is responsible for sending the second file metadata and the block data of the file to be backed up to the backup service. Optionally, the second file metadata and the block data can be combined and transmitted according to the corresponding relationship. Optionally, by adding an association identifier, the second file metadata and the block data are transmitted using an independent channel.

[0065] The backup service works on the backup server used for file backup. It is a kernel module responsible for data storage and file metadata management of the files to be backed up. Figure 3 The backup program mainly includes a block data receiving module, a file record generation module, and a block data writing module. The backup server where the backup service is located is not restricted by form. It can be a real physical machine or a virtual machine. It can be on the same host machine as the backup virtual machine or on a different physical machine. The operating system and file system of the file backup server where the backup service is located are also not restricted.

[0066] The data receiving module in the backup service is responsible for receiving the second file metadata and the block data sent by the backup program. The data receiving method can be shared memory, direct network communication, or indirect import through other storage media according to the working environment of the backup server.

[0067] The file record generation module in the backup service is responsible for generating file records for the file system. File records (FileRecord) refer to the data structure used by the file system to manage and store metadata information about files. Data structures such as inode and dentry under Liunx enable the file system to correctly store, retrieve and process files. The file record generation module needs to convert the second file metadata to generate a file record that conforms to the file system of the local file backup server. The generation of file records is equivalent to writing files to the file system. Due to the use of standardized second file metadata, it can support the unified backup of files of different virtual machines and different operating systems to the same backup server.

[0068] The block data writing module in the backup service is responsible for writing the changed block data to the block device. The update of block data is written to the corresponding block device specified position according to the location information in the file record information. This operation is equivalent to the file system writing data to the block device. The block data written to the block device can be read through the file interface of the operating system. Optionally, it is possible to further read the file to be backed up through the file interface of the file system and restore the file to be backed up.

[0069] In the above-mentioned virtual machine file backup method, a lightweight backup agent is run in the file system layer of the virtual machine. When the virtual machine file changes, the backup agent sends the second file metadata to the backup program of the host machine. The backup program uses efficient block data backup to transfer the block data to the backup service. The backup service rebuilds the file record in the file system of the backup server and writes the block data to the block device to realize file backup. The method provided in this embodiment adopts the method of separating the file metadata and the block data and merging and rebuilding the file record to realize resource consumption sharing. And the virtual machine file backup is realized through the block data backup, which improves the file backup efficiency and reduces the virtual machine resource occupation. Therefore, when backing up the files of the virtual machine, the method provided in this embodiment has the advantages of less virtual machine resource occupation and high file backup efficiency.

[0070] In addition, the method provided in this embodiment adopts standardized (preset format) file metadata, which can support one backup file server to back up files from different file system sources.

[0071] In an exemplary embodiment, Figure 4 As shown, before step 203 obtains the block data with the latest changes in the file to be backed up, the virtual machine file backup method includes step 1. Among them:

[0072] Step 1: Add the block data to the virtual block device.

[0073] Step 203 of obtaining the block data with the latest changes in the file to be backed up includes: Step 2, based on the backup program, reading the block data from the virtual block device.

[0074] See also Figure 4 The schematic diagram of virtual machine file backup is shown in FIG. As can be seen from the figure, the file metadata of the virtual machine file is submitted to the virtual machine manager of the host machine through the file system layer and virtual device driver of the virtual machine. The block data of the virtual machine file is written to the virtual block device of the host machine. The backup agent captures the change event of the virtual machine file, extracts the second file metadata that meets the backup rule (i.e., the preset file rule), and sends it to the backup program of the host machine. The backup program reads the latest changed block data of the file from the virtual block device based on the second file metadata, and the backup program sends the second file metadata and block data to the backup service. The backup service regenerates the file record that conforms to the file system of the backup server based on the received second file metadata. The backup service updates the block data and writes it to the corresponding position of the virtual block device based on the location information in the file record. Other applications can read the files to be backed up through the file interface of the operating system.

[0075] In an exemplary embodiment, before step 204 sends the second file metadata and the block data to the backup server, the virtual machine file backup method further includes:

[0076] Step 1: store the second file metadata and the block data.

[0077] For example, when performing regular file backup, the second file metadata and the block data may be pre-stored and written into a log in advance for recovery and replay in case of an unexpected system crash.

[0078] In an exemplary embodiment, step 204 of sending the second file metadata and the block data to the backup server includes:

[0079] Step 1: Send the second file metadata and the block data to the backup server in real time or periodically.

[0080] Sending the second file metadata in real time is beneficial to real-time file backup and improves the efficiency of file backup. Sending the second file metadata and the block data regularly is used for regular file backup.

[0081] It should be understood that, although the steps in the flowcharts of the embodiments described above are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

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

[0083] In an exemplary embodiment, Figure 5 As shown, a virtual machine file backup device 50 is provided, comprising: an acquisition module 51, a processing module 52 and a communication module 53, wherein:

[0084] The acquisition module 51 is configured to acquire first file metadata corresponding to a change event of a virtual machine file after the file system layer of the virtual machine detects the change event of the virtual machine file.

[0085] The processing module 52 is used to determine the second file metadata of the file to be backed up according to the first file metadata, and to trigger the backup program after adding the second file metadata to the virtual machine manager.

[0086] The acquisition module 51 is further configured to acquire the latest changed block data in the file to be backed up when it is determined based on the backup program that the second file metadata indicates that the block data of the file to be backed up has changed.

[0087] The communication module 53 is used to send the second file metadata and the block data to the backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

[0088] The processing module 52 is used to obtain second file metadata that meets a preset file rule in the first file metadata; wherein the preset file rule is set based on at least one of a file name, a file size, or a file change time.

[0089] The acquisition module 51 is used to determine the changed file in the virtual machine file according to the change event; obtain the third file metadata of the changed file; and convert the third file metadata into the first file metadata conforming to a preset format.

[0090] The processing module 52 is further configured to add the block data to the virtual block device.

[0091] The acquisition module 51 is used to read the block data from the virtual block device based on the backup program.

[0092] The processing module 52 is used to store the second file metadata and the block data.

[0093] The communication module 51 is used to send the second file metadata and the block data to the backup server in real time or periodically.

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

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

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

[0097] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0098] After the file system layer based on the virtual machine detects a change event of the virtual machine file, obtaining first file metadata corresponding to the change event;

[0099] Determine second file metadata of the file to be backed up according to the first file metadata, and trigger a backup program after adding the second file metadata to the virtual machine manager;

[0100] When it is determined based on the backup program that the second file metadata indicates that block data of the file to be backed up has changed, obtaining the block data of the file to be backed up that has changed the most recently;

[0101] The second file metadata and the block data are sent to a backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

[0102] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0103] Second file metadata satisfying a preset file rule is obtained from the first file metadata; wherein the preset file rule is set based on at least one of a file name, a file size, or a file change time.

[0104] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0105] Determine a changed file in the virtual machine file according to the change event;

[0106] Obtaining third-party file metadata of the changed file;

[0107] The third file metadata is converted into first file metadata conforming to a preset format.

[0108] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0109] Add the block data to the virtual block device;

[0110] Based on the backup program, the block data is read from the virtual block device.

[0111] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0112] The second file metadata and the block data are stored.

[0113] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0114] The second file metadata and the block data are sent to the backup server in real time or periodically.

[0115] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0116] After the file system layer based on the virtual machine detects a change event of the virtual machine file, obtaining first file metadata corresponding to the change event;

[0117] Determine second file metadata of the file to be backed up according to the first file metadata, and trigger a backup program after adding the second file metadata to the virtual machine manager;

[0118] When it is determined based on the backup program that the second file metadata indicates that block data of the file to be backed up has changed, obtaining the block data of the file to be backed up that has changed the most recently;

[0119] The second file metadata and the block data are sent to a backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

[0120] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0121] Second file metadata satisfying a preset file rule is obtained from the first file metadata; wherein the preset file rule is set based on at least one of a file name, a file size, or a file change time.

[0122] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0123] Determine a changed file in the virtual machine file according to the change event;

[0124] Obtaining third-party file metadata of the changed file;

[0125] The third file metadata is converted into first file metadata conforming to a preset format.

[0126] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0127] Add the block data to the virtual block device;

[0128] Based on the backup program, the block data is read from the virtual block device.

[0129] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0130] The second file metadata and the block data are stored.

[0131] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0132] The second file metadata and the block data are sent to the backup server in real time or periodically.

[0133] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0134] After the file system layer based on the virtual machine detects a change event of the virtual machine file, obtaining first file metadata corresponding to the change event;

[0135] Determine second file metadata of the file to be backed up according to the first file metadata, and trigger a backup program after adding the second file metadata to the virtual machine manager;

[0136] When it is determined based on the backup program that the second file metadata indicates that block data of the file to be backed up has changed, obtaining the block data of the file to be backed up that has changed the most recently;

[0137] The second file metadata and the block data are sent to a backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

[0138] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0139] Second file metadata satisfying a preset file rule is obtained from the first file metadata; wherein the preset file rule is set based on at least one of a file name, a file size, or a file change time.

[0140] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0141] Determine a changed file in the virtual machine file according to the change event;

[0142] Obtaining third-party file metadata of the changed file;

[0143] The third file metadata is converted into first file metadata conforming to a preset format.

[0144] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0145] Add the block data to the virtual block device;

[0146] Based on the backup program, the block data is read from the virtual block device.

[0147] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0148] The second file metadata and the block data are stored.

[0149] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0150] The second file metadata and the block data are sent to the backup server in real time or periodically.

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

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

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

Claims

1. A virtual machine file backup method, characterized in that: The method comprises: After detecting a change event of a virtual machine file based on the file system layer of the virtual machine, obtaining first file metadata corresponding to the change event; Determine second file metadata of the file to be backed up according to the first file metadata, and trigger a backup program after adding the second file metadata to the virtual machine manager; When it is determined based on the backup program that the second file metadata indicates that block data of the file to be backed up has changed, obtaining the block data of the file to be backed up that has changed the most recently; The second file metadata and the block data are sent to a backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

2. The method according to claim 1, characterized in that The determining the second file metadata of the file to be backed up according to the first file metadata includes: Acquire second file metadata that satisfies a preset file rule in the first file metadata; wherein the preset file rule is set based on at least one of a file name, a file size, or a file change time.

3. The method according to claim 1, characterized in that The obtaining of first file metadata corresponding to the change event includes: Determine a changed file in the virtual machine file according to the change event; Obtaining third file metadata of the changed file; The third file metadata is converted into first file metadata conforming to a preset format.

4. The method according to claim 1, characterized in that: Before obtaining the block data that has changed most recently in the file to be backed up, the method further includes: adding the block data to a virtual block device; The obtaining of the block data that has been changed most recently in the file to be backed up includes: Based on the backup program, the block data is read from the virtual block device.

5. The method according to claim 1, characterized in that Before sending the second file metadata and the block data to the backup server, the method further includes: The second file metadata and the block data are stored.

6. The method according to claim 1, characterized in that The sending the second file metadata and the block data to the backup server comprises: The second file metadata and the block data are sent to the backup server in real time or periodically.

7. A virtual machine file backup device, characterized in that: The device comprises: An acquisition module, configured to acquire first file metadata corresponding to a change event of a virtual machine file after a change event of the virtual machine file is detected based on the file system layer of the virtual machine; A processing module, configured to determine second file metadata of a file to be backed up according to the first file metadata, and trigger a backup program after adding the second file metadata to the virtual machine manager; The acquisition module is further configured to acquire the latest changed block data in the file to be backed up when it is determined based on the backup program that the second file metadata indicates that the block data of the file to be backed up has changed; The communication module is used to send the second file metadata and the block data to the backup server to instruct the backup server to back up the file to be backed up based on the second file metadata and the block data.

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

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

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