Temporary resource processing method and device for virtual machine backup, equipment and medium

By identifying and systematically cleaning up the dependencies of temporary resources during virtual machine backup, the problem of incomplete cleaning of temporary resources in traditional technologies is solved, achieving complete resource cleaning and normal operation of the virtualization platform.

CN121579280APending Publication Date: 2026-02-27GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511760551.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In a virtualized environment, traditional technologies cannot completely clean up temporary resources generated during virtual machine backups, leading to wasted storage resources and impacting platform operation.

Method used

By identifying the dependencies between temporary resources during virtual machine backup, a resource dependency list is generated, and temporary resources are cleaned up in an orderly manner according to the list to ensure complete cleanup.

Benefits of technology

This achieved complete cleanup of temporary resources, avoiding resource waste and ensuring the normal operation of the virtualization platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579280A_ABST
    Figure CN121579280A_ABST
Patent Text Reader

Abstract

The invention relates to a temporary resource processing method and device for virtual machine backup, equipment and a medium, and the method comprises the steps: responding to a backup request for carrying out backup on at least one to-be-backed-up virtual machine, and generating a plurality of temporary resources corresponding to each to-be-backed-up virtual machine; for each virtual machine to be backed up, identifying a dependency relationship among the plurality of temporary resources, and generating a resource dependency list; and under the condition that the data backup of the current virtual machine to be backed up is completed, cleaning the plurality of temporary resources corresponding to the current virtual machine to be backed up according to the resource dependency list. According to the content, the dependency relationship among the plurality of temporary resources corresponding to each virtual machine to be backed up is identified, and each temporary resource is cleaned in order according to the dependency relationship, so that the situation that part of temporary resources cannot be cleaned all the time due to direct cleaning of each temporary resource is avoided, and complete cleaning of the temporary resources is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of virtual machine backup, in particular to a temporary resource processing method and device for virtual machine backup, a computer device and a computer readable storage medium. BACKGROUND

[0002] In a virtualization environment, virtual machine backup usually creates some temporary resources such as snapshots, temporary disk files, temporary mounting points, etc. on the virtualization platform. If these temporary resources are not cleaned up in time, long-term accumulation will cause waste of storage resources and affect the normal operation of the virtualization platform.

[0003] However, the temporary resource cleaning solution of the traditional technology cannot completely clean up the temporary resources, and there are still resource residues. SUMMARY

[0004] Therefore, it is necessary to provide a temporary resource processing method, device, computer device and computer readable storage medium for virtual machine backup, which can completely clean up temporary resources.

[0005] In a first aspect, the present application provides a temporary resource processing method for virtual machine backup, which comprises:

[0006] In response to a backup request for backup of at least one virtual machine to be backed up, a plurality of temporary resources corresponding to each virtual machine to be backed up are generated; the plurality of temporary resources are resources required for backup of the virtual machine to be backed up;

[0007] For each virtual machine to be backed up, a dependency relationship between the plurality of temporary resources is identified, and a resource dependency list is generated; the resource dependency list represents whether there is a dependency relationship between each temporary resource;

[0008] In the case where data backup of the current virtual machine to be backed up is completed, the plurality of temporary resources corresponding to the current virtual machine to be backed up are cleaned up according to the resource dependency list.

[0009] In one embodiment, cleaning up the plurality of temporary resources corresponding to the current virtual machine to be backed up according to the resource dependency list comprises:

[0010] For each temporary resource corresponding to the current virtual machine to be backed up, if the resource dependency list represents that there is a dependency relationship for the current temporary resource, a first temporary resource dependent on the current temporary resource is determined;

[0011] The first temporary resource is cleaned up, and after the first temporary resource is cleaned up, the current temporary resource is cleaned up.

[0012] In one embodiment, cleaning up the first temporary resource comprises:

[0013] In the case that the resource dependency list indicates that the first temporary resource does not have a dependency relationship, the first temporary resource is cleaned up.

