Mirror image editing method and device based on object storage, equipment and storage medium

By utilizing the image editing method of object storage in the cloud image system, the files related to image operation are hierarchically defined and saved to realize the separation of reading and writing in the image editing process, solving the reliability and storage cost problems of the existing image editing solution, and improving the efficiency and availability.

CN118672718APending Publication Date: 2024-09-20GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310266297.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-17
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Existing image editing solutions have challenges in terms of reliability risks and storage costs. The hardware cost is high, the bandwidth requirements are high, and the storage costs are high. In addition, SAN storage volumes have risks in shared use, resulting in unstable overall image management services.

Method used

Using the image editing method based on object storage, by initializing the storage area in the cloud image system, creating a virtual machine, and storing the basic image file and incremental image file in the image storage server and the image running server respectively, taking advantage of the image layering feature Achieve read and write separation, reduce storage costs and improve high availability.

Benefits of technology

It achieves storage cost savings, improves the high availability of services and data and the scalability of storage space. It also reduces the network transmission requirements during the image editing process and improves the efficiency and reliability of image editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672718A
    Figure CN118672718A
Patent Text Reader

Abstract

The embodiment of the invention discloses a mirror image editing method and device based on object storage, equipment and a storage medium. The embodiment of the invention is applied to a cloud mirror image system, the cloud mirror image system comprises a mirror image storage server and a mirror image operation server, and the mirror image editing method comprises the following steps: initializing a storage area, and creating a virtual machine in the mirror image operation server; the storage area comprises a first storage area, a second storage area and a third storage area, the first storage area and the second storage area are located in a mirror image storage server, the third storage area is located in a mirror image operation server, basic mirror image files are stored in the first storage area, and the second storage area is used for storing incremental mirror image files; when the virtual machine is started, running the basic mirror image file based on the file storage state in the second storage area; when the virtual machine is operated, storing a temporary mirror image file generated by the operation of the virtual machine in the third storage area; and when the virtual machine is closed, updating the incremental mirror image file according to the temporary mirror image file. According to the embodiment, the high availability of services and data and the expansibility of a storage space are improved, and the network requirement is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of cloud operating systems, and in particular to an image editing method, apparatus, device, and storage medium based on object storage. Background Art

[0002] With the continuous development of network technology and data processing technology, distributed storage and cloud processing have become a major trend in data storage and processing. Under this trend, cloud desktops are becoming more and more perfect, which can provide users with thin clients that have the same experience as personal computers. Many smart devices such as mobile phones and tablets can also achieve the same functions as personal computers.

[0003] In the two common modes of cloud desktops, TCI (Transparent Client Infrastructure) and IDV (Intelligent Desktop Virtualization), how to edit or update (hereinafter referred to as editing) the operating system image of the terminal more efficiently has always been a problem we are concerned about. There are currently two main image update solutions: the first is the terminal image editing solution; the second is the server-side image editing solution based on local storage or SAN (Storage Area Network) storage. In the first image editing solution, the hardware cost and bandwidth requirements are relatively high; in the second image editing solution, the overall storage cost is high, and the SAN storage volume is limited in shared use. There is a risk that once a problem occurs with the server, the entire image management service will not be able to run. Summary of the invention

[0004] The present invention provides an image editing method, an apparatus, a device and a storage medium based on object storage to solve the technical problems of existing image editing solutions in terms of reliability risk and storage cost.

[0005] In a first aspect, an embodiment of the present invention provides an image editing method based on object storage, which is used in a cloud image system. The cloud image system includes an image storage server and an image operation server. The image editing method includes:

[0006] Initialize the storage area and create a corresponding virtual machine on the image running server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image running server, the first storage area stores the basic image file, and the second storage area is used to store the incremental image file;

[0007] When the virtual machine is started, the basic image file is run based on the file storage state in the second storage area;

[0008] When the virtual machine is running, a temporary image file generated by the running of the virtual machine is stored in the third storage area;

[0009] When the virtual machine is shut down, the temporary image file is merged from the third storage area to the second storage area to update the incremental image file.

[0010] In a second aspect, an embodiment of the present invention further provides an image editing device based on object storage, which is used in a cloud image system. The cloud image system includes an image storage server and an image operation server. The image editing device includes:

[0011] An initialization unit is used to initialize the storage area and create a corresponding virtual machine on the image running server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image running server, the first storage area stores a basic image file, and the second storage area is used to store an incremental image file;

