Method, device, equipment and storage medium for secure deletion of virtual machine image files

By splitting the virtual machine image files into data blocks and sorting and deleting them, the problem of slow virtual machine data security deletion is solved, efficient data destruction and resource release are achieved, and data security is improved.

CN113986471BActive Publication Date: 2024-11-22BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111325946.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-10
Publication Date
2024-11-22
Estimated Expiration
2041-11-10

AI Technical Summary

Technical Problem

The existing virtual machine data security deletion method has the problem of slow deletion speed, especially in distributed storage systems, where data copies are many and distributed in multiple data centers or clouds, and data needs to be completely destroyed to prevent recovery.

Method used

By splitting the virtual machine image files to be deleted into multiple data blocks, sorting them to form a data queue, and performing safe deletion operations based on the arrangement order, reducing the number of disk searches, and supporting demapping or overwriting files to achieve efficient deletion.

Benefits of technology

It improves the safe deletion speed of virtual machine files, reduces disk search time, ensures complete destruction of data and timely release of system resources, and enhances data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986471B_ABST
    Figure CN113986471B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for secure deletion of virtual machine image files. The method for secure deletion of virtual machine image files includes: when receiving a request for secure deletion of a virtual image file for a virtual machine, obtaining file information of the image file to be deleted of the virtual machine, the file information of the image file to be deleted includes disk area information of the image file to be deleted; determining the disk position of the data block of each image file to be deleted according to the disk area information of each image file to be deleted, wherein the image file to be deleted includes two or more data blocks; sorting the two or more data blocks according to the disk position of each data block and forming a data queue; and performing secure deletion operations on all data blocks in sequence based on the arrangement order of the data blocks in the data queue. The present application can at least improve the speed of secure deletion of files of virtual machines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for securely deleting virtual machine image files. Background Art

[0002] In existing hyper-converged systems, most virtual machine disk data is stored in distributed storage systems. Distributed storage systems improve virtual machine availability and reliability, allowing virtual machines to be started on different machines. However, the separation of computing and storage also poses a huge challenge to data security. Distributed storage system data has multiple copies and may exist in multiple data centers or on the cloud, which places higher requirements on data security than ordinary physical servers. Some data-sensitive virtual machines also require that when the virtual machine is deleted or files are deleted in the virtual machine, the data must be completely destroyed to ensure that the data cannot be recovered through task tools.

[0003] Currently, a method for securely deleting data on a virtual machine can completely delete the data on the virtual machine, but the existing secure deletion method has the disadvantage of a slow deletion speed. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, apparatus, device and storage medium for securely deleting virtual machine image files, so as to at least increase the speed of securely deleting files of the virtual machine.

[0005] To this end, the first aspect of the present application discloses a method for securely deleting a virtual machine image file, the method comprising:

[0006] When a virtual image file security deletion request for a virtual machine is received, file information of the image file to be deleted of the virtual machine is obtained, where the file information of the image file to be deleted includes disk area information of the image file to be deleted;

[0007] Determining the disk location of the data block of each of the to-be-deleted image files according to the disk area information of each of the to-be-deleted image files, wherein the to-be-deleted image files include two or more of the data blocks;

[0008] Sort two or more data blocks according to the disk location of each data block and form a data queue;

[0009] The secure deletion operation is performed on all the data blocks in sequence based on the arrangement order of the data blocks in the data queue.

[0010] In the present application, by splitting the image file to be deleted into multiple data blocks, the multiple data blocks can be sorted when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek multiple times in the disk to find the data blocks to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of the virtual image file.

[0011] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks.

[0012] In the first aspect of the present application, as an optional implementation, the sequentially performing a secure deletion operation on the data blocks based on the arrangement order of the data blocks in the data queue includes:

[0013] Determine whether the installation host of the virtual machine supports the demapping command. If the installation host of the virtual machine supports the demapping command, erase the data of all the data blocks in sequence based on the arrangement order of the data blocks in the data queue and calling the demapping command.