[0014] In one of the embodiments, the cleaning up of the first temporary resource comprises:

[0015] In the case that the resource dependency list indicates that the first temporary resource has a dependency relationship, a second temporary resource dependent on the first temporary resource is determined;

[0016] The second temporary resource is cleaned up, and after the second temporary resource is cleaned up, the first temporary resource is cleaned up.

[0017] In one of the embodiments, the method further comprises:

[0018] A backup task to which the current to-be-backed-up virtual machine belongs is determined, the backup task is created based on a backup request and is used for backing up a plurality of to-be-backed-up virtual machines, and the current to-be-backed-up virtual machine is one of the plurality of to-be-backed-up virtual machines;

[0019] According to a backup state of the backup task, a plurality of temporary resources corresponding to each to-be-backed-up virtual machine under the backup task are cleaned up.

[0020] In one of the embodiments, the backup state comprises backup success, backup in progress, and backup failure, and according to the backup state of the backup task, the plurality of temporary resources corresponding to each to-be-backed-up virtual machine under the backup task are cleaned up, comprising:

[0021] In the case that the backup state of the backup task is backup success or backup failure, according to the resource dependency list, the plurality of temporary resources corresponding to each to-be-backed-up virtual machine under the backup task are cleaned up.

[0022] In one of the embodiments, in the case that the data backup of the current to-be-backed-up virtual machine is completed, before the step of cleaning up the plurality of temporary resources corresponding to the current to-be-backed-up virtual machine according to the resource dependency list, the method further comprises:

[0023] In the backup process of the current to-be-backed-up virtual machine, for each temporary resource corresponding to the current to-be-backed-up virtual machine, in the case that the current temporary resource is used and the resource dependency list indicates that the current temporary resource does not have a dependency relationship, the current temporary resource is cleaned up.

[0024] In a second aspect, the application further provides a temporary resource processing device for virtual machine backup, the device comprising:

[0025] The temporary resource generation module is configured to generate a plurality of temporary resources corresponding to each virtual machine to be backed up in response to a backup request for backing up the at least one virtual machine to be backed up, wherein the plurality of temporary resources are resources required for backing up the virtual machine to be backed up;

[0026] The resource dependency list generation module is configured to identify a dependency relationship between the plurality of temporary resources for each virtual machine to be backed up, and generate a resource dependency list, wherein the resource dependency list represents whether there is a dependency relationship between each temporary resource.

[0027] The temporary resource cleaning module is configured to clean the plurality of temporary resources corresponding to the current virtual machine to be backed up according to the resource dependency list when the data backup of the current virtual machine to be backed up is completed.

[0028] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the method steps of the first aspect when executing the computer program.

[0029] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method steps of the first aspect.

[0030] The temporary resource processing method, device, computer device and computer readable storage medium for virtual machine backup provided above, by generating a plurality of temporary resources corresponding to each virtual machine to be backed up in response to a backup request for backing up the at least one virtual machine to be backed up, wherein the plurality of temporary resources are resources required for backing up the virtual machine to be backed up, identifying a dependency relationship between the plurality of temporary resources for each virtual machine to be backed up, and generating a resource dependency list, wherein the resource dependency list represents whether there is a dependency relationship between each temporary resource, and cleaning the plurality of temporary resources corresponding to the current virtual machine to be backed up according to the resource dependency list when the data backup of the current virtual machine to be backed up is completed. According to the above content, by identifying the dependency relationship between the plurality of temporary resources corresponding to each virtual machine to be backed up, and sequentially cleaning each temporary resource according to the dependency relationship, direct cleaning of each temporary resource is avoided, which leads to that part of the temporary resources cannot be cleaned all the time, thereby realizing complete cleaning of the temporary resources. BRIEF DESCRIPTION OF DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor.

[0032] Figure 1 An application environment diagram of the temporary resource processing method for virtual machine backup in an embodiment;