[0012] A startup processing unit, used to run the basic image file based on the file storage state in the second storage area when starting the virtual machine;

[0013] A temporary storage unit, used for storing temporary image files generated by the operation of the virtual machine in the third storage area when the virtual machine is running;

[0014] The data merging unit is used to merge the temporary image file from the third storage area to the second storage area to update the incremental image file when shutting down the virtual machine.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, including:

[0016] one or more processors;

[0017] a memory for storing one or more computer programs;

[0018] When one or more computer programs are executed by one or more processors, the electronic device implements the object storage-based mirror editing method as described in the first aspect.

[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image editing method based on object storage as in the first aspect.

[0020] The above-mentioned image editing method, device, equipment and storage medium based on object storage are used in a cloud image system, which includes an image storage server and an image operation server. The image editing method includes: initializing a storage area and creating a corresponding virtual machine on the image operation server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image operation server, the first storage area stores a basic image file, and the second storage area is used to save incremental image files; when starting the virtual machine, the basic image file is run based on the file storage state in the second storage area; when running the virtual machine, the temporary image file generated by the virtual machine operation is saved in the third storage area; when shutting down the virtual machine, the temporary image file is merged from the third storage area to the second storage area to update the incremental image file. By utilizing the hierarchical characteristics of TCI and IDV images, the image operation-related files are hierarchically defined and saved separately, and the read-write separation during the image operation process is realized based on the hierarchical definition and the separate saving, thereby saving storage costs, improving the high availability of services and data and the scalability of storage space, and reducing the network transmission requirements during the image editing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A method flow chart of an image editing method based on object storage provided by an embodiment of the present invention.

[0022] Figure 2 This is a diagram of the system layered architecture in the terminal image editing solution.

[0023] Figure 3 This is the image editing flow chart in the terminal image editing solution.

[0024] Figure 4 Edit the system layered architecture diagram for server-side mirroring solutions based on local storage or SAN storage.

[0025] Figure 5 This is a flowchart for image editing in a server-side image editing solution based on local storage or SAN storage.

[0026] Figure 6 It is a system layered architecture diagram in the terminal image editing solution in an embodiment of the present invention.

[0027] Figure 7 Schematic diagram of the mirroring process in an embodiment of the present invention.

[0028] Figure 8 The figure is a schematic diagram of a storage area content change process during image editing based on an embodiment of the present invention.

[0029] Fig. 9 A schematic diagram of the structure of an image editing device based on object storage provided by an embodiment of the present invention.

[0030] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0032] It should be noted that the present application specification does not enumerate all optional implementation modes. After reading the present application specification, those skilled in the art should be able to understand that as long as the technical features do not contradict each other, any combination of the technical features can constitute an optional implementation mode.

[0033] In order to more clearly describe the specific implementation process of the embodiment of the present application and the corresponding technical effects. Figure 2-Figure 5 The existing image editing scheme is further explained in detail.

[0034] Please refer to Figure 2 , Figure 2 This is the system layered architecture diagram in the terminal image editing solution. Figure 2PC110 in the image refers to a TCI or IDV terminal, Server 130 refers to a server for managing images in the cloud, LAN 120 refers to a local area network connecting Server 130 and PC110, and Management platform 131 refers to a management platform for image administrators, which is mainly used to send instructions to ImageServer 132 or PC 110, such as sending an image version creation instruction to ImageServer 132, and sending an image distribution and image editing incremental data (also called differential disk) upload instruction to PC 110. ImageServer132 is used for the service of operating system image management of the terminal, and mainly responds to the instructions of Management platform 131 and performs corresponding operations. Mount Client 134 is used to mount data in Distributed Object Storage 140 to the server operating system of Server 130. Distributed Object Storage 140 is a distributed object storage system that provides highly available and scalable storage services, which are used here to store terminal images. Mounted Directory 133 refers to a directory on Server 130 where the image in Distributed Object Storage 140 is mounted by Mount Client 134 , and the read and write operations on the files in the directory are converted into read and write operations on the files in Distributed Object Storage 140 .