[0014] In this optional implementation, by judging whether the host on which the virtual machine is installed supports the demapping command, the data of all data blocks can be erased in sequence based on the arrangement order of the data blocks in the data queue and the call of the demapping command. At present, the host machines of some virtual machines support the demapping command, while the host machines of some virtual machines do not support the demapping command. Therefore, the host machine can be adapted by judging. At the same time, the demapping command is used to implement safe deletion on the host machine that supports the demapping command, which has a lower operation time consumption than the safe deletion method of data overwriting.

[0015] In the first aspect of the present application, as an optional implementation, the sequentially performing a secure deletion operation on the data blocks based on the arrangement order of the data blocks in the data queue includes:

[0016] When the installation host of the virtual machine does not support the demapping command, the overwrite file is called, and the data of all the data blocks are overwritten in sequence based on the arrangement order of the data blocks in the data queue and the calling of the overwrite file.

[0017] In the first aspect of the present application, as an optional implementation, the method further includes:

[0018] Whenever the data of a data block is erased or overwritten, the reference relationship of the current data block is deleted to release the storage resources of the current data block.

[0019] In this optional implementation, by deleting the reference relationship of the current data block, the system resources occupied by the data block can be released in time, thereby making room for the system to run other tasks.

[0020] In the first aspect of the present application, as an optional implementation, before executing the safe deletion command for the image file to be deleted of the virtual machine, the method further includes:

[0021] Determine whether the image file deletion request of the virtual machine is to delete the image files of at least two virtual machines, and if so, read the security deletion priority of at least two virtual machines, wherein the security deletion priority of each virtual machine is preset when the virtual machine is installed;

[0022] forming a processing queue based on the security deletion priorities of at least two of the virtual machines, wherein the priority levels of the two processing queues are different and the security deletion priorities of the virtual machines in each processing queue are the same;

[0023] And, executing a safe deletion command for the image file to be deleted of the virtual machine includes:

[0024] According to the priority level of the processing queue, the safe deletion command of the to-be-deleted image file of each virtual machine is executed in sequence.

[0025] This optional implementation method can ensure that virtual machines with high confidentiality are deleted first by deleting virtual machines with high priority, thereby shortening the exposure time of highly confidential data, thereby improving data security. In particular, under the premise that the write bandwidth of the disk is prioritized and the secure deletion operation itself is time-consuming, if the secure deletion operation is not performed according to the priority of the virtual machine, then the secure deletion of virtual machines with low confidentiality importance will take a long time, making it impossible to delete virtual machines with high confidentiality importance for a long time, thereby prolonging the exposure time of highly confidential data, thereby increasing the risk of data leakage.

[0026] In the first aspect of the present application, as an optional implementation, the method further includes:

[0027] During the process of executing the safe deletion command of the image file to be deleted for the virtual machine, it is determined whether there is a processing queue with a higher priority than the current processing queue. If so, the safe deletion of the current processing queue is suspended, and the safe deletion command of the image file to be deleted for the virtual machine in the processing queue with a higher priority than the current processing queue is executed.

[0028] In the first aspect of the present application, as an optional implementation, the data queue is an asynchronous deletion queue.

[0029] A second aspect of the present application discloses a device for securely deleting a virtual machine image file, the device comprising:

[0030] A response module, configured to, when receiving a virtual image file security deletion request for a virtual machine, obtain file information of the image file to be deleted of the virtual machine, wherein the file information of the image file to be deleted includes disk area information of the image file to be deleted;

[0031] A determination module, used to determine the disk location of the data block of each of the to-be-deleted image files according to the disk area information of each of the to-be-deleted image files, wherein the to-be-deleted image files include two or more of the data blocks;

[0032] A sorting module, used for sorting two or more data blocks according to the disk position of each data block and forming a data queue;

[0033] The safe deletion module is used to perform safe deletion operations on all the data blocks in sequence based on the arrangement order of the data blocks in the data queue.

[0034] The device of the present application can split the image file to be deleted into multiple data blocks by executing the virtual machine image file safe deletion method, and then can sort the multiple data blocks when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek multiple times in the disk to find the data blocks to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of virtual image files.

[0035] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks.

[0036] The third aspect of the present invention discloses a device for securely deleting a virtual machine image file, the device comprising:

[0037] A memory storing executable program code;

[0038] a processor coupled to the memory;