[0033] Figure 2 A flowchart diagram of the temporary resource processing method for virtual machine backup in an embodiment;

[0034] Figure 3 A flowchart diagram of the virtual machine backup normally completed in an embodiment;

[0035] Figure 4 A flowchart diagram of the temporary resource processing method for virtual machine backup in an embodiment;

[0036] Figure 5 A structural block diagram of the temporary resource processing device for virtual machine backup in an embodiment;

[0037] Figure 6 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0039] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" used in the present application and any variations thereof are intended to cover non-exclusive inclusion. The term "a plurality of" used in the present application means two and more than two. The term "and / or" used in the present application means one of the solutions or any combination of a plurality of solutions.

[0040] The temporary resource processing method for virtual machine backup provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The terminal 102 generates a plurality of temporary resources corresponding to each virtual machine to be backed up in response to a backup request for backing up at least one virtual machine to be backed up; the plurality of temporary resources are resources required when backing up the virtual machine to be backed up; for each virtual machine to be backed up, identify the dependency relationship between the plurality of temporary resources, and generate a resource dependency list; the resource dependency list represents whether there is a dependency relationship between each temporary resource; in the case that the data backup of the current virtual machine to be backed up is completed, according to the resource dependency list, the plurality of temporary resources corresponding to the current virtual machine to be backed up are cleaned up. Among them, the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, unmanned aerial vehicles, low-altitude aircraft, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, 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 a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0041] In one embodiment, as Figure 2 shown, a temporary resource processing method for virtual machine backup is provided. The embodiment takes the terminal 102 in the method applied in Figure 1 as an example for illustration, and the method comprises the following steps:

[0042] Step S210, in response to a backup request for backing up at least one virtual machine to be backed up, a plurality of temporary resources corresponding to each virtual machine to be backed up are generated; the plurality of temporary resources are resources required when backing up the virtual machine to be backed up.

[0043] Among them, the backup software is deployed on the terminal. The backup software can backup the virtual machine deployed on the virtualization platform, and clean up the temporary resources generated in the backup process.

[0044] The temporary resources include, but are not limited to, a snapshot, a snapshot disk corresponding to the snapshot, a temporary disk file, and a temporary mounting point. The snapshot refers to a state record of the virtual machine at a certain time, the snapshot disk refers to a data copy of the virtual machine disk at the time of creating the snapshot, the temporary disk file refers to a file recording all modifications of the virtual machine disk since the snapshot is created, and the temporary mounting point refers to an entrance for accessing disk data of the virtual machine.

[0045] In the embodiment of the present application, a plurality of virtual machines are deployed on the virtualization platform, and the terminal can generate a backup request and send the backup request to the virtualization platform, so as to generate a plurality of temporary resources corresponding to the to-be-backed-up virtual machine on the virtualization platform. The backup request includes the device identifier of the to-be-backed-up virtual machine.

[0046] In step S220, for each to-be-backed-up virtual machine, a dependency relationship between the plurality of temporary resources is identified, and a resource dependency list is generated. The resource dependency list represents whether there is a dependency relationship between each temporary resource.

[0047] In the embodiment of the present application, when the plurality of temporary resources corresponding to each to-be-backed-up virtual machine are generated, some temporary resources are independent, and some temporary resources are dependent on each other. For example, after the virtualization platform creates a snapshot disk, link information also needs to be generated. The terminal obtains the snapshot disk from the virtualization platform by returning the link information to the terminal, and backs up the snapshot disk into a target file on the terminal side. The snapshot disk and the link information have a dependency relationship.

[0048] For each temporary resource, whether there is a dependency relationship is marked. The resource identifier of each temporary resource is generated, and the resource dependency list is generated according to the resource identifier of each temporary resource in combination with the dependency relationship. The resource identifier is used to uniquely mark each temporary resource.

[0049] In step S230, in the case that the data backup of the current to-be-backed-up virtual machine is completed, the plurality of temporary resources corresponding to the current to-be-backed-up virtual machine are cleaned up according to the resource dependency list.