[0035] based on Figure 2 For the system layered architecture, please see Figure 3In the image editing process shown, the administrator specifies a TCI or IDV PC 110 to download the image to be edited to the hard disk of PC 110. After downloading the image, PC 110 chooses to start through IDV or TCI and enters the operating system. The administrator needs to operate the update of the operating system application on PC 110. After the update is completed, the PC 110 needs to be restarted and the image differential disk upload is triggered. The differential disk is uploaded to ImageServer 132. The administrator operates on the Management platform 131, selects the edited image, merges the differential disk and generates a new version. In the above processing, image editing needs to rely on an idle TCI or IDV PC 110; the image needs to be downloaded to PC 110 first, and the download process will occupy a certain amount of LAN bandwidth, affect other LAN applications, and may take a long time; after the image is edited, the differential disk needs to be uploaded to Server 130 again, which will also occupy the LAN bandwidth and take a long time; there are many interactive steps between components, and the reliability is relatively low.

[0036] Please refer to Figure 4 , which is a system layered architecture diagram in a server-side image editing solution based on local storage or SAN storage. Figure 4 Some components in Figure 2 The corresponding components in implement substantially the same functions, such as LAN 220, Server 230, Management platform 231, ImageServer 232, etc., wherein Browse 210 refers to the browser run by the administrator on any terminal (which may not be a TCI or IDV terminal), Gateway 236 refers to the proxy gateway of the vnc or spice service exposed by Virtual Machine 235, Virtual Machine 235 refers to the virtual host used to run the image in Server 230, and Local Storage Directory 237 can refer to either a local directory for storing image files or a directory after mounting a disk device by connecting to an external SAN storage and formatting and mounting the device. If Local Storage Directory 237 corresponds to a local disk, the image file is stored in the local disk; if Local Storage Directory 237 corresponds to a SAN storage, the image file is stored in an external SAN storage.

[0037] based on Figure 4 For the system layered architecture, please see Figure 5In the image editing process shown, the administrator sends an editing instruction for a certain image through the Management platform 231, and the ImageServer 232 creates a Virtual Machine 235 on the Server 230 by specifying the image. The Virtual Machine 235 will enable the vnc or spice service, and the Gateway 236 enables the application layer agent of the vnc or spice for the Virtual Machine 235. The administrator accesses the vnc or spice service of the Virtual Machine 235 through the Browser 210. The administrator completes the update operation of the application in the image, and finally shuts down the virtual machine and creates a new image version. In the above processing, if the server uses local storage, there are problems with data reliability and storage space scalability. Damage to the local disk may cause the image to be lost. Although the reliability and scalability can be improved to a certain extent through the disk array method, this improvement is very limited due to the limitation of the server hard disk disk slot. If the server uses external SAN storage, the storage cost will be very high. And although this solution solves the problem of storage reliability itself, SAN storage does not support multiple servers sharing the same SAN storage volume, which results in the failure of the entire image management service once the server fails.

[0038] In response to the above technical problems, this solution proposes an image editing method based on object storage, which can effectively utilize the layered characteristics of images, define and save the files related to image operation in layers, and realize read-write separation during the image operation process based on the layered definition and separate storage, thereby saving storage costs, improving the high availability of services and data and the scalability of storage space, and reducing the network transmission requirements during the image editing process.

[0039] The following is a detailed description of the various embodiments of the present invention.

[0040] Figure 1 A method flow chart of an image editing method based on object storage provided in an embodiment of the present invention. The image editing method based on object storage is integrated and implemented by devices in a cloud image system. The electronic device can actually be a cloud server with data processing capabilities. The cloud server is defined as an image operation server and an image storage server in the cloud image system according to the difference in overall implementation functions. The image operation server is the computing power basis for the system image operation; the image storage server, for example, an image storage server with a distributed storage layout, is used to store images. Please refer to Figure 1 The image editing method based on object storage includes steps S110 to S140:

[0041] Step S110: Initialize the storage area and create a corresponding virtual machine on the image running server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image running server. The first storage area stores basic image files, and the second storage area is used to save incremental image files.