[0039] The processor calls the executable program code stored in the memory to execute the method for securely deleting virtual machine image files disclosed in the first aspect of the present application.

[0040] The device of the present application can split the image file to be deleted into multiple data blocks by executing the virtual machine image file safe deletion method, and then can sort the multiple data blocks when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek multiple times in the disk to find the data blocks to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of virtual image files.

[0041] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks.

[0042] The fourth aspect of the present application discloses a storage medium, wherein the storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for securely deleting virtual machine image files disclosed in the first aspect of the present application.

[0043] The storage medium of the present application can split the image file to be deleted into multiple data blocks by executing the virtual machine image file safe deletion method, and then can sort the multiple data blocks when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek multiple times in the disk to find the data blocks to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of virtual image files.

[0044] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 It is a flowchart of a method for securely deleting a virtual machine image file disclosed in an embodiment of the present application;

[0047] Figure 2 This is a schematic diagram of data block sorting disclosed in an embodiment of the present application;

[0048] Figure 3 This is a schematic diagram of an advanced deletion queue disclosed in an embodiment of the present application;

[0049] Figure 4 It is a schematic diagram of a mid-level deletion queue disclosed in an embodiment of the present application;

[0050] Figure 5 It is a schematic diagram of a low-level deletion queue disclosed in an embodiment of the present application;

[0051] Figure 6 It is a structural schematic diagram of a virtual machine image file secure deletion device disclosed in an embodiment of the present application;

[0052] Figure 7 It is a structural schematic diagram of a virtual machine image file secure deletion device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0054] Embodiment 1

[0055] See also Figure 1 , Figure 1 1 is a flow chart of a method for safely deleting a virtual machine image file disclosed in an embodiment of the present application. Figure 1 As shown, the method of the embodiment of the present application includes the following steps:

[0056] 101. When a virtual image file security deletion request for a virtual machine is received, file information of the image file to be deleted of the virtual machine is obtained, where the file information of the image file to be deleted includes disk area information of the image file to be deleted;

[0057] 102. Determine the disk location of the data block of each image file to be deleted according to the disk area information of each image file to be deleted, wherein the image file to be deleted includes two or more data blocks;

[0058] 103. Sort two or more data blocks according to the disk location of each data block and form a data queue;

[0059] 104. Perform security deletion operations on all data blocks in sequence based on the arrangement order of the data blocks in the data queue.

[0060] In an embodiment of the present application, by splitting the image file to be deleted into multiple data blocks, the multiple data blocks can be sorted when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek multiple times in the disk to find the data blocks to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of the virtual image file.

[0061] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks.

[0062] In an embodiment of the present application, for step 101, a user can trigger a safe deletion request for a virtual image file of a virtual machine on a user operation interface, for example, by clicking a safe deletion button on the user operation interface to trigger a safe deletion request for a virtual image file of a virtual machine, and then when the operation terminal detects the user's click action, it is determined that a safe deletion request for a virtual image file of a virtual machine is received. On the other hand, optionally, the safe deletion request for a virtual image file of a virtual machine can also be sent by a server, wherein the server and the operation terminal are connected in communication, and then the operation terminal can receive the safe deletion request for a virtual image file of a virtual machine sent by the server.

[0063] Specifically, the virtual image file security deletion request for the virtual machine includes the file name of the image file to be deleted of the virtual machine, and then the disk area information of the image file to be deleted can be obtained according to the file name of the image file to be deleted of the virtual machine. Further, with regard to how to obtain the disk area information of the image file to be deleted according to the file name of the image file to be deleted of the virtual machine, the embodiment of the present application provides an optional implementation method, that is, the disk area information of the image file to be deleted can be obtained according to the file name of the image file to be deleted of the virtual machine, including the following sub-steps:

[0064] Get the target mapping table;

[0065] Based on the file name of the image file to be deleted of the virtual machine, the disk area information corresponding to the file name of the image file to be deleted of the virtual machine is searched on the target mapping table, and the disk area information of the image file to be deleted is obtained.