[0050] The current to-be-backed-up virtual machine is any one of the plurality of to-be-backed-up virtual machines.

[0051] In the embodiment of the present application, in the case that the data backup of the current to-be-backed-up virtual machine is completed, the plurality of temporary resources corresponding to the current to-be-backed-up virtual machine need to be cleaned up.

[0052] Specifically, according to the resource identifier of each temporary resource corresponding to the current to-be-backed-up virtual machine, the dependency relationship of each temporary resource is obtained from the resource dependency list, and the plurality of temporary resources corresponding to the current to-be-backed-up virtual machine are cleaned up in order according to the dependency relationship.

[0053] The aforementioned method for handling temporary resources during virtual machine backup involves generating multiple temporary resources corresponding to each virtual machine in response to a backup request for at least one virtual machine to be backed up. These temporary resources are the resources required for backing up the virtual machines. For each virtual machine to be backed up, the dependencies between these temporary resources are identified, generating a resource dependency list. This resource dependency list indicates whether dependencies exist between the temporary resources. Once the data backup of the current virtual machine is complete, the temporary resources corresponding to that virtual machine are cleaned up according to the resource dependency list. As can be seen from the above, by identifying the dependencies between the temporary resources corresponding to each virtual machine to be backed up and cleaning up each temporary resource in an orderly manner according to these dependencies, the method avoids directly cleaning up each temporary resource, which could result in some temporary resources remaining unremoved, thus achieving complete cleanup of temporary resources.

[0054] In one embodiment, before the step of cleaning up multiple temporary resources corresponding to the virtual machine to be backed up according to the resource dependency list after the data backup of the current virtual machine to be backed up has been completed, the method further includes:

[0055] Step S240: During the backup process of the virtual machine to be backed up, for each temporary resource corresponding to the virtual machine to be backed up, after the temporary resource has been used and the resource dependency list indicates that there is no dependency relationship between the temporary resource and the temporary resource, the temporary resource is cleaned up.

[0056] In this embodiment, during the backup process of the virtual machine to be backed up, after using the current temporary resource, if the current temporary resource is not depended upon by other temporary resources, the current temporary resource is directly cleaned up. If the current temporary resource is depended upon by other temporary resources, it needs to be cleaned up after the backup is completed.

[0057] This application embodiment can minimize resource storage space by promptly cleaning up temporary resources with no dependencies during the backup process.

[0058] In one embodiment, based on a resource dependency list, multiple temporary resources corresponding to the virtual machine currently being backed up are cleaned up, including:

[0059] Step S232: For each temporary resource corresponding to the virtual machine to be backed up, if the resource dependency list indicates that there is a dependency relationship between the current temporary resources, determine the first temporary resource that depends on the current temporary resources.

[0060] The first temporary resource is one or more of a plurality of temporary resources, and the first temporary resource is different from the current temporary resource.

[0061] In the embodiment of the present application, the resource dependency list stores resource identifiers of each temporary resource and dependency relationships between each temporary resource. According to the resource identifier of the current temporary resource, the resource identifier of the first temporary resource having a dependency relationship can be found from the resource dependency list. According to the resource identifier of the first temporary resource, the first temporary resource dependent on the current temporary resource can be determined.

[0062] In step S234, the first temporary resource is cleaned up; and after the first temporary resource is cleaned up, the current temporary resource is cleaned up.

[0063] In the embodiment of the present application, since the current temporary resource is dependent on the first temporary resource, the first temporary resource is cleaned up first, and then the current temporary resource is cleaned up. This cleaning sequence can ensure that the first temporary resource and the current temporary resource can be completely cleaned up.

[0064] In one embodiment, cleaning up the first temporary resource includes:

[0065] In step S2342, the first temporary resource is cleaned up in a case where the resource dependency list indicates that the first temporary resource has no dependency relationship.