[0042] In this scheme, compared with Figure 2 and Figure 4 Please refer to the layered architecture of the existing editing system shown in Figure 6 , which can be considered as containing Figure 2 All components other than PC 110 in the layered architecture shown, and Figure 4 All components in the layered architecture shown, Figure 6 The server 330 shown is a mirror operation server. Among the components shown in the server 330, some of the corresponding data actually exists in the mirror operation server, and some actually exists in the mirror storage server, but is managed by the mirror operation server. The components actually existing in the server 330, such as the management platform 331 (corresponding to Figure 2 Management platform 131 and Figure 4 Management platform 231), Gateway 336 (corresponding to Figure 4 236 in), ImageServer 332 (corresponding to Figure 2 ImageServer 132 and Figure 4 ImageServer232 in the image server), Mount Client 334 (corresponding to Figure 2 Mount Client 134), Virtual Machine 335 (corresponding to Figure 4 Virtual Machine 235), Local Storage Directory 337 (corresponding to Figure 4 LocalStorage Directory 237 in the image storage server); the corresponding data actually exists in the image storage server component such as MountedDirectory 333 (corresponding to Figure 2 In the hierarchical architecture shown in this solution, the image operation can be connected, started and edited by the Browser 310 of various types of terminals through the LAN 320, and the image is finally stored in the Distributed Objective Storage 340. Figure 6The architecture design shown may not require any adjustment to the hardware in the cloud image system, and may be a reorganization of the data storage process and the data storage path during the entire image editing process. The above architecture is based on the redefinition of the data processing process during the editing process.

[0043] The data foundation of cloud desktop implementation is various images. Each complete TCI and IDV image can generally contain three layers of structure: BaseImage, LowerImage and UpperImage. Among them, BaseImage corresponds to the basic image file in the actual stored data, which contains a runnable operating system and some commonly used applications; LowerImage is a sub-disk created based on BaseImage, which contains incremental data modified based on BaseImage, and corresponds to the incremental image file in the actual stored data; UpperImage is a sub-disk created based on LowerImage. The incremental data generated based on BaseImage will be written to UpperImage first, and then merged into LowerImage for archiving. After archiving, UpperImage can be deleted and regenerated based on LowerImage when the image is edited next time. UpperImage has a temporary storage period after it is generated and before it is deleted. The actual stored data corresponding to this period is defined as a temporary image file. It can be found that unless BaseImage is actively updated, the data will not change due to daily use. BaseImage and LowerImage are the data basis for each run. UpperImage is the new image data generated for each run and will be updated to LowerImage after the run ends.

[0044] Based on the three-layer structure of the image and the above redefined hierarchical structure of the editing system, the storage settings required for data transmission in each component in the hierarchical structure are realized by initializing the storage area. Specifically, the storage area is initialized to first create a mirror directory on the image storage server, and store the first mirror file and the second mirror file in the mirror directory. The first mirror file is the basic mirror file, and the second mirror file is an incremental mirror file initialized to be empty with incremental data; create a temporary file directory based on the virtual machine on the image running server, create a secondary incremental mirror file in the temporary file directory, and the secondary incremental mirror file is a soft link of the empty incremental mirror file; create a temporary mirror file based on the secondary incremental mirror file; and create a virtual machine on the image running server according to the temporary mirror file. Soft links are also called symbolic links. The secondary incremental mirror file contains the path name of the empty incremental mirror file. Files in different file systems can be linked through soft links. Initializing the storage area is only an operation that needs to be performed when creating a virtual machine. When the virtual machine is running after creation, it can access and save the image according to the initialized storage area. The file attributes such as the number and file name of the image files in the various links and storage areas do not change due to data updates. For example, the soft link of the incremental image file whose sub-incremental image file is empty, as the virtual machine runs, the data in the incremental image file changes, but it does not affect the soft link in the sub-incremental image file, which can still point to the incremental image file. The name of the temporary file directory contains the name of the corresponding virtual machine, thereby realizing the special storage of the corresponding data of each virtual machine. The third storage area only needs to save data when the virtual machine is running, so it can be initialized when the virtual machine is created, and cleared each time the virtual machine is shut down, or it can be initialized each time the virtual machine is started. In the specific implementation of this solution, the third storage area, virtual machine and file merge directory can be created by the image service component (i.e. ImageServer).

[0045] Step S120: When starting the virtual machine, the basic image file is run based on the file storage state in the second storage area.

[0046] Each time the virtual machine is started, the basic image file is run based on the file storage status in the second storage area. This means that when the virtual machine is started, the basic image file stored in the first storage area will be run accordingly, and the running of the basic image file may involve incremental data generated by the previous run. If there is already incremental data in the second storage area, then the running of the basic image file requires the incremental data; if the virtual machine is run for the first time after creation, or the administrator resets it to the initialization state, then there is no incremental data in the second storage area, and the basic image file can run independently.

[0047] Step S130: When the virtual machine is running, a temporary image file generated by the running of the virtual machine is saved in the third storage area.

[0048] The virtual machine generates incremental data from the moment it is started. During the operation, it is uncertain which data the administrator ultimately needs to retain. The data generated during the operation is directly stored locally in the third storage area and processed after the operation ends. It can be found from steps S120 and S130 that during the operation of the mirror, data reading and writing are processed by path and storage target. During the operation of the virtual machine, read-write separation is achieved, and the characteristic of Distributed Objective Storage340 that the read performance is higher than the write performance is maximized. For Server 330, if you want to increase the write speed of the mirror, you can also easily achieve it by replacing the local disk of Server 330 with SSD (Solid State Disk or Solid State Drive).

[0049] Step S140: When the virtual machine is shut down, the temporary image file is merged from the third storage area to the second storage area to update the incremental image file.

[0050] When shutting down the virtual machine, that is, ending the image operation, it acts as a thin client personal computer and saves the data generated during the operation. Based on the implementation of this solution, the process of saving the data generated during the operation can be considered to be completed in two steps. The first step is to save the generated data locally as a temporary image file in step S130. As the data is continuously generated, the temporary image file is continuously updated. The second step is to determine the final state of the temporary image file corresponding to the currently running virtual machine when shutting down the virtual machine in step S140. At this time, the temporary image file is updated to an incremental image file for use in the next operation.

[0051] based on Figure 6 For the hierarchical structure shown in FIG. 1 and the process of initializing the storage area in step S110, please refer to Figure 7In the schematic diagram of the mirror operation process shown, through the temporary mirror file created based on the secondary incremental mirror file and the virtual machine created based on the temporary mirror file, the virtual machine can process the data in the three-layer structure of the mirror during operation and use different storage paths for reading and writing. In this data processing process, the Mounted Directory 333 does not actually occupy the disk space on the Server 330. It actually corresponds to the storage space in the Distributed Object Storage 340. If there are multiple Servers 330, the same storage space in the Distributed Object Storage 340 can be mounted to multiple Servers 330, thereby realizing cross-Server drift of data. Mounted Directory 33a stores the first and second layers of the image, namely BaseImage 33a and LowerImage 33b. Local Storage Directory 337 corresponds to the local disk on Server 330 and only stores the third layer of the image, UpperImage 33c. However, in order to facilitate the merging of UpperImage33c into LowerImage 33b, it is also necessary to soft link LowerImage 33b in Mounted Directory 333 to Local Storage Directory 337, that is, Figure 7 The LowerImage marked by the dotted box is actually a soft link (Soft Link) from the LowerImage 33b in the MountedDirectory 333. Correspondingly, the UpperImage 33c in the LocalStorageDirectory 337 is merged into the LowerImage 33b in the Mounted Directory 333 when there is a save operation.

[0052] Through the above layered processing, this embodiment realizes read-write separation. When starting a virtual machine based on UpperImage, all write operations are directed to the UpperImage file in the Local Storage Directory, while read operations are directed to the BaseImage and LowerImage in the Mounted Directory, which just meets the characteristic that the read performance of object storage is higher than the write performance. If you want to improve the write IO of the image, the local disk on the server can be replaced with an SSD.

[0053] In the specific implementation of this plan, Figure 7The process of merging UpperImage 33c to LowerImage 33b can be implemented based on hard links, that is, the third image file is stored in the image directory, and the third image file is a hard link to the first image file. When the virtual machine is shut down, a file merge directory is created, and the fourth image file and the fifth image file are added to the file merge directory. The fourth image file is a copy of the second image file, and the fifth image file is a hard link to the first image file; the secondary incremental image file is updated to a soft link to the fourth image file; the temporary image file is saved, and the temporary image file is merged into the fourth image file to complete the update. A hard link means that a file has one or more file names, which is equivalent to linking the file name and the node number used by the computer file system, so that multiple file names can be used to link to the same file, and these file names can be in the same directory or different directories. Through this hard link method, the data in UpperImage 33c is automatically merged and saved to LowerImage 33b located in Distributed Object Storage 340.

[0054] Please refer to Figure 8 , which specifically shows that the virtual machine named "vm-win10-1" is Figure 6 and Figure 7 The cloud image system shown in the figure shows the changes in the storage area and storage interval data from creation, startup, operation to shutdown.

[0055] When created, the / dos / diskimage directory is created in the Distributed Object Storage 340, and the following three image files are stored in the directory: / dos / diskimage / baseimage.qcow2 file, / dos / diskimage / 1 / lowerimage.qcow2 file, and / dos / diskimage / 1 / baseimage.qcow2 file, which are respectively a base image file, an incremental image file, and a third image file ( / dos / diskimage / 1 / baseimage.gcow2 is a hard link of / dos / diskimage / baseimage.qcow2). It can be seen that the first storage area (for storing base image files) and the second storage area (for storing incremental image files) are not storage areas obtained by physically dividing the storage space, but the storage area for storing the base image files is the first storage area, and the storage area for storing the incremental image files is the second storage area, wherein the initialized incremental image file is a file with empty incremental data.

[0056] According to the virtual machine name "vm-win10-1" entered by the administrator, / data / diskimage / vm-win10-1 is created as a temporary file directory on Server 330, and a soft link of the / dos / diskimage / 1 / lowerimageqcow2 file (i.e., the incremental image file) is created in the temporary file directory: / data / diskimage / vm-win10-1 / owerimage.qcow2 file (i.e., the secondary incremental image file). Based on the / data / diskimage / vm-win10-1 / lowerimage.qcow2 file (i.e., the secondary incremental image file), the / data / diskimage / vm-win10-1 / upperimage.qcow2 file (temporary image file) is created, and a virtual machine is created based on the temporary image file. Based on the above image files and the link relationship between the image files, a corresponding relationship between the image files and the virtual machines is established.

[0057] Based on the relationship established in the initialization storage area, the administrator can start the virtual machine to run the basic image file, and run the incremental image file in the subsequent operation process. When the virtual machine is running, the image file is edited, and the ImageServer 332 in the Server 330 creates an image version and updates the temporary image file ( / data / diskimage / vm-win10-1 / upperimage.qcow2 file). When shutting down the virtual machine, ImageServer 332 creates the / dos / diskimage / 2 directory (file merge directory), and the image files in the file merge directory include the / dos / diskimage / 2 / lowerimage.qcow2 file (the fourth image file) and the / dos / diskimage / 2 / baseimage.gcow2 file (the fifth image file), wherein the / dos / diskimage / 2 / lowerimage.qcow2 file is a copy of the / dos / diskimage / 1 / lowerimage.qcow2 file (the second image file, which has been updated when the virtual machine was shut down last time), and the / dos / diskimage / 2 / baseimage.gcow2 file is a hard link to the / dos / diskimage / baseimage.qcow2 file (the first image file).

[0058] Delete the soft link file (secondary incremental image file) of the / data / diskimage / vm-win10-1 / lowerimage.gcow2 file, and create the soft link / data / diskimage / vm-win10-1 / lowerimage.qcow2 of the / dos / diskimage / 2 / lowerimage.qcow2 file (the fourth image file), which is equivalent to updating the secondary incremental image file to the soft link of the fourth image file. lmageServer performs a commit operation (save operation) on the / data / diskimage / vm-win10-1 / upperimage.qcow2 file (temporary image file), and merges the / data / diskimage / vm-win10-1 / upperimage.qcow2 file into the fourth image file to complete the update.

[0059] In the above image file processing, the / dos / diskimage / 1 / baseimage.qcow2 file is a hard link to the / dos / diskimage / baseimage.qcow2 file, mainly to save storage space. / dos / diskimage is the Mounted Directory 333, corresponding to the Distributed Object Storage 340 storage space. After shutting down the virtual machine, before merging UpperImage 33c to LowerImage 33b, you need to delete and recreate the soft link of the / dos / diskimage / 2 / lowerimage.qcow2 file, that is, the / data / diskimage / vm-win10-1 / lowerimage.qcow2 file, because UpperImage 33c needs to find the / dos / diskimage / 2 / lowerimage.qcow2 (the fourth image file) file for merging based on the / data / diskimage / vm-win10-1 / lowerimage.qcow2 soft link file. If the soft link is not updated and reset, the merge of the / data / diskimage / vm-win10-1 / upperimage.qcow2 file will fail, and it will be merged to the / dos / diskimage / 1 / lowerimage.qcow2 file based on the original soft link, rather than the actual merged object.

[0060] In general, the embodiment of the present application utilizes the layered characteristics of TCI and IDV images, and stores the first-layer and second-layer files (i.e., BaseImage and LowerImage) that occupy the most storage space in Distributed Object Storage, solving the image storage problem; at the same time, the third-layer file (UpperImage) of the image is stored in the local storage with better writing performance, realizing image read-write separation, and making up for the defects of random writing performance of object storage. It provides storage performance guarantee for the operation of virtual machines (if the virtual machine is started directly using the files under the Mounted Directory, there will be performance problems).

[0061] Compared with the terminal image editing solution, the embodiment of the present application avoids unnecessary network transmission caused by image editing and improves the efficiency of image editing. It takes nearly 2 hours to transmit a 70G image on a 100M LAN, and about 12 minutes for a 1G LAN. Due to the separation of image reading and writing, the image merging speed is also increased by 2 to 3 times.

[0062] Compared with server-side image editing solutions based on local storage or SAN storage, the embodiments of the present application not only save storage costs, but also provide better service high availability capabilities (supporting the same shared storage space between multiple servers, ImageServer supports multi-instance deployment). At the same time, it can provide better performance with the help of local SSD.

[0063] In summary, for a cloud image system, the cloud image system includes an image storage server and an image operation server, and the image editing method includes: initializing a storage area and creating a corresponding virtual machine on the image operation server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image operation server, the first storage area stores a basic image file, and the second storage area is used to save incremental image files; when the virtual machine is started, the basic image file is run based on the file storage status in the second storage area; when the virtual machine is run, the temporary image file generated by the virtual machine operation is saved in the third storage area; when the virtual machine is shut down, the temporary image file is merged from the third storage area to the second storage area to update the incremental image file. By utilizing the layered characteristics of TCI and IDV images, the image operation-related files are layered and saved separately, and the read-write separation during the image operation process is realized based on the layered definition and the separate saving, thereby saving storage costs, improving the high availability of services and data and the scalability of storage space, and reducing the network transmission requirements during the image editing process.

[0064] Fig. 9The structure diagram of the image editing device based on object storage provided by the embodiment of the present invention. The image editing method based on object storage is used in a cloud image system, and the cloud image system includes an image storage server and an image operation server. Fig. 9 The object storage-based image editing device includes: an initialization unit 410, a startup processing unit 420, a temporary storage unit 430 and a data merging unit 440.

[0065] Among them, the initialization unit 410 is used to initialize the storage area and create a corresponding virtual machine on the image running server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image running server, the first storage area stores a basic image file, and the second storage area is used to save incremental image files; the startup processing unit 420 is used to run the basic image file based on the file storage status in the second storage area when starting the virtual machine; the temporary saving unit 430 is used to save the temporary image file generated by the operation of the virtual machine in the third storage area when running the virtual machine; the data merging unit 440 is used to merge the temporary image file from the third storage area to the second storage area to update the incremental image file when shutting down the virtual machine.

[0066] Based on the above embodiment, the initialization unit 410 includes:

[0067] A first creation module is used to create an image directory on the image storage server, and store a first image file and a second image file in the image directory, wherein the first image file is a basic image file, and the second image file is an incremental image file initialized to have empty incremental data;

[0068] The second creation module is used to create a temporary file directory based on the virtual machine on the image running server, and create a secondary incremental image file in the temporary file directory, where the secondary incremental image file is a soft link of the empty incremental image file;

[0069] A third creation module, used to create a temporary image file based on the secondary incremental image file;

[0070] The fourth creation module is used to create a virtual machine on the image running server according to the temporary image file.

[0071] Based on the above embodiment, the initialization unit 410 further includes:

[0072] The file storage unit is used to store a third image file in the image directory, where the third image file is a hard link to the first image file.

[0073] Based on the above embodiment, the data merging unit includes:

[0074] A directory creation module is used to create a file merge directory when shutting down the virtual machine, and add a fourth image file and a fifth image file to the file merge directory, where the fourth image file is a copy of the second image file, and the fifth image file is a hard link to the first image file;

[0075] A file update module, used for updating the secondary incremental image file to a soft link of the fourth image file;

[0076] The file merging module is used to perform a save operation on the temporary image file and merge the temporary image file into the fourth image file to complete the update.

[0077] Based on the above embodiment, the third storage area, the virtual machine and the file merge directory are created by the image service component.

[0078] Based on the above embodiment, the third storage area is initialized when the virtual machine is created or started.

[0079] Based on the above embodiment, the name of the temporary file directory includes the name of the corresponding virtual machine.

[0080] The image editing device based on object storage provided in the embodiment of the present invention is included in an electronic device and can be used to execute any image editing method based on object storage provided in the above embodiments, and has corresponding functions and beneficial effects.

[0081] It is worth noting that in the above-mentioned embodiment of the image editing device based on object storage, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0082] Fig.10 FIG. 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Fig.10 As shown, the electronic device includes a processor 510 and a memory 520, and may also include an input device 530, an output device 540 and a communication device 550; the number of the processor 510 in the electronic device may be one or more, Fig.10 A processor 510 is taken as an example; the processor 510, the memory 520, the input device 530, the output device 540 and the communication device 550 in the electronic device can be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0083] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the image editing method based on object storage in the embodiment of the present invention. The processor 510 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 520, that is, realizing the above-mentioned image editing method based on object storage.