[0066] In the above optional implementation, the file name of the image file to be deleted of the virtual machine is used as the search condition, and the disk area information of the image file to be deleted can be searched from the target mapping table, wherein the target mapping table pre-stores the mapping relationship between all files of the virtual machine and the disk area, and then the disk area information of the image file to be deleted can be searched through the mapping relationship. On the other hand, the virtual image file safe deletion request of the virtual machine can also include the name of the virtual machine, wherein, since the host machine where the virtual machine is located may have multiple virtual machines installed, at this time, the target mapping table corresponding to the virtual machine can be searched through the name of the virtual machine. For example, assuming that the host machine is installed with virtual machine A and virtual machine B, then the name of virtual machine A can be used to search for the target mapping table A, and the name of virtual machine B can be used to search for the target mapping table B.

[0067] Specifically, in step 101, the image file to be deleted of the virtual machine passes through more than two files, for example, the virtual machine includes an image file A to be deleted and an image file B to be deleted, wherein the file name carried in the virtual image file safe deletion request can be the name of a parent file. Accordingly, the embodiment of the present application also provides an optional implementation method for obtaining the file information of the image file to be deleted of the virtual machine, that is, obtaining the file information of the image file to be deleted of the virtual machine, including:

[0068] According to the file name carried in the virtual image file safe deletion request, determine the upper-level file directory pointed to by the file name carried in the virtual image file safe deletion request;

[0069] Traverse the subordinate files associated with the superior file directory and obtain the file information of all sub-files associated with the superior file directory.

[0070] In the embodiment of the present application, for step 102, since each image file to be deleted is stored in a different disk, the storage position of each data block in the file of the image file to be deleted is also in order, wherein the storage position of the data block stored near the starting address of the disk is earlier than the data block far from the starting address of the disk. It should be noted that in the embodiment of the present application, each image file to be deleted is regarded as consisting of two or more data blocks, wherein the embodiment of the present application does not limit how many data blocks the image file to be deleted is divided into according to what data length, for example, the image file to be deleted can be divided into three data blocks A1, A2, and A3 according to 2 bytes as the unit length, or it can be divided into six data blocks A1, A2, A3, A4, A5, and A6 according to 1 byte as the unit length.

[0071] Furthermore, when sorting the data blocks, in the case where there are multiple image files to be deleted, the data blocks of the multiple image files to be deleted are sorted in order according to the storage location of each data block. For example, assuming there are two files, image file A to be deleted and image file B to be deleted, where image file A to be deleted has three data blocks A1, A2, and A3, and image file B to be deleted has two data blocks B1 and B2 stored in order from the earliest to the latest, then Figure 2 As shown, each data block in the image file to be deleted A and the image file to be deleted B is sorted according to the order of the storage position of each data block, wherein the sorted data blocks are stored in the deletion queue, and Figure 2 The hard disk in refers to the disk, and Figure 2 The dequeue in step 101 is the data queue in step 103.

[0072] In the embodiment of the present application, for step 104, the secure deletion operation refers to normal deletion, wherein normal deletion refers to deleting the index corresponding to the data, for example, deleting the file name of file A, but the data of file A is still stored in the hard disk. Generally, the data of file A can be found by a designated data recovery tool through ordinary deletion, and the secure deletion operation refers to deleting the file directly in the form of data overwriting, for example, overwriting the disk data corresponding to file A with other data. In this way, since the data of file A itself is destroyed, the data recovery tool cannot recover these files.

[0073] In the embodiment of the present application, as an optional implementation, step 104: performing a secure deletion operation on the data blocks in sequence based on the arrangement order of the data blocks in the data queue includes the following sub-steps:

[0074] It is determined whether the host on which the virtual machine is installed supports the demapping command. If the host on which the virtual machine is installed supports the demapping command, data of all data blocks are sequentially erased based on the arrangement order of the data blocks in the data queue and the calling of the demapping command.

[0075] In this optional implementation, by judging whether the host on which the virtual machine is installed supports the demapping command, the data of all data blocks can be erased in sequence based on the arrangement order of the data blocks in the data queue and the call of the demapping command. At present, the host machines of some virtual machines support the demapping command, while the host machines of some virtual machines do not support the demapping command. Therefore, the host machine can be adapted by judging. At the same time, the demapping command is used to implement safe deletion on the host machine that supports the demapping command, which has a lower operation time consumption than the safe deletion method of data overwriting.