[0066] In the embodiment of the present application, when the first temporary resource is cleaned up, whether there is a dependency relationship is found from the resource dependency list according to the resource identifier of the first temporary resource. If there is no dependency relationship, the first temporary resource is cleaned up.

[0067] In one embodiment, cleaning up the first temporary resource includes:

[0068] In step S2344, a second temporary resource dependent on the first temporary resource is determined in a case where the resource dependency list indicates that the first temporary resource has a dependency relationship.

[0069] The second temporary resource is one or more of the plurality of temporary resources, and the second temporary resource is different from the first temporary resource.

[0070] In the embodiment of the present application, according to the resource identifier of the first temporary resource, the resource identifier of the second temporary resource having a dependency relationship can be found from the resource dependency list. According to the resource identifier of the second temporary resource, the second temporary resource dependent on the first temporary resource can be determined.

[0071] In step S2346, the second temporary resource is cleaned up; and after the second temporary resource is cleaned up, the first temporary resource is cleaned up.

[0072] In the embodiment of the present application, since the first temporary resource is dependent on the second temporary resource, the second temporary resource is cleaned first and then the first temporary resource is cleaned, and such cleaning sequence can ensure that the second temporary resource and the first temporary resource can be completely cleaned.

[0073] For the convenience of understanding the above embodiment, as shown in the flowchart of FIG. 1, the method for cleaning temporary resources is as follows. Figure 3 Specifically, a virtual machine (VM) backup task is started, temporary resources (such as snapshots, temporary disks, etc.) required for backup are created, it is judged whether the temporary resources are created successfully, if not, the backup task is terminated; if yes, the temporary resources are marked with a dependency relationship, the Job to which the temporary resources belong is determined, the resource identifier, the dependency relationship, and the Job to which the temporary resources belong are written into a database table, and the temporary resources are used for backup operation. It is judged whether the temporary resources can be cleaned immediately, if yes, the cleaning is performed in the granularity of a single resource; if not, the backup task is waited to be completed, and the temporary resources are cleaned in the granularity of a VM. When the backup task is completed, the temporary resources to be cleaned are acquired in the granularity of a VM, the dependency relationship of each temporary resource is detected, a correct cleaning sequence is constructed, and each temporary resource is cleaned according to the cleaning sequence.

[0074] In one embodiment, the method further comprises:

[0075] In step S250, the backup task to which the current virtual machine to be backed up belongs is determined; the backup task is created based on a backup request and is used for backing up a plurality of virtual machines to be backed up, and the current virtual machine to be backed up is one of the plurality of virtual machines to be backed up.

[0076] Considering that after the backup of a single virtual machine to be backed up is completed, the corresponding plurality of temporary resources are cleaned, the plurality of temporary resources may fail to be cleaned due to abnormal exit of a terminal. Or, during the backup of a single virtual machine to be backed up, the terminal abnormally exits, resulting in failure of cleaning of the plurality of temporary resources. In view of the above situation, the plurality of virtual machines to be backed up under the backup task can be cleaned in batches from the granularity of the backup task, so as to achieve bottom-up cleaning of the resources until the temporary resources corresponding to each virtual machine to be backed up are cleaned successfully.

[0077] In the embodiment of the present application, the number of virtual machines to be backed up can be multiple, and one or more backup tasks can be created when the plurality of virtual machines to be backed up are backed up. If one backup task is created, the backup task is used for backing up all the virtual machines to be backed up. If a plurality of backup tasks are created, each backup task is used for backing up one or more virtual machines to be backed up, and the sum of the virtual machines to be backed up under all the backup tasks is all the virtual machines to be backed up.

[0078] Therefore, one backup task corresponds to each virtual machine to be backed up, and a mapping relationship between the device identifier of the virtual machine to be backed up and the task identifier of the backup task can be established. According to the mapping relationship, the backup task to which each virtual machine to be backed up belongs can be determined.