[0084] The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 520 may further include a memory remotely arranged relative to the processor 510, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0085] The input device 530 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include a display device such as a display screen.

[0086] An embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is used to perform relevant operations in the object storage-based image editing method provided in any embodiment of the present application, and has corresponding functions and beneficial effects.

[0087] Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products.

[0088] Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0089] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0090] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0091] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0092] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. An image editing method based on object storage, used in a cloud image system, wherein the cloud image system includes an image storage server and an image operation server, characterized in that: The mirror image editing method comprises: Initialize a storage area and create a corresponding virtual machine on the image running server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image running server, the first storage area stores a basic image file, and the second storage area is used to store an incremental image file; When starting the virtual machine, running the basic image file based on the file storage state in the second storage area; When the virtual machine is running, a temporary image file generated by the running of the virtual machine is stored in the third storage area; When shutting down the virtual machine, the temporary image file is merged from the third storage area to the second storage area to update the incremental image file.

2. The mirror image editing method according to claim 1, characterized in that: The initialization storage area and the creation of a corresponding virtual machine on the image running server include: Creating an image directory on the image storage server, storing a first image file and a second image file in the image directory, wherein the first image file is a basic image file, and the second image file is an incremental image file initialized to have empty incremental data; Creating a temporary file directory based on the virtual machine on the image running server, and creating a secondary incremental image file in the temporary file directory, wherein the secondary incremental image file is a soft link to the empty incremental image file; Creating a temporary image file based on the secondary incremental image file; A virtual machine is created on the image execution server according to the temporary image file.