[0076] Accordingly, in the embodiment of the present application, as an optional implementation, the step of performing a secure deletion operation on the data blocks in sequence based on the arrangement order of the data blocks in the data queue also includes the following sub-steps:

[0077] When the host on which the virtual machine is installed does not support the demapping command, the overwrite file is called, and the data of all the data blocks are overwritten in sequence based on the arrangement order of the data blocks in the data queue and the calling of the overwrite file.

[0078] In the embodiment of the present application, as an optional implementation manner, the method of the embodiment of the present application further includes the following sub-steps:

[0079] Whenever the data of a data block is erased or overwritten, the reference relationship of the current data block is deleted to release the storage resources of the current data block.

[0080] In this optional implementation, by deleting the reference relationship of the current data block, the system resources occupied by the data block can be released in time, thereby making room for the system to run other tasks. For example, for a 100GB image file (the image file to be deleted of the virtual machine), if all the data of the file is erased and then the file is deleted to release the storage space occupied by the file, if the write performance of the disk is 100MB / s, then it takes 1024 seconds, that is, 1024 seconds to release the 100GB storage space. This optional implementation uses the space occupied by the data block to be released while deleting, which can release 100MB of space per second. In the case of tight storage space, it can ensure that the system will not be stuck due to long-term lack of storage resources.

[0081] In the embodiment of the present application, as an optional implementation, step 101: before executing the safe deletion command for the image file to be deleted of the virtual machine, the method of the embodiment of the present application further includes the following sub-steps:

[0082] Determine whether the image file deletion request of the virtual machine is to delete the image files of at least two virtual machines, and if so, read the security deletion priority of at least two virtual machines, wherein the security deletion priority of each virtual machine is preset when the virtual machine is installed;

[0083] forming a processing queue based on the security deletion priorities of at least two virtual machines, wherein the priority levels of the two processing queues are different and the security deletion priorities of the virtual machines in each processing queue are the same;

[0084] And, executing a safe deletion command for the image file to be deleted of the virtual machine, including:

[0085] According to the priority level of the processing queue, the safe deletion command for the image file to be deleted of each virtual machine is executed in sequence.

[0086] In this optional implementation, since two or more virtual machines can be installed on the host machine at the same time, the user can initiate a secure deletion request for two virtual machines on the operating terminal. In this way, the deletion request for two or more virtual machines needs to be securely deleted according to the priority of the virtual machines, where the priority of the virtual machine is arranged according to the confidentiality importance of the data in the virtual machine. For example, if the confidentiality importance of the data in virtual machine A is lower than the confidentiality importance of the data in virtual machine B, the priority of virtual machine A is lower than that of virtual machine B.

[0087] Specifically, when installing a virtual machine in a host machine, the installer can set a priority for the virtual machine based on the confidentiality of the data in the virtual machine, and the priority of the virtual machine is stored in the host machine, for example, in the form of a configuration file. Then, when a user initiates a security deletion request for two or more virtual machines, the priority of each virtual machine is determined by reading this configuration file.

[0088] It can be seen that this optional implementation method, by deleting virtual machines with high priority, can ensure that virtual machines with high confidentiality are deleted first, thereby shortening the exposure time of highly confidential data, thereby improving data security. In particular, under the premise that the write bandwidth of the disk is prioritized and the secure deletion operation itself is time-consuming, if the secure deletion operation is not performed according to the priority of the virtual machine, then the secure deletion of virtual machines with low confidentiality importance will take a long time, making it impossible to delete virtual machines with high confidentiality importance for a long time, thereby prolonging the exposure time of highly confidential data, thereby increasing the risk of data leakage.

[0089] In this optional implementation, for the step of forming a processing queue based on the security deletion priority of at least two virtual machines, this optional implementation may optionally set three priority levels of non-processing queues, such as Figure 3-5 As shown, the three priority levels of unprocessed queues are respectively a high-level deletion queue (processing queue), a medium-level deletion queue, and a low-level deletion queue, wherein each deletion queue includes multiple data blocks, for example, the high-level deletion queue includes five data blocks B2, A2, B1, A1, and A3, the medium-level deletion queue includes C2, D4, C1, D1, D3, C3, and D2 data blocks, and the low-level deletion queue includes E2, F4, E1, F1, F3, E2, F5, E4, and F4 data blocks. On the other hand, the positions of the data blocks in the same deletion queue are arranged according to the disk storage positions of the data blocks.