[0079] In step S260, according to the backup state of the backup task, the plurality of temporary resources corresponding to each virtual machine to be backed up under the backup task are cleaned up.

[0080] The backup state of the backup task is determined according to the backup state of each virtual machine to be backed up under the backup task. When each virtual machine to be backed up is backed up successfully, the backup state is determined as backup success. When at least one virtual machine to be backed up fails to be backed up, the backup state is determined as backup failure. When each virtual machine to be backed up is being backed up, or part of the virtual machines to be backed up are being backed up and part of the virtual machines to be backed up have been backed up, the backup state is determined as being backed up.

[0081] In the embodiment of the present application, when the backup state of the backup task is backup success or backup failure, the plurality of temporary resources corresponding to each virtual machine to be backed up under the backup task are cleaned up in batches.

[0082] Optionally, a timer can be used to periodically poll the backup state of the backup task, so as to clean up the temporary resources in batches at a fixed time.

[0083] In one embodiment, the backup state includes backup success, being backed up, and backup failure; according to the backup state of the backup task, the plurality of temporary resources corresponding to each virtual machine to be backed up under the backup task are cleaned up, including:

[0084] In step S262, when the backup state of the backup task is backup success or backup failure, according to the resource dependency list, the plurality of temporary resources corresponding to each virtual machine to be backed up under the backup task are cleaned up.

[0085] In the embodiment of the present application, when the plurality of temporary resources corresponding to each virtual machine to be backed up under the backup task are cleaned up, the foregoing steps S232-S234 can be referred to, which will not be described here.

[0086] In order to facilitate the understanding of the foregoing steps S250-S260 and S262, as shown in FIG. 8, specifically, the timer triggers, the state of each backup task (Job) is acquired at a fixed time, the cleanable Job list is acquired according to the Job state, all temporary resources under the Job are acquired according to the Job granularity, the dependency relationship of the temporary resources is checked, the correct cleaning order is constructed, and each temporary resource is cleaned up according to the cleaning order. Figure 4

[0087] ​It should be understood that although each step in the flowchart involved in the above embodiments is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.

[0088] Based on the same inventive concept, the embodiments of the present application also provide a virtual machine backup temporary resource processing device for implementing the above-mentioned virtual machine backup temporary resource processing method. The problem-solving implementation scheme provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more virtual machine backup temporary resource processing device embodiments provided below can refer to the limitations of the large model inference request processing method in the above text, which will not be repeated here.

[0089] In one exemplary embodiment, as shown in Figure 5 A virtual machine backup temporary resource processing device is provided, and the device comprises:

[0090] The temporary resource generation module 510 is configured to generate a plurality of temporary resources corresponding to each to-be-backed-up virtual machine in response to a backup request for backing up at least one to-be-backed-up virtual machine. The plurality of temporary resources are resources required for backing up the to-be-backed-up virtual machine.

[0091] The resource dependency list generation module 520 is configured to identify a dependency relationship between the plurality of temporary resources for each to-be-backed-up virtual machine, and generate a resource dependency list. The resource dependency list represents whether there is a dependency relationship between each temporary resource.

[0092] The temporary resource cleaning module 530 is configured to clean the plurality of temporary resources corresponding to the current to-be-backed-up virtual machine according to the resource dependency list when the data backup of the current to-be-backed-up virtual machine is completed.

[0093] In one embodiment, cleaning the plurality of temporary resources corresponding to the current to-be-backed-up virtual machine according to the resource dependency list comprises:

[0094] In a case where the resource dependency list indicates that the first temporary resource has a dependency relationship, determining a second temporary resource that depends on the first temporary resource;

[0095] cleaning up the first temporary resource; and cleaning up the current temporary resource after the first temporary resource is cleaned up.

[0096] In one of the embodiments, cleaning up the first temporary resource includes:

[0097] In a case where the resource dependency list indicates that the first temporary resource has no dependency relationship, cleaning up the first temporary resource.