3. The mirror image editing method according to claim 2, characterized in that: The initialization storage area also includes: A third image file is stored in the image directory, and the third image file is a hard link to the first image file.

4. The mirror image editing method according to claim 3, characterized in that: When shutting down the virtual machine, merging the temporary image file from the third storage area to the second storage area to update the incremental image file includes: When shutting down the virtual machine, creating a file merge directory, adding a fourth image file and a fifth image file to the file merge directory, wherein the fourth image file is a copy of the second image file, and the fifth image file is a hard link to the first image file; Updating the secondary incremental image file to a soft link of the fourth image file; A save operation is performed on the temporary image file, and the temporary image file is merged into the fourth image file to complete the update.

5. The mirror image editing method according to claim 4, characterized in that: The third storage area, virtual machine and file merge directory are created by the image service component.

6. The mirror image editing method according to claim 1, characterized in that: The third storage area is initialized when the virtual machine is created or started.

7. The mirror image editing method according to claim 1, characterized in that: The name of the temporary file directory includes the name of the corresponding virtual machine.

8. An image editing device based on object storage, used in a cloud image system, wherein the cloud image system includes an image storage server and an image operation server, characterized in that: The mirror image editing device comprises: An initialization unit, used to initialize a storage area and create a corresponding virtual machine on the image running server; the storage area includes a first storage area and a second storage area located on the image storage server, and a third storage area located on the image running server, the first storage area stores a basic image file, and the second storage area is used to store an incremental image file; a startup processing unit, configured to run the basic image file based on the file storage state in the second storage area when starting the virtual machine; A temporary storage unit, used for saving a temporary image file generated by the operation of the virtual machine in the third storage area when the virtual machine is running; A data merging unit is used to merge the temporary image file from the third storage area to the second storage area to update the incremental image file when shutting down the virtual machine.

9. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more computer programs; When the one or more computer programs are executed by the one or more processors, the electronic device implements the object storage-based mirror editing method as described in any one of claims 1-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, the image editing method based on object storage as described in any one of claims 1 to 7 is implemented.