[0090] In the embodiment of the present application, as an optional implementation, the method further includes:

[0091] During the process of executing the safe deletion command for the image files to be deleted of the virtual machine, determine whether there is a processing queue with a higher priority than the current processing queue. If so, pause the safe deletion of the current processing queue, and execute the safe deletion command for the image files to be deleted of the virtual machine in the processing queue with a higher priority than the current processing queue.

[0092] When executing the safe deletion operation, the steps executed by the host machine also include: determining whether there are new data blocks in the high-priority deletion queue. If so, the terminal currently processes the low-priority deletion queue and jumps to execute the safe deletion operation for the data blocks in the high-priority deletion queue.

[0093] In an embodiment of the present application, as an optional implementation, the data queue is an asynchronous deletion queue.

[0094] Embodiment 2

[0095] See also Figure 6 , Figure 6 Schematic diagram of a structure of a virtual machine image file security deletion device disclosed in an embodiment of the present application. Figure 6 As shown, the device of the embodiment of the present application includes the following functional modules:

[0096] The response module 201 is used for, when receiving a request for safe deletion of a virtual image file for a virtual machine, obtaining a module for obtaining file information of the image file to be deleted of the virtual machine, the file information of the image file to be deleted including disk area information of the image file to be deleted;

[0097] A determination module 202 is used to determine the disk location of the data block of each to-be-deleted image file according to the disk area information of each to-be-deleted image file, wherein the to-be-deleted image file includes two or more data blocks;

[0098] A sorting module 203, used to sort two or more data blocks according to the disk position of each data block and form a data queue;

[0099] The safe deletion module 204 is used to perform safe deletion operations on all data blocks in sequence based on the arrangement order of the data blocks in the data queue.

[0100] The device of the embodiment of the present application can split the image file to be deleted into multiple data blocks by executing the virtual machine image file safe deletion method, and then can sort the multiple data blocks when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek multiple times in the disk to find the data blocks to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of virtual image files.

[0101] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks.

[0102] It should be noted that for other descriptions about the device of the embodiment of the present application, please refer to the relevant detailed description of the embodiment of the present application, and the embodiment of the present application will not be elaborated on this.

[0103] Embodiment 3

[0104] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a virtual machine image file security deletion device disclosed in an embodiment of the present application. Figure 7 As shown, the device of the embodiment of the present application includes:

[0105] A memory 302 storing executable program code;

[0106] A processor 301 coupled to a memory;

[0107] The processor calls the executable program code stored in the memory 302 to execute the method for securely deleting a virtual machine image file disclosed in the first embodiment of the present application.

[0108] The device of the embodiment of the present application can split the image file to be deleted into multiple data blocks by executing the virtual machine image file safe deletion method, and then can sort the multiple data blocks when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek the disk multiple times in order to find the data block to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of the virtual image file.

[0109] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks.

[0110] Embodiment 4

[0111] An embodiment of the present application discloses a storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the method for securely deleting virtual machine image files disclosed in the first embodiment of the present application.

[0112] The storage medium of the embodiment of the present application can split the image file to be deleted into multiple data blocks by executing the virtual machine image file safe deletion method, and then can sort the multiple data blocks when deleting the image file to be deleted. Since the deletion operation is completed based on the sorted data blocks, the deletion operation does not need to seek multiple times in the disk to find the data blocks to be deleted, thereby reducing the number of seeks, thereby reducing the disk seek time, and thus improving the speed of safe deletion of virtual image files.