[0098] In one of the embodiments, cleaning up the first temporary resource includes:

[0099] In a case where the resource dependency list indicates that the first temporary resource has a dependency relationship, determining a second temporary resource that depends on the first temporary resource;

[0100] cleaning up the second temporary resource; and cleaning up the first temporary resource after the second temporary resource is cleaned up.

[0101] In one of the embodiments, the method further includes:

[0102] determining a backup task to which the current virtual machine to be backed up belongs; the backup task is created based on a backup request and is used to backup a plurality of virtual machines to be backed up, and the current virtual machine to be backed up is one of the plurality of virtual machines to be backed up;

[0103] cleaning up, according to a backup state of the backup task, a plurality of temporary resources corresponding to each of the virtual machines to be backed up under the backup task.

[0104] In one of the embodiments, the backup state includes backup success, backup in progress, and backup failure; and cleaning up, according to the backup state of the backup task, the plurality of temporary resources corresponding to each of the virtual machines to be backed up under the backup task includes:

[0105] In a case where the backup state of the backup task is backup success or backup failure, cleaning up, according to the resource dependency list, the plurality of temporary resources corresponding to each of the virtual machines to be backed up under the backup task.

[0106] In one of the embodiments, in a case where data backup of the current virtual machine to be backed up is completed, before the step of cleaning up, according to the resource dependency list, the plurality of temporary resources corresponding to the current virtual machine to be backed up, the method further includes:

[0107] In the backup process of the current virtual machine to be backed up, for each temporary resource corresponding to the current virtual machine to be backed up, the current temporary resource is cleaned up after the current temporary resource is used and the resource dependency list indicates that the current temporary resource has no dependency relationship.

[0108] The temporary resource processing apparatus for virtual machine backup generates a plurality of temporary resources corresponding to each virtual machine to be backed up in response to a backup request for backing up at least one virtual machine to be backed up; the plurality of temporary resources are resources needed when backing up the virtual machine to be backed up; for each virtual machine to be backed up, a dependency relationship between the plurality of temporary resources is identified, and a resource dependency list is generated; the resource dependency list indicates whether there is a dependency relationship between each temporary resource; in the case that the data backup of the current virtual machine to be backed up is completed, the plurality of temporary resources corresponding to the current virtual machine to be backed up are cleaned up according to the resource dependency list. According to the above content, by identifying the dependency relationship between the plurality of temporary resources corresponding to each virtual machine to be backed up, each temporary resource is sequentially cleaned up according to the dependency relationship, which avoids directly cleaning up each temporary resource, resulting in that part of the temporary resources cannot be cleaned up, thereby realizing complete cleaning of the temporary resources.

[0109] Each module in the temporary resource processing apparatus for virtual machine backup can be implemented by software, hardware, and combinations thereof, in whole or in part. Each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.

[0110] In one exemplary embodiment, a computer device is provided, which can be a server, and its internal structure diagram can be as shown in Figure 6As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores temporary resource processing data for virtual machine backups. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a temporary resource processing method for virtual machine backups.

[0111] Those skilled in the art will understand that Figure 6 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the aforementioned temporary resource processing method for large virtual machine backup. The steps of the temporary resource processing method for virtual machine backup here may be steps from the temporary resource processing method for virtual machine backup in the various embodiments described above.

[0112] In one embodiment, a computer-readable storage medium is provided, storing a computer program that, when executed by a processor, causes the processor to perform the steps of the temporary resource processing method for virtual machine backup described above. The steps of the temporary resource processing method for virtual machine backup here may be steps from the temporary resource processing method for virtual machine backup in the various embodiments described above.

[0113] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, causes the processor to perform the steps of the temporary resource processing method for virtual machine backup described above. The steps of the temporary resource processing method for virtual machine backup here may be steps from the temporary resource processing method for virtual machine backup described in the various embodiments above.

[0114] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0115] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. Any reference to memory, database or other medium used in each embodiment provided by 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), magnetoresistive 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 but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in each embodiment provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in each embodiment provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0116] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of these technical features is deemed to be within the scope of the present application.

[0117] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons 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 should be subject to the appended claims.

Claims

1. A method for handling temporary resources during virtual machine backup, characterized in that, The method includes: In response to a backup request to back up at least one virtual machine to be backed up, multiple temporary resources are generated for each of the virtual machines to be backed up; the multiple temporary resources are resources required to back up the virtual machines to be backed up. For each virtual machine to be backed up, the dependencies between the multiple temporary resources are identified, and a resource dependency list is generated; the resource dependency list indicates whether there are dependencies between the temporary resources. Once the data backup of the virtual machine to be backed up is complete, multiple temporary resources corresponding to the virtual machine to be backed up are cleaned up according to the resource dependency list.

2. The method according to claim 1, characterized in that, The step of cleaning up multiple temporary resources corresponding to the currently backed-up virtual machine according to the resource dependency list includes: For each temporary resource corresponding to the virtual machine to be backed up, if the resource dependency list indicates that there is a dependency relationship between the current temporary resources, the first temporary resource that depends on the current temporary resource is determined. The first temporary resource is cleaned up; after the first temporary resource is cleaned up, the current temporary resource is cleaned up.

3. The method according to claim 2, characterized in that, The cleanup of the first temporary resource includes: If the resource dependency list indicates that the first temporary resource has no dependencies, the first temporary resource is cleaned up.

4. The method according to claim 2, characterized in that, The cleanup of the first temporary resource includes: If the resource dependency list indicates that the first temporary resource has a dependency relationship, then determine the second temporary resource that depends on the first temporary resource; Clean up the second temporary resource; after cleaning up the second temporary resource, clean up the first temporary resource.

5. The method according to claim 1, characterized in that, The method further includes: Determine the backup task to which the currently backed-up virtual machine belongs; the backup task is created based on the backup request and is used to back up multiple virtual machines to be backed up, and the currently backed-up virtual machine is one of the multiple virtual machines to be backed up; Based on the backup status of the backup task, clean up multiple temporary resources corresponding to each virtual machine to be backed up under the backup task.

6. The method according to claim 5, characterized in that, The backup status includes backup successful, backup in progress, and backup failed; The step of cleaning up multiple temporary resources corresponding to each virtual machine to be backed up under the backup task according to the backup status of the backup task includes: If the backup status of the backup task is either "backup successful" or "backup failed", then according to the resource dependency list, multiple temporary resources corresponding to each virtual machine to be backed up under the backup task are cleaned up.

7. The method according to any one of claims 1 to 6, characterized in that, Before the step of cleaning up multiple temporary resources corresponding to the current virtual machine to be backed up according to the resource dependency list after the data backup of the current virtual machine to be backed up is completed, the method further includes: During the backup process of the virtual machine to be backed up, for each temporary resource corresponding to the virtual machine to be backed up, after the temporary resource has been used and the resource dependency list indicates that the temporary resource has no dependency relationship, the temporary resource is cleaned up.

8. A temporary resource processing device for virtual machine backup, characterized in that, The device includes: A temporary resource generation module is used to generate multiple temporary resources corresponding to each virtual machine to be backed up in response to a backup request for backing up at least one virtual machine to be backed up; the multiple temporary resources are resources required when backing up the virtual machines to be backed up. The resource dependency list generation module is used to identify the dependencies between the multiple temporary resources for each of the virtual machines to be backed up, and generate a resource dependency list; the resource dependency list indicates whether there are dependencies between the temporary resources. The temporary resource cleanup module is used to clean up multiple temporary resources corresponding to the virtual machine to be backed up, based on the resource dependency list, after the data backup of the virtual machine to be backed up has been completed.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Recursive-based resource cleaning method and device

    CN109471729A

  • Virtual machine backup method and backup virtual machine recovery method

    CN111143133A