[0113] In comparison, the prior art does not sort the data blocks, so it is possible that after the current data is deleted, it is necessary to seek multiple times in the disk to find the next file to be deleted. In this way, the number of disk seeks is increased, and the total deletion time is increased. In particular, when the amount of data in the image file to be deleted is large, the deletion time of the prior art is high. For example, in order to delete an image file to be deleted with 3 data blocks, the prior art randomly deletes the image file to be deleted, that is, data block A is currently deleted, and at the next moment, data block B is located through more than two disk seeks (data block B is not adjacent to the storage location of data block A). Assuming that the data blocks of the image file to be deleted are huge, the prior art requires multiple disk seeks, but the present application sorts data block A, data block B, and data block C, and then when deleting, data block A is deleted, and data block B can be located through one hard disk seek, thus reducing the number of hard disk seeks.

[0114] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0115] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0116] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0117] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0118] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0119] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for securely deleting a virtual machine image file, characterized in that: The method comprises: When a virtual image file security deletion request for a virtual machine is received, file information of the image file to be deleted of the virtual machine is obtained, where the file information of the image file to be deleted includes disk area information of the image file to be deleted; Determining the disk location of the data block of each of the to-be-deleted image files according to the disk area information of each of the to-be-deleted image files, wherein the to-be-deleted image files include two or more of the data blocks; Sort two or more data blocks according to the disk location of each data block and form a data queue; The secure deletion operation is performed on all the data blocks in sequence based on the arrangement order of the data blocks in the data queue.

2. The method according to claim 1, characterized in that The step of sequentially performing a secure deletion operation on the data blocks based on the arrangement order of the data blocks in the data queue includes: Determine whether the installation host of the virtual machine supports the demapping command. If the installation host of the virtual machine supports the demapping command, erase the data of all the data blocks in sequence based on the arrangement order of the data blocks in the data queue and calling the demapping command.

3. The method according to claim 2, characterized in that The step of sequentially performing a secure deletion operation on the data blocks based on the arrangement order of the data blocks in the data queue further includes: When the installation host of the virtual machine does not support the demapping command, the overwrite file is called, and the data of all the data blocks are overwritten in sequence based on the arrangement order of the data blocks in the data queue and the calling of the overwrite file.

4. The method according to any one of claims 2 to 3, characterized in that: The method further comprises: Whenever the data of a data block is erased or overwritten, the reference relationship of the current data block is deleted to release the storage resources of the current data block.

5. The method according to claim 1, characterized in that Before executing the safe deletion command for the to-be-deleted image file of the virtual machine, the method further includes: Determine whether the image file deletion request of the virtual machine is to delete the image files of at least two virtual machines, and if so, read the security deletion priority of at least two virtual machines, wherein the security deletion priority of each virtual machine is preset when the virtual machine is installed; forming a processing queue based on the security deletion priorities of at least two of the virtual machines, wherein the priority levels of the two processing queues are different and the security deletion priorities of the virtual machines in each processing queue are the same; And, executing a safe deletion command for the image file to be deleted of the virtual machine includes: According to the priority level of the processing queue, the safe deletion command of the to-be-deleted image file of each virtual machine is executed in sequence.

6. The method according to claim 5, characterized in that The method further comprises: During the process of executing the safe deletion command of the image file to be deleted for the virtual machine, it is determined whether there is a processing queue with a higher priority than the current processing queue. If so, the safe deletion of the current processing queue is suspended, and the safe deletion command of the image file to be deleted for the virtual machine in the processing queue with a higher priority than the current processing queue is executed.

7. The method according to claim 1, characterized in that The data queue is an asynchronous deletion queue.

8. A device for safely deleting virtual machine image files, characterized in that: The device comprises: A response module, configured to, when receiving a virtual image file security deletion request for a virtual machine, obtain file information of the image file to be deleted of the virtual machine, wherein the file information of the image file to be deleted includes disk area information of the image file to be deleted; A determination module, used to determine the disk location of the data block of each of the to-be-deleted image files according to the disk area information of each of the to-be-deleted image files, wherein the to-be-deleted image files include two or more of the data blocks; A sorting module, used for sorting two or more data blocks according to the disk position of each data block and forming a data queue; The safe deletion module is used to perform safe deletion operations on all the data blocks in sequence based on the arrangement order of the data blocks in the data queue.

9. A virtual machine image file secure deletion device, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for securely deleting a virtual machine image file according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for securely deleting a virtual machine image file according to any one of claims 1 to 7.