WO2023197862A1 - Mirror image management methods, apparatus, server, terminal, and storage medium - Google Patents

Mirror image management methods, apparatus, server, terminal, and storage medium Download PDF

Info

Publication number
WO2023197862A1
WO2023197862A1 PCT/CN2023/084551 CN2023084551W WO2023197862A1 WO 2023197862 A1 WO2023197862 A1 WO 2023197862A1 CN 2023084551 W CN2023084551 W CN 2023084551W WO 2023197862 A1 WO2023197862 A1 WO 2023197862A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
image file
snapshot
terminal
file
Prior art date
Application number
PCT/CN2023/084551
Other languages
French (fr)
Chinese (zh)
Inventor
龙小斌
Original Assignee
广州视源电子科技股份有限公司
广州视睿电子科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州视源电子科技股份有限公司, 广州视睿电子科技有限公司 filed Critical 广州视源电子科技股份有限公司
Publication of WO2023197862A1 publication Critical patent/WO2023197862A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Definitions

  • Embodiments of the present application relate to the field of cloud desktop technology, and in particular, to an image management method, device, server, terminal and storage medium.
  • Cloud desktop also known as desktop virtualization and cloud computer, is a new model that replaces traditional computers. It uses virtualization technology to virtualize various physical devices, thereby effectively improving resource utilization and saving costs. , improve application quality.
  • IDV Intelligent Desktop Virtualization
  • IDV uses distributed computing and distributed storage, with the characteristics of centralized management and local execution, that is, using the local computing and storage resources of the terminal, so that even if there is a problem with the network connecting to the server, the normal use of the cloud desktop can be guaranteed.
  • the image file of the cloud desktop needs to be distributed to the terminal.
  • the image file records the operating system, device drivers, applications, etc. required to run the cloud desktop.
  • the server needs to re-deliver the updated image file to the terminal.
  • the image file has a large memory.
  • the image file needs to be frequently delivered to the terminal, which consumes more network resources.
  • One embodiment of the present application provides an image management method, device, server, terminal and storage medium to solve the technical problem in related technologies that the server consumes a lot of network resources when delivering image files to the terminal.
  • an embodiment of the present application provides an image management method, which is applied to a server and includes:
  • the first terminal applies a first image
  • the first image includes a first image file and a second image file
  • the first image file records the first terminal
  • the operating system used by Zhongyun Desktop the second image file records device drivers and applications installed based on the operating system;
  • the new second image file is sent to the first terminal, so that the first terminal uses the received second image file.
  • the file replaces the local original second image file and creates a corresponding third image file based on the set second snapshot in the received second image file.
  • the first image also includes the third image file, and the third image file is The third image file records data newly added when the cloud desktop is running in the state of setting the second snapshot;
  • the new second image file and the third image file are sent to the third image file.
  • a terminal so that the first terminal uses the received second image file to replace the local original second image file, and the third image file is generated based on the second snapshot of the settings in the new second image file. .
  • an embodiment of the present application also provides an image management method, applied to a first terminal, where the first terminal applies a first image, and the first image includes a first image file and a second image file,
  • the first image file records the operating system used by the cloud desktop in the first terminal, and the second image file records device drivers and applications installed based on the operating system, including:
  • the first image also includes the third image file.
  • the third image file records the location of the cloud desktop. The data added when running in the second snapshot state is set as described above;
  • the third image file is generated based on the set second snapshot in the new second image file
  • an embodiment of the present application also provides an image management device, which is applied to a server and includes:
  • the first receiving unit is configured to receive the first download request sent by the first terminal.
  • the first terminal applies a first image.
  • the first image includes a first image file and a second image file.
  • the first image file The operating system used by the cloud desktop in the first terminal is recorded, and the second image file records device drivers and applications installed based on the operating system;
  • a first sending unit configured to send the new second image file to the first terminal when the first download request is used to download a new second image file from the server, so that the first
  • the terminal uses the received second image file to replace the local original second image file and creates a corresponding third image file based on the set second snapshot in the received second image file.
  • the first image also includes the third image file. Three image files, the third image file records data newly added when the cloud desktop is running in the state of setting the second snapshot;
  • a second sending unit configured to, when the first download request is used to download a new second image file and the corresponding third image file from the server, send the new second image file and the corresponding third image file to the server.
  • the image file is sent to the first terminal, so that the first terminal uses the received second image file to replace the local original second image file, and the third image file is based on the new second image file.
  • the second snapshot of the settings is generated.
  • an embodiment of the present application also provides an image management device, applied to a first terminal, the first terminal applies a first image, and the first image includes a first image file and a second image file,
  • the first image file records the operating system used by the cloud desktop in the first terminal, and the second image file records device drivers and applications installed based on the operating system.
  • the device includes:
  • the third sending unit is used to send the first download request to the server of the cloud desktop
  • a first download unit configured to receive the new second image file sent by the server when the first download request is used to download a new second image file from the server;
  • the first replacement unit is used to replace the original local second image file with the received second image file
  • a first creation unit configured to create a corresponding third image file based on the set second snapshot in the received second image file, where the first image also includes the third image file, and the third image file records There is data newly added when the cloud desktop is running in the state of setting the second snapshot;
  • a second download unit configured to receive the new second image file sent by the server when the first download request is used to download a new second image file and the corresponding third image file from the server. and the third image file, the third image file is generated based on the set second snapshot in the new second image file;
  • the second replacement unit is used to replace the original local second image file with the received second image file.
  • an image management server including:
  • Communication module used to implement data communication
  • processors one or more processors
  • Memory used to store one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image management method as described in the first aspect.
  • an image management terminal including:
  • Communication module used to implement data communication
  • processors one or more processors
  • Memory used to store one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image management method as described in the second aspect.
  • an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored.
  • the program is executed by a processor, the image management method as described in the first aspect or the image management method as described in the second aspect is implemented. Described image management method.
  • the server receives the first download request sent by the first terminal, and delivers the second image file of the first image center to the first terminal based on the first download request, so that the first terminal uses the new
  • the second image file replaces the local second image file, so that the first terminal uses the new second image file when the first terminal runs the cloud desktop, and all new data added during the operation of the first terminal is written into the new
  • the technical means of creating a third image file corresponding to the second image file solves the technical problem in related technologies that the server needs to consume a lot of network resources to deliver the image file to the terminal.
  • the server By dividing the image into three levels of files, and when the first terminal downloads a new image file, the server does not need to deliver all the image files, but only the second image file, which reduces the memory for downloading files and saves money. Use network resources and reduce download time. Moreover, since the third image file is a blank file after creation, even if the corresponding third image file needs to be delivered, only a small amount of network resources will be occupied, ensuring the rational use of network resources.
  • Figure 1 is a first schematic diagram of the image file distribution process in related technologies
  • Figure 2 is a second schematic diagram of the image file distribution process in related technologies
  • Figure 3 is a schematic diagram of a mirroring relationship provided by an embodiment of the present application.
  • Figure 4 is a flow chart of an image management method provided by an embodiment of the present application.
  • Figure 5 is a flow chart of an image management method provided by an embodiment of the present application.
  • Figure 6 is an image registration flow chart provided by an embodiment of the present application.
  • Figure 7 is a flow chart of an image management method provided by an embodiment of the present application.
  • Figure 8 is a flow chart of image merging provided by an embodiment of the present application.
  • Figure 9 is a flow chart of an image management method provided by an embodiment of the present application.
  • Figure 10 is an image restoration flow chart provided by an embodiment of the present application.
  • Figure 11 is a flow chart of an image management method provided by an embodiment of the present application.
  • Figure 12 is an image cloning flow chart provided by an embodiment of the present application.
  • Figure 13 is a flow chart of an image management method provided by an embodiment of the present application.
  • Figure 14 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
  • Figure 15 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
  • Figure 16 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
  • Figure 1 is the first schematic diagram of the image file distribution process in related technologies.
  • the terminal that is, the end user
  • the server determines that the download request is legal
  • it sends the basic image file to the terminal.
  • the terminal starts the virtual machine based on the basic image file. , to run cloud desktop.
  • the basic image file is also an image file.
  • the terminal is customized based on the basic image file, it can add its own personalized data during operation.
  • Figure 2 is a second schematic diagram of the image file distribution process in related technologies.
  • the terminal when the terminal needs to download an image file, it sends a download request to the server. After the server determines that the download request is legal, it sends the differential image file to the terminal. The terminal merges the differential image file into the basic image file. After that, the terminal The basic image file starts the virtual machine to run the cloud desktop.
  • the differential image file refers to the image file obtained by using differential technology.
  • the image file when running a cloud desktop based on an image file, the image file usually needs to be updated during the management of the image file. For example, after the server upgrades the image file, the image file needs to be updated. For another example, when a terminal uses a cloud desktop, after filling in its own personalized data into the image file, the image file needs to be updated.
  • scheme 1 to distribute the image file
  • the server upgrades the image file no matter the size of the change, all terminals using the image file need to re-download the full amount of the image file, which consumes a lot of network resources and requires a lot of time. The long download time is not conducive to the unified update of image files by the terminal.
  • Image file which not only requires each terminal to download the complete image file, but also requires the terminal used by the administrator to upload the complete image file, which increases the network resources required for the download and upload process and the transmission time, which is not conducive to the server's use of the image file. manage. At this time, due to the limitations of public network bandwidth, the popularity and application of IDV-type cloud desktops have also been greatly hindered.
  • embodiments of the present application provide an image management method, device, server, terminal and storage medium to ensure reasonable utilization and saving of network resources when managing image files in a scenario where the terminal runs an IDV-type cloud desktop.
  • the transfer takes time.
  • An embodiment of the present application provides an image management method.
  • the image management method can be executed by an image management device.
  • the image management device can be composed of two or more physical entities, or it can be composed of one physical entity.
  • the image management device is an image management server (also called a server).
  • the server can be used as a server of the IDV type cloud desktop to implement image (image) management and provide terminals with the necessary information to run the cloud desktop.
  • Image file can be any terminal that supports virtualization.
  • the terminal can be a personal computer, a tablet computer, an interactive tablet, a mobile phone, etc.
  • virtualization usually means that computing elements run on a virtual basis rather than a real basis. Virtualization technology can expand the capacity of hardware and simplify the reconfiguration process of software.
  • a virtual machine is a way of realizing virtualization.
  • a virtual machine refers to a complete computer system with complete hardware system functions simulated through software and running in a completely isolated environment.
  • terminals run cloud desktops through virtual machines. .
  • Image can also be recorded as an image file, which is a file that the terminal relies on when starting a virtual machine.
  • each image includes three types of image files.
  • the three types of image files can be recorded as: BaseImage, LowerIamge and UpperImage.
  • BaseImage records the operating system, which is used by the cloud desktop.
  • BaseImage records pure operations without operating system applications or additional device drivers.
  • Each image can have an independent BaseImage, or multiple images can share the same BaseImage.
  • the BaseImage is used by the image in the form of a hard link, which can save storage space on the server.
  • the hard link is Refers to one or more file names of a file, that is, multiple file names are used to link to the same file. These file names can be in the same directory or different directories.
  • the BaseImage can be read but will not be modified to protect the BaseImage from damage.
  • LowerImage is a sub-disk of BaseImage, that is, LowerImage is created based on BaseImage and serves as the next-level file of BaseImage.
  • LowerImage records content such as device drivers and applications installed based on the operating system.
  • each Guest image carries an initial LowerImage for different terminal models.
  • the LowerImage contains built-in applications and device drivers when the terminal under the corresponding model runs the operating system. After that, the user can derive his or her own LowerImage based on the initial LowerImage.
  • the LowerImage contains personalized data during the user's use, such as the user's newly installed device drivers, applications, saved files or data, etc.
  • each user can have an independent LowerImage.
  • UpperImage is a sub-disk of LowerImage, that is, UpperImage is created based on LowerImage and serves as a lower-level file of LowerImage.
  • UpperImage records the data newly added when the terminal runs the cloud desktop.
  • the UpperImage can be considered as a blank file, and no user-related data is recorded.
  • the current newly added data is recorded in the UpperImage.
  • the data recorded in the UpperImage can be submitted to the LowerImage to add personalized data during the user's use in the LowerImage.
  • BaseImage, LowerIamge and UpperImage can also be considered as three levels of files included in the image.
  • an image snapshot refers to a restore point of an image file at a certain moment, that is, the image file can be restored from any state to the state corresponding to the snapshot (ie, the restore point).
  • Each snapshot has a corresponding snapshot name.
  • the naming rules for snapshot names are currently not limited. Generally speaking, the snapshot name contains a unique identifier to distinguish each snapshot through the snapshot name.
  • BaseImage, LowerIamge and UpperImage can all create snapshots.
  • Each image file can be searched for its corresponding snapshot list. For example, the snapshot list corresponding to LowerIamge records the name of each snapshot it contains, and LowerIamge can find the required snapshot based on the snapshot list.
  • a unique snapshot is created in BaseImage, and a LowerIamge is created based on the state of BaseImage at the time of the unique snapshot.
  • a LowerIamge is created based on the state of BaseImage at the time of the unique snapshot.
  • multiple snapshots are created in LowerIamge.
  • a Driver snapshot after installing the device driver built into the operating system in the LowerIamge, and install the application built into the operating system (also called a basic application) Create an application snapshot.
  • the LowerImage can be restored to the state when the device driver and application were installed.
  • the terminal's new personalized data can also be written into it, and corresponding snapshots can be created based on the written personalized data.
  • a corresponding UpperImage can be created based on a certain snapshot status of LowerIamge, that is, UpperImage corresponds to a snapshot of LowerIamge. Similar to creating LowerIamge, UpperImage records the snapshot name of its corresponding snapshot in LowerIamge, so as to pass LowerIamge in UpperImage. Find the corresponding LowerIamge based on the snapshot name and determine the corresponding snapshot in LowerIamge.
  • the corresponding UpperImage can be generated. At this time, when the terminal runs the cloud desktop based on the LowerIamge under the snapshot, it can write in the UpperImage that the snapshot is used as the node.
  • the server submits the UpperImage to LowerIamge, that is, writes the personalized data under the corresponding snapshot node to LowerIamge.
  • a new snapshot can be created in LowerIamge, and the corresponding UpperImage can be created again based on the new snapshot.
  • the terminal runs the cloud desktop based on the LowerIamge corresponding to the new snapshot and writes the new data in the UpperImage.
  • the snapshot of LowerIamge is used as a distinction, and the new data added by the terminal is written to the UpperImage corresponding to the snapshot, without modifying BaseImage and LowerIamge in the terminal.
  • each snapshot in LowerIamge corresponds to a version (also called a mirror version or revision). That is, when a new snapshot is created in LowerIamge, it can be considered that a new version is created.
  • switching operations can be achieved by switching different snapshots of LowerIamge.
  • different versions Each version has a corresponding version ID. The version ID is unique. Its specific naming rules are currently not limited.
  • Each version also has a corresponding version UUID (that is, the universal unique identification code of the version).
  • each user has his own independent LowerImage file.
  • each user's version data is stored in his own LowerImage file in the form of a built-in snapshot. Only your own LowerImage files are allowed to be downloaded.
  • Each version of the same user corresponds to a built-in snapshot in LowerIamge.
  • the snapshot name of the built-in snapshot is version UUID. Through the snapshot name of the built-in snapshot, you can determine whether the current corresponding version can be used by the user.
  • each version and the snapshot name of the corresponding snapshot can be associated and recorded in the snapshot list. You can find the corresponding snapshot name through the version. You can find the corresponding LowerIamge through the snapshot name.
  • each version of each image has an associated BaseImage, LowerIamge, and UpperImage.
  • each version has a corresponding version record and version directory, where the version record is used to record metadata (used to describe the attributes of the version) and other contents of the version, and the version directory is used to record its associated BaseImage and LowerIamge, optionally, the version directory can also record its associated UpperImage.
  • BaseImage is linked to the version directory as a hard link, and BaseImage can be shared between different versions.
  • an image can have one or more branches (also called image version branches, branches), a branch can have one or more versions, and each user who uses the image can have an independent branch.
  • branches also called image version branches, branches
  • a branch can have one or more versions
  • each user who uses the image can have an independent branch.
  • Different images or different branches of the same image can share a BaseImage.
  • Figure 3 is a schematic diagram of an image relationship provided by an embodiment of the present application, which exemplarily shows the relationship between images, branches, and versions, as well as the relationship between BaseImage, LowerIamge, and UpperImage.
  • a BaseImage can be used by multiple images through hard links.
  • Figure 3 contains image A and image B.
  • Image A contains branch a
  • image B contains branch b and branch c.
  • Branch a is used by user A, who has an independent LowerIamge (LowerIamgeA).
  • LowerIamgeA includes snapshot A1 (SnapshotA1), snapshot A2 (SnapshotA2) and snapshot A3 (SnapshotA3). Snapshot A1 corresponds to version 1, and snapshot A2 Corresponds to version 2, and snapshot A3 corresponds to version 3. Each snapshot can generate the corresponding UpperImage. It is understandable that Figure 3 is an example to facilitate the description of the corresponding relationship between snapshots and versions. The snapshots included in LowerIamgeA are shown in a dotted box. ,In actual applications, the snapshot is included in LowerIamgeA. Moreover, pointing snapshot A1, snapshot A2 and snapshot A3 to UpperImageA in Figure 3 means that each snapshot will create a corresponding UpperImage, not that the three snapshots share one UpperImage.
  • Branch b is used by user B
  • branch c is used by user c.
  • the relationship between the snapshots, versions, and three types of files corresponding to branch b and branch c is similar to that of branch a, and will not be described in detail at this time.
  • a file chain can be formed between BaseImage, LowerIamge and UpperImage, which can avoid confusion of file relationships between different branches.
  • the terminal For the terminal, its virtual machine needs to have BaseImage, LowerIamge and UpperImage at the same time. Moreover, the virtual machine can be started directly based on the UpperImage, without merging BaseImage, LowerIamge and UpperImage into one file.
  • the server also stores an image table (osimages). There are multiple image records recorded in the image table. Each image record corresponds to an image and is used to record the metadata of the image (used to describe the attributes of the image) and other contents.
  • the BaseImage, LowerIamge and UpperImage stored in the server can be downloaded and used by the terminal.
  • BaseImage, LowerIamge and UpperImage are available for terminal download in the form of seed files, that is, the server can respectively generate the BaseImage seed file corresponding to BaseImage, the LowerIamge seed file corresponding to LowerIamge, and the UpperImage seed file corresponding to UpperImage.
  • the torrent file refers to the P2P download of the torrent file.
  • P2P peer-to-peer
  • P2P peer-to-peer
  • the users mentioned above refer to users who use terminals.
  • One user can use different terminals, one terminal can be used by multiple users, and each user can be distinguished by the user ID used when logging in.
  • Figure 4 is a flow chart of an image management method provided by an embodiment of the present application.
  • the server executes the image management method, it may include:
  • Step 110 Receive the first download request sent by the first terminal.
  • the first terminal applies the first image.
  • the first image includes a first image file and a second image file.
  • the first image file records the cloud desktop used by the first terminal. operating system, the second image file records device drivers and applications installed based on the operating system.
  • the server provides services for a terminal to describe how the server implements image management.
  • the terminal where the server provides services is recorded as the first terminal.
  • the image used by the first terminal is recorded as the first image, that is, the first terminal runs the cloud desktop through the first image.
  • the BaseImage, LowerIamge, and UpperImage used are recorded as the first image file, the second image file, and the third image file respectively.
  • the snapshot in the second image file is recorded as the second snapshot
  • the snapshot in the first image file is recorded as the first snapshot.
  • the first image file contains a unique first snapshot
  • the second image file contains the first snapshot name of the first snapshot
  • the second image file contains at least one second snapshot
  • the third image file contains the corresponding first snapshot.
  • the second snapshot name of the second snapshot wherein, the snapshot name of the first snapshot is recorded as the first snapshot name
  • the snapshot name of the second snapshot is recorded as the second snapshot name.
  • the second image file used when the first terminal runs the cloud desktop corresponds to one version
  • the third image file used is generated based on the corresponding snapshot of the version in the second image file.
  • the first image has at least one version recorded in the server.
  • Each version corresponds to a second snapshot in the second image file and is associated with the second image file, the first image file corresponding to the first snapshot name in the second image file, and Each version of the third image file corresponding to the second snapshot has a corresponding version ID.
  • running the first image on the first terminal can be considered as running a branch of the first image.
  • the first image is recorded in the server with at least one image branch, each image branch includes at least one version, and the first terminal applies one image branch of the first image.
  • the first image run by the terminal may be specifically a version under the image branch. In this case, the first image ID mentioned later may also be considered as the ID of the image branch in the first image.
  • the first terminal Before the first terminal runs the cloud desktop for the first time, it needs to download the first image file and the second image file from the server, and then create a third image file based on its own actual determination or download the third image file from the server.
  • the third image file can be created in combination with the second snapshot corresponding to the current version.
  • the server can generate the third image file and deliver it to the first terminal.
  • the first terminal runs the virtual machine based on the first image file, the second image file and the third image file, and runs the cloud desktop through the virtual machine.
  • the first terminal When the first terminal has a need for version update, a corresponding download request is generated, and a corresponding second image file is obtained from the server based on the download request, so as to implement version update based on the second image file.
  • the download request generated by the first terminal is recorded as the first download request.
  • the first image file and the second image file have been stored locally, and the second image file may record the user's personalized data, or may not have the user's personalized data added.
  • the method of generating the first download request is currently not limited.
  • the server determines that the version of the second image file is updated (that is, a new version is generated), it sends a notification of the version update to the first terminal using the second image file, and then , the user of the first terminal can determine whether to update the version based on the notification, and when determining to update the version, generate a first download request and send it to the server.
  • a first download request is generated and sent to the server.
  • the server can complete the creation of the restore point through the first terminal.
  • the first terminal generates the first download request, and Send to the server, or the first terminal generates a first download request before uploading the third image file, and sends the third image file and the first download request to the server together.
  • the first download request is divided into two types. One type is used to download the second image file from the server. At this time, the first The terminal can create a third image file locally based on the second image file. Another type is used to download the second image file and the third image file from the server. It is understandable that when the first terminal has the function of creating a third image file first, it can also choose to download the third image file from the server.
  • the server After the server receives the first download request, it parses it and determines that it is used to download the second image file, and then executes step 120 to determine that it is used to download the second image file. image file and the third image file, perform step 130.
  • the first terminal writes an identifier of whether the first terminal can generate the third image file in the first download request, so that the server determines whether the third image file needs to be sent based on the identifier.
  • the server pre-records the terminal model that can locally generate the third image file.
  • the terminal model of the first terminal is written in the first download request, and the server determines the first download request based on the first download request. The terminal model in the request determines whether a third image file needs to be sent.
  • the server can also have the function of creating a third image file.
  • the first download request is only used to download a new second image file from the server, or the terminals provided by the server can Each terminal does not have the function of creating a third image file.
  • the first download request is only used to download a new second image file and the corresponding third image file from the server.
  • the server may generate the third image file regardless of whether the terminal has the function of creating the third image file. In this case, the first download request is only used to download a new second image file from the server.
  • Step 120 When the first download request is used to download a new second image file from the server, send the new second image file to the first terminal, so that the first terminal uses the received second image file to replace the local original image file.
  • the second image file is a second image file and a corresponding third image file is created based on the second snapshot of settings in the received second image file.
  • the first image also includes a third image file, and the third image file records the settings of the cloud desktop in the third image file. Data newly added when running in the second snapshot state.
  • the second image file downloaded by the first terminal from the server and the local original second image file can be considered as different versions of the same second image file. There are differences in the contents of the second image file under different versions. This is In order to facilitate the distinction, the downloaded second image file is recorded as the new second image file.
  • the first download request is used to download a new second image file from the server.
  • the server parses it to find the new second image file that needs to be downloaded.
  • the first download request may include the version ID that currently needs to be downloaded.
  • the version ID that currently needs to be downloaded may be issued by the server to the first terminal.
  • the server performs a version update
  • the current version The ID is sent to the first terminal.
  • the version ID that currently needs to be downloaded can be selected by the user of the first terminal. For example, after logging in, the user of the first terminal can search the server for each version corresponding to the second image file currently used in the first image. , and then select the version that currently needs to be downloaded.
  • the server can display to the user the versions that are available for the user, while the versions that are not available for the user will not be displayed, or the server can Set different permissions for different users. Only users with specific permissions can perform version search.
  • the server obtains the version ID and searches for the second image file associated with the corresponding version as the new second image file.
  • the first download request may include the image ID of the first image.
  • the server finds the latest version of the second image file in the first image for use by the first terminal according to the image ID, and adds the The second image file associated with the latest version is used as the new second image file.
  • the first download request may include the image ID and the version ID.
  • the server finds the new second image file based on the image ID and the version ID.
  • the first download request includes a user ID
  • the server determines the first image used by the first terminal based on the user ID, and uses the latest version of the second image file in the first image for use by the first terminal as the new third image.
  • Two image files. The server can also determine the new second image file through other methods.
  • the server delivers the new second image file to the first terminal.
  • the first terminal uses the new second image file to replace the original local second image file to implement version updating.
  • the third image file corresponding to the current version needs to be used to record the data newly added when the first terminal runs the cloud desktop based on the current version.
  • the first terminal obtains the second image file corresponding to the current version. a second snapshot, and generate a third image file based on the second snapshot, that is, the third image file is generated based on the second snapshot set in the second image file (currently the second snapshot corresponding to the updated version). After that, the first terminal can run the cloud desktop based on the current version.
  • the original version of the first terminal may also have a corresponding third image file.
  • the user can determine whether the data recorded in the original third image file needs to be discarded before the version is updated. If so, then You can directly delete the third image file locally, that is, give up modifications to the original version; if you do not need to give up, you can upload the third image file to the server first, and the server will submit the third image file to the corresponding second image. file, and then the server creates a new version based on the submission result, and the second image file corresponding to the new version can be used as a new second image file for the first terminal to download. After the first terminal uploads the third image file, it can delete the local third image file, or associate and save the third image file with the corresponding version, or the server can associate and save the third image file with the corresponding version.
  • Step 130 When the first download request is used to download the new second image file and the corresponding third image file from the server, send the new second image file and the third image file to the first terminal, so that the first The terminal uses the received second image file to replace the local original second image file, and the third image file is generated based on the set second snapshot in the new second image file.
  • the third image file is generated in the server.
  • the server when the server creates a snapshot (ie, a version) of the second image file, it generates a third image file corresponding to the version, and when receiving the first download request, combines the second image file and the corresponding third image file. The three image files are sent to the first terminal together.
  • the server parses the first download request after receiving it to find the new second image file that needs to be downloaded and the corresponding third image file.
  • the corresponding third image file can be searched according to the version of the new second image file.
  • the server sends the found new second image file and the corresponding third image file to the first terminal.
  • the first terminal uses the new second image file to replace the original local second image file to update the version, and then runs the cloud desktop based on the current version. And write the newly added data into the third image file corresponding to the current version.
  • the original version of the first terminal may also have a corresponding third image file.
  • the processing of the third image file refer to the relevant description in step 120, which will not be described again at this time.
  • the server receives the first download request sent by the first terminal, and delivers the second image file of the first image center to the first terminal based on the first download request, so that the first terminal uses the new second image file to replace
  • the local second image file enables the first terminal to use the new second image file when the first terminal runs the cloud desktop, and the new data added during the operation of the first terminal is written into the new second image file corresponding to
  • the technical means of the third image file solves the technical problem in related technologies that the server needs to consume a lot of network resources to deliver the image file to the terminal.
  • the server By dividing the image into three levels of files, and when the first terminal downloads a new image file, the server does not need to deliver all the image files, but only the second image file, which reduces the memory for downloading files and saves money. Use network resources and reduce download time. Moreover, since the third image file is a blank file after creation, even if the corresponding third image file needs to be delivered, only a small amount of network resources will be occupied, ensuring the rational use of network resources.
  • the image in the server needs to be registered before it can be used by the terminal.
  • the first image is taken as an example to describe the image registration process.
  • Figure 5 is a flow chart of an image management method provided by an embodiment of the present application. It is a specific process when the server performs image registration and management. Referring to Figure 5, the image management method includes:
  • Step 210 Obtain the first image file and the second image file.
  • first image file and the second image file After the first image file and the second image file are created, they need to be uploaded to the server first for server registration.
  • the first image file and the second image file can be uploaded separately or at the same time to create the first image file.
  • the first image file and the second image file currently uploaded can be considered as the initial BaseImage and the initial LowerImage respectively.
  • the second image file is created based on the first image file.
  • the process of uploading the first image file and the second image file can also be considered as the process of the server obtaining the first image file and the second image file.
  • Step 220 Hard link the first image file and the second image file to the first image respectively.
  • the first image file and the second image file are hard-linked to the first image respectively, that is, the first image file and the second image file currently used by the first image are clearly defined. It is understood that if the second image file is used by a branch, then when the first image file and the second image file are hard-linked to the first image, they can be connected to the branch to which they belong. Later, when a new branch of the first image is created, the image metadata of the first image can be updated based on the second image file used by the new branch, and then the first image text and the second image file used by the new branch can be updated. Hard link to the first image (specifically the new Branch) in.
  • hard linking the first image file and the second image file to the first image respectively also includes: creating an image record of the first image, and adding image metadata of the first image to the image record.
  • the image metadata of the first image describes the attributes of the first image.
  • the image metadata records the branches included in the first image and the user ID corresponding to each branch.
  • the image metadata may be determined based on the first image file and the second image file.
  • the image metadata is recorded in the image record.
  • a mirror record of the first mirror is created, the mirror record is added to the mirror table, and then the mirror metadata of the first mirror is added to the mirror record.
  • the image metadata in the image record is also updated simultaneously.
  • the above process can also be considered as the image registration process.
  • Step 230 Create a corresponding version directory based on the initial second snapshot of the second image file, and hard-link the first image file and the second image file to the version directory respectively to obtain the first image.
  • the first image file contains a unique first snapshot.
  • the file name of the first image file is changed to the first snapshot name of the first snapshot.
  • the first snapshot name is recorded.
  • create an initial second snapshot after the second image file is created.
  • the second image file contains the device drivers and applications built into the operating system.
  • the user can derive his or her own second image file based on the second image file.
  • the first image file and the initial second image file (which only contains device drivers and vendor-built applications and generates a second snapshot) can be created by the vendor of the first image and uploaded to the server. Subsequent users generate their own snapshots based on the second image file (this time, including personalized data, such as application upgrade patches).
  • the version ID can be determined, and when creating a version directory, the version ID corresponding to the version directory can be recorded to associate the version with the version directory.
  • both the first image file and the second image file are added in the version directory in the form of hard links.
  • the first image file it is first hard-linked to the first image, and then the first image file in the first image is hard-linked to the version directory, and the second image file and the first image file are The hard connection process is similar and will not be described in detail at this time.
  • the terminal downloads the corresponding image through the seed file, after hard linking the first image file and the second image file to the version directory, it is also necessary to create corresponding P2P images for the first image file and the second image file respectively. Download the torrent file to enable the terminal to download.
  • when creating a corresponding version directory based on the initial second snapshot of the second image file it also includes: creating a version record corresponding to the initial second snapshot, and recording the version corresponding to the initial second snapshot in the version record. Version metadata.
  • a version record is also created.
  • the version record can also be associated with the version through the version ID.
  • the version metadata of the version is determined based on the first image file and the second image file used in the version.
  • the version metadata may include user ID, version ID, pre-order version ID, etc.
  • the pre-order version refers to the previous version of the current version, that is, the version before the current version is created in the second image file.
  • Version metadata can be updated in conjunction with version attributes. Afterwards, the version metadata is added to the version record corresponding to the version.
  • step 240 is also included after step 230.
  • Step 240 Create a corresponding third image file based on the initial second snapshot.
  • the server creates a corresponding third image file based on the initial second snapshot.
  • a feasible method is to change the file name of the second image file to the snapshot name of the initial second snapshot, so as to record the snapshot of the second snapshot in the third image file when creating the third image file. name.
  • the implementation method of adding the third image file to the version directory is currently not limited.
  • the first terminal Before the first terminal runs the cloud desktop for the first time, it needs to download the first image file of the first image, the initial second image file, and the third image file corresponding to the initial second image file from the server (currently downloading the seed file , and then obtain the corresponding image file based on the seed file). During subsequent updates, there is no need to download the first image file again.
  • the third image file can also be created by the first terminal.
  • the first terminal may notify the server so that the server adds the third image file in the corresponding version directory.
  • Figure 6 is an image registration flow chart provided by an embodiment of the present application. Referring to Figure 6, it shows the process of image uploading and registration as well as the processing method of image files under each process.
  • image upload is performed first, that is, the required files are uploaded.
  • Figure 6 takes the first image file and the second image file as an example.
  • the server obtains the first image file and the second image file respectively.
  • image registration image metadata of the first image is generated, and the corresponding file processing method is to hard-link the first image file and the second image file to the first image respectively.
  • the initial restore point refers to the initial second snapshot of the second image file.
  • the corresponding file processing method is to create a version directory of the corresponding version and register the image.
  • the first image file and the second image file hard-linked during the process are hard-linked to the version directory respectively.
  • a corresponding third image file is created based on the initial second snapshot of the second image file.
  • the first terminal after downloading the first image file and the initial second image file, the first terminal builds the first image file and the initial second image file.
  • image files can be reused through hard links, and the first image file and the second image file are uploaded and registered independently, which facilitates subsequent image management. For example, when the version is updated, only modifications are required. The second image file does not need to modify the first image file.
  • image merging management when the server is managed, image merging management is also required.
  • Image merging can be understood as writing the user personalized data recorded in the UpperImage into the corresponding LowerImage, so as to add the user's data in the LowerImage.
  • Personalized data Currently, the first image is taken as an example to describe the image merging process. Among them, the first image is recorded in the server with a corresponding snapshot list. The snapshot list records each version of the first image and the second snapshot corresponding to each version. Optionally, the snapshot list records each version ID and the corresponding second snapshot. Snapshot name.
  • Figure 7 is a flow chart of an image management method provided by an embodiment of the present application. It is a process when the server performs image merge management. Referring to Figure 7, the image management method includes:
  • Step 310 Receive the third image file uploaded by the first terminal.
  • the new data ie, the user's personalized
  • the first terminal installs a new application or a new application in the cloud desktop.
  • new applications and new device drivers are written into the third image file.
  • the first terminal stores new files and data in the cloud desktop
  • the new files or data are written into the third image file. in the file.
  • the third image file can be uploaded to the server.
  • an image merging request can also be sent. to enable the server to perform image merging.
  • the server before merging images, the server first determines the first image used by the first terminal, and then locks the first image.
  • the technical means used to determine the first image used by the first terminal are not currently limited.
  • the server when the first terminal uploads the third image file, it informs the server of the first image used by itself.
  • the server records Each terminal using each image, when the first terminal uploads the third image file, informs the first terminal of its identity data (such as user ID, etc.), and then The server determines the first image used by the first terminal based on the identity data.
  • the purpose of locking the first image is to prohibit the first image from being downloaded. At this time, each terminal cannot download various sub-files included in the first image.
  • the third image file already contains the second snapshot name, and the server can find the corresponding version, the second image file, and other contents based on the second snapshot name. Therefore, the first terminal does not need to perform version verification before uploading the third image file.
  • the third image file can be uploaded in a differential manner.
  • Step 320 Obtain the current version ID of the first image in the first terminal.
  • the server determines the version ID currently used by the first terminal, that is, the ClientRevisionId. For example, when the first terminal uploads the third image file, the server can directly obtain the version ID by uploading the version ID. Another example is, after the first terminal uploads the third image file, the server obtains the records in the third image file by parsing the third image file. The second snapshot name of the second snapshot, and then, based on the second snapshot name, search the corresponding version in the snapshot list to obtain the version ID. For example, the server parses the version metadata corresponding to the version currently used by the first terminal to obtain the version ID. The version ID is obtained from the metadata, where the server can search for the version record of the version currently used by the first terminal, and then obtain the version ID based on the version metadata in the version record.
  • Step 330 Search for the second image file corresponding to the version ID.
  • each data stored in the server can be stored in a database, that is, BaseImage, LowerImage, and UpperImage are all stored in the database.
  • the server After the server obtains the version ID, it searches for the corresponding second image file in the database based on the version ID.
  • the corresponding version directory can be found according to the version ID, and the Client UpperIamge Path and LowerIamge Path can be obtained according to the records in the version directory. Or, obtain the corresponding second snapshot name based on the version ID, and obtain the Client UpperIamge Path and LowerIamge Path based on the second snapshot name. After that, the corresponding second image file can be obtained according to the LowerIamge Path.
  • Step 340 Submit the third image file to the second image file to obtain a new second image file.
  • the data recorded in the third image file is written into the second image file in the form of information blocks to achieve image merging.
  • the submission of the third image file to the second image file can also be considered as a commit process.
  • the third image file is submitted to the second image file, it can be considered that the second image file has been updated.
  • the submitted second image file is recorded as the new third image file. Two image files.
  • step 340 may include steps 341 to 343:
  • Step 341 Restore the second image file to the second snapshot corresponding to the third image file.
  • the corresponding second snapshot is determined according to the second snapshot name recorded in the third image file, and then the second image file is restored to a state corresponding to the second snapshot.
  • Step 342 Rename the restored second image file so that the second image file uses the second snapshot name of the second snapshot.
  • the file name of the second image file is modified to the second snapshot name of the new second snapshot, so as to clarify the version currently used by the second image file.
  • Step 343 Submit the third image file to the renamed second image file.
  • Step 350 Create a new second snapshot in the new second image file.
  • the new second image file adds the user's personalized data, and then a new second snapshot is created for the second image file for subsequent needs.
  • creating a new second snapshot generate a snapshot name for the new second snapshot.
  • creating a new snapshot can also be understood as creating a new version. At this time, you can create a new version record and version directory, add new version metadata to the new version record, and add new version metadata to the version directory. The first image file, second image file and third image file corresponding to this version are recorded in.
  • each UpperIamge has a unique identifier. Different UpperIamges can be distinguished through the unique identifier.
  • the unique identifier can be generated when the UpperIamge is created.
  • the first terminal uploads the third image file, it provides a unique identifier of the third image file.
  • the second image file creates a corresponding new second snapshot, the unique identifier can be used as the corresponding second snapshot name. That is, the requirement for uniqueness of the second snapshot name is met.
  • steps 360 to 370 are also included:
  • Step 360 Delete the third image file.
  • the third image file can be deleted.
  • the first terminal may be notified to delete the third image file.
  • Step 370 Create a new third image file based on the new second snapshot.
  • a new second snapshot is created in the new second image file. Therefore, a new third image file needs to be created based on the new second snapshot to use the new second image file on the first terminal. Record the newly added data in the new third image file. It can be understood that the new third image file contains the snapshot name of the new second snapshot.
  • step 380 may also be included.
  • Step 380 Update the snapshot list and update the image metadata in the image record.
  • the snapshot list of the first image is updated to add the new second snapshot and the version corresponding to the new second snapshot in the snapshot list.
  • corresponding seed files can be created for the new second image file and the new third image file respectively for the first terminal to download.
  • updating the image record can be performed after creating the seed file.
  • the first image After updating the image metadata of the first image, the first image is unlocked for download by the first terminal.
  • the server notifies the first terminal of a version update.
  • the first terminal After that, the first terminal generates a first download request for downloading the new second image file and the corresponding third image file and sends it to the server.
  • the new second image file and the corresponding third image file are sent to the first terminal for use by the first terminal.
  • this step can also be performed after creating a new second snapshot in the new second image file.
  • Figure 8 is an image merging flow chart provided by an embodiment of the present application.
  • the version metadata i.e. ClientRevisionmeta
  • the clientRevisionID the version ID used by the terminal
  • the clientRevisionID is retrieved from the database based on the ClientRevisionID.
  • Find the Client UpperImage Path that is, the path of the third image file used by the terminal
  • the LowerImage Path that is, the path of the second image file.
  • the newly added data when the first terminal runs the cloud desktop is written to the third image file, and the first image file and the second image file will not be modified. Therefore, when there is a need for image merging on the first terminal or server, You only need to upload the local third image file to the server, and then the server submits the third image file to the second image file. This reduces the amount of data uploaded by the first terminal, improves upload speed and efficiency, and saves network resources. , thereby improving the efficiency and speed of image merging.
  • FIG. 9 is a flow chart of an image management method provided by an embodiment of the present application. It is a process when the server performs image restoration management. Referring to the figure, the image management method includes:
  • Step 410 Receive the image restoration instruction.
  • the image restoration instruction is used to instruct the server to perform image restoration, which can be generated at the terminal or at the server.
  • the server When the server generates the image restoration instruction, the user of the server (such as an administrator with certain permissions) can select The LowerImage that needs to be restored and the version that needs to be restored. After that, the server generates an image restoration instruction based on the selection, and then receives the image restoration instruction.
  • the image restoration instruction is used to restore the second image file in the first image as an example for description.
  • the server determines to perform image restoration and locks the first image used by the first terminal.
  • the process of locking the first image can refer to the process of locking the first image in step 310, which is not currently performed. Repeat.
  • Step 420 Obtain the version ID to be restored according to the image restoration instruction.
  • the version ID to be restored refers to the version ID to which the second image file is expected to be restored.
  • the image restore command includes the version ID to be restored.
  • the server calls the corresponding parameter according to the image restoration instruction to obtain the version ID to be restored through the parameter.
  • the parameter called is presented in the form of a string variable and may include the image ID of the first image, The user ID, version ID and other contents of the first terminal.
  • Step 430 Search the corresponding second image file and the corresponding second snapshot name according to the version ID.
  • each second snapshot corresponds to a version
  • obtain the second snapshot name Corresponds to the second image file where the second snapshot is located.
  • Step 440 Restore the second image file to the corresponding second snapshot according to the second snapshot name.
  • the second image file is restored according to the second snapshot corresponding to the second snapshot name, that is, restored to the state of the second image file when the second snapshot was created.
  • the second image file The user's personalization data added to the file will be deleted.
  • the server creates a third image file. At this time, after step 440, steps 450 and 460 are also included.
  • Step 450 Delete the third image file corresponding to the second image file.
  • the third image file corresponding to the second image file before the change that is, the old third image file needs to be deleted.
  • Step 460 Create a new third image file based on the restored second snapshot.
  • a corresponding third image file is created based on the restored second snapshot, and the third image file can be considered as a new third image file corresponding to the second image file.
  • seed files corresponding to the second image file and the third image file are respectively generated for the first terminal to download.
  • the image record corresponding to the first image in the image table also needs to be updated.
  • it also includes:
  • Step 470 Update the image metadata in the image record.
  • the server can unlock the first image so that the first terminal can download the corresponding seed file.
  • the server can notify the first terminal to complete the image restoration.
  • the first terminal generates the corresponding first download instruction according to the notification from the server and feeds it back to the server, and the server executes the first download instruction.
  • the restored second image file is pushed to the first terminal as a new second image file.
  • the server records the latest version ID of each image, and after the image is restored, changes the latest version ID of the corresponding image to the restored version ID.
  • Figure 10 is a flow chart of an image restoration provided by an embodiment of the present application.
  • first lock the corresponding image and then parse the parameters of the call (i.e. Parse Args) to get the ImageID and RevisionID.
  • LowerImage is restored to the corresponding target Snapshot.
  • delete the old UpperImage create a new UpperImage, create seed files for LowerImage and UpperImage respectively, update the image record in the image table, unlock the image, and resume the download of the image to complete the image restoration.
  • FIG. 11 is a flow chart of an image management method provided by an embodiment of the present application. It is a process when the server performs image cloning management. Referring to the figure, the image management method includes:
  • Step 510 Receive an image cloning instruction, which is used to clone the first image.
  • the image cloning instruction is used to instruct the server to perform image cloning.
  • the first image is used as the cloned image.
  • the image clone instruction can be considered as being used to clone the first image.
  • the image cloning instruction may be issued by the user in the first terminal or server, or may be issued by the administrator of the image in the server.
  • write the ID of the restored image in the image restore command so that the server can determine the restored image (currently, the image restore command writes The image ID of the first image).
  • the image restore command can also include the ID of the version that needs to be cloned.
  • the user's personalized data may be recorded in the first image, for data security, only administrators with certain permissions can issue image cloning instructions, or only users can use the second image for themselves. Clone an image.
  • Step 520 Clone the first image file and the second image file included in the first image to obtain a second image, and the second image is the cloned image.
  • the image cloned based on the first image is recorded as the second image.
  • the first image file used in the first image since the first image file used in the first image only records the operating system and will not be modified during use, the first image file can be shared by the second image.
  • the first image Files can be linked to the secondary image via hard links.
  • the second image file in the first image can be copied to the second image, and then a corresponding third image file can be created based on the second image file to ensure that the third image file is used through the three levels of image files. The second image is used normally.
  • step 510 may include steps 511 to 516:
  • Step 511 Generate an image record and a version directory of the second image according to the image cloning instruction, and record the image metadata of the first image in the image record of the second image.
  • image registration that is, create an image record and version directory of the second image, and also create a version record of the second image.
  • image metadata of the first image is first written in the image record of the second image.
  • Step 512 Create a hard link to the first image file in the first image in the version directory.
  • the second image and the first image share the first image file. Therefore, the first image file is connected to the second image in a hard link. Currently, the first image file is hard linked to the second image. version directory.
  • Step 513 Copy the second image file in the first image to the version directory.
  • each image needs to have its own LowerImage
  • when cloning copy the second image file used in the first image and paste it in the version directory of the second image to clarify the second image
  • the second image file used It can be understood that the currently copied second image file includes all current second snapshots.
  • Step 514 Keep the target version in the copied second image file and delete other second versions.
  • the target second version is determined through the image cloning instruction.
  • the initialized second image file can be considered as the initial second image file in the second image.
  • the metadata corresponding to the target version can be processed in the version record of the second image. Record.
  • the version directory mentioned in steps 511 to 513 can be considered as the version directory corresponding to the target version.
  • the server generates the third image file. Therefore, after step 514, it may also include: creating a corresponding third image file based on the target version.
  • a corresponding third image file is created based on the second image file in the second image.
  • the third image file corresponds to the target version of the second image file, that is, the third image file contains the second image file corresponding to the target version.
  • the second snapshot name of the snapshot is the second snapshot name of the snapshot.
  • seed files of the second image file and the third image file are respectively created for the terminal to download. It is understandable that when the terminal downloads the image for the first time and the downloaded image is the second image, the server passes the hard disk in the version directory. The link can find the first image file and send the seed file of the first image file to the terminal for use by the terminal.
  • Step 515 Update the image metadata in the image record of the second image.
  • the image metadata of the first image recorded in the image record will also change after the second image file is initialized. Therefore, the image metadata is currently based on the initialized
  • the second image file updates the image metadata in the image record of the second image.
  • the second image may contain multiple states to indicate the current clone node of the second image through different states.
  • the image record and version directory of the second image are generated according to the image cloning instruction. When, it also includes: marking the second image as waiting for cloning. When updating the image metadata in the image record of the second image, it also includes: marking the second image as a completed clone state.
  • the waiting clone state refers to the state waiting for cloning to start
  • the completed clone state refers to the state when the clone is completed and can be used.
  • the cloning status can also be included, which means that cloning is in progress.
  • mark the second image when generating the image record and version directory of the second image, mark the second image as waiting for cloning, and when copying the second image file in the first image to the version directory, mark the second image as waiting for cloning.
  • the cloning state of the second image is changed to the completed cloning state.
  • Figure 12 is an image cloning flow chart provided by an embodiment of the present application.
  • the image metadata which is the image metadata of the new image obtained after cloning, and generate the image record, initial version record and initial version directory of the new image.
  • the new image In waiting state (waiting).
  • copy the LowerImage of the source image to the initial version directory initialize the copied LowerImage, and retain the target version.
  • based on LowerImage creates UpperImage creates seed files for LowerImage and UpperImage respectively, updates the image record in the image table, and changes the new image to the clone completion status to complete the image cloning.
  • the image management device in addition to a server, can also be an image management terminal.
  • the terminal can also be considered as a terminal for users.
  • the terminal can be a personal computer, a tablet computer, an interactive tablet, a mobile phone, etc.
  • the terminal implements a cloud desktop by running a virtual machine.
  • the image required when the terminal is running can be obtained from the server.
  • the image management method can be implemented.
  • the first terminal is taken as an example to describe how the terminal performs the image management method.
  • Figure 13 is a flow chart of an image management method provided by an embodiment of the present application. Referring to Figure 13, when the first terminal executes the image management method, it may include:
  • Step 610 Send the first download request to the server of the cloud desktop.
  • the first terminal applies a first image.
  • the first image includes a first image file and a second image file.
  • the first image file records the operating system used by the cloud desktop in the first terminal, and the second image file records Device drivers and applications installed based on the operating system.
  • the first terminal After generating the first download request, the first terminal sends the first download request to the server.
  • step 620 is executed.
  • step 650 is executed.
  • Step 620 When the first download request is used to download a new second image file from the server, receive the new second image file sent by the server.
  • Step 630 Use the received second image file to replace the original local second image file.
  • the new second image file sent by the server is used as the second image file for local use.
  • the first terminal considers that the version has been changed.
  • the initial second image file can always be saved locally, and other versions of the second image file can be saved in the first terminal or deleted in the first terminal as versions are replaced.
  • Step 640 Create a corresponding third image file based on the setting of the second snapshot in the received second image file.
  • the first image also includes a third image file.
  • the third image file records that the cloud desktop is setting the second snapshot. Data added when running in the state.
  • the latest second snapshot in the received second image file is used as the set second snapshot, and a corresponding third image file is created locally based on the set second snapshot. After that, run the cloud desktop.
  • Step 650 When the first download request is used to download the new second image file and the corresponding third image file from the server, receive the new second image file and the third image file sent by the server, and the third image file is based on the new The second snapshot is generated based on the settings in the second image file.
  • Step 660 Use the received second image file to replace the original local second image file.
  • the first terminal needs to update the first image, it only needs to obtain the new second image file from the server and replace it. There is no need to obtain the first image file, which solves the problem in the related technology that the server delivers the image file to The terminal needs to consume more network resources due to technical issues.
  • the third image file is a blank file after creation, even if the corresponding third image file needs to be downloaded, it only takes up very few network resources, ensuring the rational use of network resources.
  • the first terminal can submit the newly added data during the operation of the local cloud desktop to the second image file for version upgrade (ie, image merging).
  • the first terminal executes the image management method When running, it may also include: running the cloud desktop based on the local existing first image file, second image file and corresponding third image file, and writing the newly added data into the third image file during the running process;
  • the third image file is uploaded to the server, so that the server submits the third image file to the corresponding second image file.
  • the first terminal when the first terminal starts the virtual machine, it needs to have the first image file, the second image file and the third image file, and the virtual machine is started directly based on the third image file, without merging the three types of files, and in the virtual machine
  • the cloud desktop is running on the computer
  • the newly added data is recorded in the third image file.
  • the user needs to create a restore point for the current running status while running the cloud desktop, that is, create a new version
  • the user can send the currently used third image file to the server and instruct the server to merge the images.
  • the server will follow the instructions. Submit the third image file to the corresponding second image file.
  • the server notifies the first terminal that the merger is completed.
  • the first terminal can generate a first download instruction based on the server's notification to download the second snapshot corresponding to the created restore point. the second image file, and create or download the corresponding third image file from the server based on the actual situation.
  • the third image file is used to write new data
  • the user of the first terminal wants to give up modifying the cloud desktop, he only needs to delete the current third image file and rebuild the third image. file or obtain the third image file from the server, which simplifies the image restoration process in the first terminal.
  • the first terminal writes the newly added data to the third image file and does not modify the first image file and the second image file. Therefore, when creating a new version, only the local third image file needs to be Once the three image files are uploaded to the server, a new version can be created in the server, which greatly reduces the amount of uploaded data and improves upload efficiency.
  • the first terminal can also synchronize the second image file used locally to the second terminal to run the cloud desktop in the first terminal in the second terminal.
  • the first terminal executes the image
  • the management method may also include: receiving a synchronization request sent by the second terminal, and the second terminal uses the same first image file as the first terminal; sending the locally existing second image file to the second terminal, so that the second terminal The second terminal uses the received second image file to replace the original second image file.
  • the second terminal can be a terminal that implements physical cloud desktop drift, that is, the cloud desktop used by the first terminal is moved to the second terminal for use.
  • the second terminal can also be a terminal replaced by the user, that is, the user uses the second terminal. Replaces the currently used first terminal.
  • the second terminal has run the cloud desktop and has stored the first image file and the second image file.
  • the first terminal can send its second image file to the second terminal.
  • the second terminal Use the received second image file to replace its own second image file to ensure that the cloud desktop in the first terminal runs.
  • the second terminal has not run Cloud Desktop.
  • the second terminal can first download the files of each layer contained in the first image from the server, and then replace its own second image with the received second image file. document.
  • the second terminal may create the third image file based on the set version in the received second image file, or the server may create the third image file and send it to the second image file.
  • the first terminal when the first terminal sends the second image file to the second terminal, it can send it directly to the second terminal, or send it to the second terminal through the server.
  • the second image file and the generated third image file can be sent to the second terminal together.
  • the second terminal after the second terminal is synchronized, it can be recorded in the server so that the server can know the image version currently used by the second terminal.
  • FIG 14 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
  • the image management device is applied to a server.
  • the image management device includes: a first receiving unit 701, a first sending unit 702 and a second sending unit 703.
  • the first receiving unit 701 is configured to receive a first download request sent by a first terminal.
  • the first terminal applies a first image.
  • the first image includes a first image file and a second image file.
  • the first image file records the first terminal.
  • the operating system used by Zhongyun Desktop the second image file records device drivers and applications installed based on the operating system;
  • the first sending unit 702 is used to download a new second image from the server when the first download request is made file, sending the new second image file to the first terminal, so that the first terminal uses the received second image file to replace the local original second image file and based on the settings in the received second image file.
  • the snapshot creates a third image file corresponding to the first image.
  • the first image also contains the third image file.
  • the third image file records the data newly added when the cloud desktop is running in the state of setting the second snapshot; the second sending unit is used for When the first download request is used to download the new second image file and the corresponding third image file from the server, the new second image file and the third image file are sent to the first terminal, so that the first terminal uses the receive
  • the second image file replaces the original local second image file, and the third image file is generated based on the second snapshot setting in the new second image file.
  • the first image file contains a unique first snapshot
  • the second image file contains the first snapshot name of the first snapshot
  • the second image file contains at least one second snapshot
  • the third image file contains the corresponding first snapshot.
  • the first image is recorded in the server with at least one version, and each version corresponds to a second snapshot in the second image file and is associated with the second image file and the first snapshot name in the second image file.
  • Each version of the first image file and the third image file corresponding to the second snapshot has a corresponding version ID.
  • the first image is recorded in the server with at least one image branch, each image branch includes at least one version, and the first terminal applies one image branch of the first image.
  • the method further includes: a first acquisition unit, used to acquire the first image file and a second image file; a first linking unit, used to convert the first image file and the second image file are respectively hard-linked to the first image; the second link unit is used to create a corresponding version directory based on the initial second snapshot of the second image file, and hard-link the first image file and the second image file respectively. Go to the version directory and get the first image.
  • the method further includes: a first creation unit configured to create a corresponding third image file based on the initial second snapshot after hard-linking the first image file and the second image file to the version directory respectively.
  • the first link unit is also used to: create a mirror record of the first mirror, and add the mirror metadata of the first mirror to the mirror record; the second link unit is also used to: create an initial second snapshot corresponding to version record, and record the version metadata of the corresponding version of the initial second snapshot in the version record.
  • the system further includes: a second receiving unit for receiving the third image file uploaded by the first terminal; a second obtaining unit for obtaining the current version ID of the first image in the first terminal; and a first search unit. , used to find the second image file corresponding to the version ID; the submission unit is used to submit the third image file to the second image file to obtain a new second image file; the second creation unit is used to create a new second image file in the new image file. Create a new second snapshot in the second image file.
  • the first deletion unit is used to delete the third image file after creating a new second snapshot in the new second image file; the third creation unit is used to create a new image file based on the new second snapshot. Third image file.
  • the submission unit includes: a first restoration sub-unit, used to restore the second image file to the second snapshot corresponding to the third image file; a renaming sub-unit, used to restore the restored second image file Renaming is performed so that the second image file uses the second snapshot name of the second snapshot; the file submission subunit is used to submit the third image file to the renamed second image file.
  • the first image is recorded in the server with a corresponding snapshot list, and the snapshot list records each version of the first image and the second snapshot corresponding to each version; the device further includes: a first update unit, configured to After creating a new second snapshot in the new second image file, update the snapshot list and update the image metadata in the image record.
  • a first update unit configured to After creating a new second snapshot in the new second image file, update the snapshot list and update the image metadata in the image record.
  • the method further includes: a third receiving unit, configured to receive an image restoration instruction; a third acquisition unit, configured to obtain the version ID to be restored according to the image restoration instruction; and a second search unit, configured to search according to the version ID.
  • the corresponding second image file and the corresponding second snapshot name; the second restoration unit is used to restore the second image file to the corresponding second snapshot according to the second snapshot name.
  • the method further includes: a second deletion unit, configured to restore the second image file to the corresponding second snapshot according to the second snapshot name, and then delete the third image file corresponding to the second image file; a fourth creation Unit used to create a new third image file based on the second snapshot restored to.
  • a second deletion unit configured to restore the second image file to the corresponding second snapshot according to the second snapshot name, and then delete the third image file corresponding to the second image file
  • a fourth creation Unit used to create a new third image file based on the second snapshot restored to.
  • the method further includes: a fourth receiving unit, configured to receive an image cloning instruction, which is used to clone the first image; and a cloning unit, configured to clone the first image according to the first image file and the second image contained in the first image.
  • the file is cloned to obtain a second image, and the second image is the cloned image.
  • the cloning unit includes: a generation subunit, configured to generate an image record and a version directory of the second image according to the image cloning instruction, and the image metadata of the first image is recorded in the image record of the second image; a third link The subunit is used to create a hard link to the first image file in the first image in the version directory; the copy subunit is used to copy the second image file in the first image to the version directory; the third deletion subunit is, It is used to retain the target version and delete other versions in the copied second image file.
  • the target version is determined by the image clone instruction; the second update subunit is used to update the image metadata in the image record of the second image.
  • the generation subunit is also used to mark the second image as waiting for cloning; the second update subunit is also used to mark the second image as cloning completed.
  • the image management device provided above can be used to execute the image management method executed by the server provided in any of the above embodiments, and has corresponding functions and beneficial effects.
  • Figure 15 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
  • the image management device is applied to a first terminal.
  • the first terminal applies a first image.
  • the first image includes a first image file and a second image file.
  • the first image file records the operating system used by the cloud desktop in the first terminal.
  • Second mirror The file records device drivers and applications installed based on the operating system.
  • the image management device includes: a third sending unit 801, a first download unit 802, a first replacement unit 803, a first creation unit 804, a second Download unit 805 and second replacement unit 806.
  • the third sending unit 801 is used to send the first download request to the server of the cloud desktop; the first download unit 802 is used to receive the new second image file sent by the server when the first download request is used to download a new second image file from the server. the second image file; the first replacement unit 803 is used to replace the local original second image file with the received second image file; the first creation unit 804 is used to based on the settings in the received second image file
  • the second snapshot creates a corresponding third image file.
  • the first image also includes a third image file.
  • the third image file records the data newly added when the cloud desktop is running in the state of setting the second snapshot; the second download unit 805 , used when the first download request is used to download a new second image file and the corresponding third image file from the server, and receive the new second image file and the third image file sent by the server, and the third image file is based on The second snapshot of the settings in the new second image file is generated; the second replacement unit 806 is configured to replace the original local second image file with the received second image file.
  • it also includes: an operating unit, configured to run the cloud desktop based on the local existing first image file, the second image file and the corresponding third image file, and write the newly added data during the operation process. Enter the third image file; the upload unit is used to upload the third image file to the server, so that the server submits the third image file to the corresponding second image file.
  • the method further includes: a fifth receiving unit, configured to receive a synchronization request sent by a second terminal, which uses the same first image file as the first terminal; and a fourth sending unit, configured to transfer the local existing The second image file is sent to the second terminal, so that the second terminal uses the received second image file to replace the original second image file.
  • the image management device provided above can be used to execute the image management method executed by the first terminal provided in any of the above embodiments, and has corresponding functions and beneficial effects.
  • FIG 16 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
  • the image management device may be an image management server or an image management terminal.
  • the image management device includes a processor 90, a memory 91 and a communication module 92; the number of processors 90 can be one or more, and one processor 90 is taken as an example in Figure 16.
  • the processor 90, the memory 91 and the communication module 92 in the image management device can be connected through a bus or other means. In Figure 16, connection through a bus is taken as an example.
  • the memory 91 can be used to store software programs, computer executable programs and modules, such as program instructions/modules corresponding to the image management method in the embodiment of the present application (for example, the image management device is an image management server When the image management device is the first receiving unit 701, the first sending unit 702 and the second sending unit 703, when the image management device is an image management terminal, the third sending unit 801 and the first downloading unit 802 in the image management device , first replacement unit 803, first creation unit 804, second download unit 805 and second replacement unit 806).
  • the processor 90 executes various functional applications and data processing of the image management device by running software programs, instructions and modules stored in the memory 91, that is, implementing the above image management method.
  • the memory 91 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system and at least one application program required for a function; the stored data area may store data created according to the use of the image management device, etc.
  • the memory 91 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device.
  • the memory 91 may further include memory located remotely relative to the processor 90 , and these remote memories may be connected to the image management device through a network. Examples of the above networks include but Not limited to the Internet, intranet, local area network, mobile communication network and combinations thereof.
  • the communication device 92 is used to implement data communication according to instructions of the processor. For example, when the image management device is a server, it can perform data communication with the terminal. If the image management device is a terminal, it can perform data communication with the server.
  • the image management device may also include an input device and an output device.
  • the input device may be used to receive input numeric or character information and generate key signal input related to user settings and function control of the image management device. It may also include audio input devices such as microphones. .
  • Output devices may include displays, speakers, and other devices.
  • the above image management device includes a corresponding image management device, which can be used to execute the corresponding image management method provided by any embodiment, and has corresponding functions and beneficial effects.
  • one embodiment of the present application also provides a storage medium containing computer-executable instructions.
  • the computer-executable instructions When executed by a computer processor, the computer-executable instructions are used to perform relevant aspects of the image management method provided by any embodiment of the present application. operation, and has corresponding functions and beneficial effects.
  • the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects.
  • the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • the present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions.
  • These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • Memory may include non-volatile memory in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM).
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may be computer-readable instructions, data structures, modules of programs, 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), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape cassettes tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Mirror image management methods, an apparatus, a server, a terminal, and a storage medium. A method comprises: receiving a first downloading request sent by a first terminal, the first terminal using a first mirroring file and a second mirroring file, the first mirroring file recording an operating system used by a cloud desktop in the first terminal, and the second mirroring file recording a device driver and an application program which are installed on the basis of the operating system; and sending a new second mirroring file to the first terminal, so that the first terminal replaces an original local second mirroring file by the received second mirroring file and records in a third mirroring file data which is newly added when the cloud desktop runs in a state of a set second snapshot, the third mirroring file being generated on the basis of the set second snapshot in the new second mirroring file, wherein the third mirroring file may be generated by a server or the first terminal. The method can be used to solve the technical problem in the prior art that a server consumes many network resources when issuing a mirroring file to a terminal.

Description

镜像管理方法、装置、服务器、终端及存储介质Image management method, device, server, terminal and storage medium
本申请要求在2022年04月13日提交中国专利局,申请号为202210385398.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application with application number 202210385398.X, which was submitted to the China Patent Office on April 13, 2022. The entire content of this application is incorporated into this application by reference.
技术领域Technical field
本申请实施例涉及云桌面技术领域,尤其涉及一种镜像管理方法、装置、服务器、终端及存储介质。Embodiments of the present application relate to the field of cloud desktop technology, and in particular, to an image management method, device, server, terminal and storage medium.
背景技术Background technique
云桌面又称桌面虚拟化、云电脑,是替代传统电脑的一种新模式,其利用虚拟技术,对各种物理设备进行虚拟化处理,从而使资源的利用率得到有效提升,以此节约成本、提高应用质量。Cloud desktop, also known as desktop virtualization and cloud computer, is a new model that replaces traditional computers. It uses virtualization technology to virtualize various physical devices, thereby effectively improving resource utilization and saving costs. , improve application quality.
智能桌面虚拟化(Intelligent Desktop Virtualization,IDV)是一种常见的云桌面类型。IDV采用分布式计算和分布式存储,具有集中管理和本地执行的特点,即利用终端本地的计算和存储资源,这样即使连接服务器的网络出现问题,也可以保证云桌面的正常使用。Intelligent Desktop Virtualization (IDV) is a common type of cloud desktop. IDV uses distributed computing and distributed storage, with the characteristics of centralized management and local execution, that is, using the local computing and storage resources of the terminal, so that even if there is a problem with the network connecting to the server, the normal use of the cloud desktop can be guaranteed.
应用IDV时,需要将向终端分发云桌面的镜像文件,该镜像文件中记录有运行云桌面所需的操作系统、设备驱动以及应用程序等内容。一般而言,升级镜像文件时,需要更新镜像文件记录的内容,此时,服务器需要将更新后的镜像文件重新下发至终端。然而,镜像文件具有较大的内存,当镜像文件更新较频繁时,需要频繁将镜像文件下发至终端,这样需要耗费较多的网络资源。When applying IDV, the image file of the cloud desktop needs to be distributed to the terminal. The image file records the operating system, device drivers, applications, etc. required to run the cloud desktop. Generally speaking, when upgrading an image file, the content recorded in the image file needs to be updated. At this time, the server needs to re-deliver the updated image file to the terminal. However, the image file has a large memory. When the image file is updated frequently, the image file needs to be frequently delivered to the terminal, which consumes more network resources.
发明内容Contents of the invention
本申请一个实施例提供了一种镜像管理方法、装置、服务器、终端及存储介质,以解决相关技术中服务器将镜像文件下发至终端需要耗费较多的网络资源的技术问题。One embodiment of the present application provides an image management method, device, server, terminal and storage medium to solve the technical problem in related technologies that the server consumes a lot of network resources when delivering image files to the terminal.
第一方面,本申请一个实施例提供了一种镜像管理方法,应用于服务器,包括:In the first aspect, an embodiment of the present application provides an image management method, which is applied to a server and includes:
接收第一终端发送的第一下载请求,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序;Receive a first download request sent by a first terminal, the first terminal applies a first image, the first image includes a first image file and a second image file, the first image file records the first terminal The operating system used by Zhongyun Desktop, the second image file records device drivers and applications installed based on the operating system;
当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,将新的第二镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件并基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;When the first download request is used to download a new second image file from the server, the new second image file is sent to the first terminal, so that the first terminal uses the received second image file. The file replaces the local original second image file and creates a corresponding third image file based on the set second snapshot in the received second image file. The first image also includes the third image file, and the third image file is The third image file records data newly added when the cloud desktop is running in the state of setting the second snapshot;
当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,将新的第二镜像文件和所述第三镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成。When the first download request is used to download a new second image file and the corresponding third image file from the server, the new second image file and the third image file are sent to the third image file. A terminal, so that the first terminal uses the received second image file to replace the local original second image file, and the third image file is generated based on the second snapshot of the settings in the new second image file. .
第二方面,本申请一个实施例还提供了一种镜像管理方法,应用于第一终端,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序,所述包括:In a second aspect, an embodiment of the present application also provides an image management method, applied to a first terminal, where the first terminal applies a first image, and the first image includes a first image file and a second image file, The first image file records the operating system used by the cloud desktop in the first terminal, and the second image file records device drivers and applications installed based on the operating system, including:
向所述云桌面的服务器发送第一下载请求;Send a first download request to the server of the cloud desktop;
当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,接收所述服务器发送的新的第二镜像文件; When the first download request is used to download a new second image file from the server, receive the new second image file sent by the server;
使用接收的第二镜像文件替换本地原有的第二镜像文件;Use the received second image file to replace the original local second image file;
基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;Create a corresponding third image file based on the set second snapshot in the received second image file. The first image also includes the third image file. The third image file records the location of the cloud desktop. The data added when running in the second snapshot state is set as described above;
当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,接收所述服务器发送的新的第二镜像文件和所述第三镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成;When the first download request is used to download a new second image file and the corresponding third image file from the server, receive the new second image file and the third image file sent by the server , the third image file is generated based on the set second snapshot in the new second image file;
使用接收的第二镜像文件替换本地原有的第二镜像文件。Use the received second image file to replace the local original second image file.
第三方面,本申请一个实施例还提供了一种镜像管理装置,应用于服务器,包括:In a third aspect, an embodiment of the present application also provides an image management device, which is applied to a server and includes:
第一接收单元,用于接收第一终端发送的第一下载请求,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序;The first receiving unit is configured to receive the first download request sent by the first terminal. The first terminal applies a first image. The first image includes a first image file and a second image file. The first image file The operating system used by the cloud desktop in the first terminal is recorded, and the second image file records device drivers and applications installed based on the operating system;
第一发送单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,将新的第二镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件并基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;A first sending unit, configured to send the new second image file to the first terminal when the first download request is used to download a new second image file from the server, so that the first The terminal uses the received second image file to replace the local original second image file and creates a corresponding third image file based on the set second snapshot in the received second image file. The first image also includes the third image file. Three image files, the third image file records data newly added when the cloud desktop is running in the state of setting the second snapshot;
第二发送单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,将新的第二镜像文件和所述第三镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成。A second sending unit configured to, when the first download request is used to download a new second image file and the corresponding third image file from the server, send the new second image file and the corresponding third image file to the server. The image file is sent to the first terminal, so that the first terminal uses the received second image file to replace the local original second image file, and the third image file is based on the new second image file. The second snapshot of the settings is generated.
第四方面,本申请一个实施例还提供了一种镜像管理装置,应用于第一终端,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序,所述装置包括:In the fourth aspect, an embodiment of the present application also provides an image management device, applied to a first terminal, the first terminal applies a first image, and the first image includes a first image file and a second image file, The first image file records the operating system used by the cloud desktop in the first terminal, and the second image file records device drivers and applications installed based on the operating system. The device includes:
第三发送单元,用于向所述云桌面的服务器发送第一下载请求;The third sending unit is used to send the first download request to the server of the cloud desktop;
第一下载单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,接收所述服务器发送的新的第二镜像文件;A first download unit configured to receive the new second image file sent by the server when the first download request is used to download a new second image file from the server;
第一替换单元,用于使用接收的第二镜像文件替换本地原有的第二镜像文件;The first replacement unit is used to replace the original local second image file with the received second image file;
第一创建单元,用于基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;A first creation unit configured to create a corresponding third image file based on the set second snapshot in the received second image file, where the first image also includes the third image file, and the third image file records There is data newly added when the cloud desktop is running in the state of setting the second snapshot;
第二下载单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,接收所述服务器发送的新的第二镜像文件和所述第三镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成;A second download unit configured to receive the new second image file sent by the server when the first download request is used to download a new second image file and the corresponding third image file from the server. and the third image file, the third image file is generated based on the set second snapshot in the new second image file;
第二替换单元,用于使用接收的第二镜像文件替换本地原有的第二镜像文件。The second replacement unit is used to replace the original local second image file with the received second image file.
第五方面,本申请一个实施例还提供了一种镜像管理服务器,包括:In the fifth aspect, an embodiment of the present application also provides an image management server, including:
通信模块,用于实现数据通信;Communication module, used to implement data communication;
一个或多个处理器;one or more processors;
存储器,用于存储一个或多个程序;Memory, used to store one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的镜像管理方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image management method as described in the first aspect.
第六方面,本申请一个实施例还提供了一种镜像管理终端,包括: In the sixth aspect, an embodiment of the present application also provides an image management terminal, including:
通信模块,用于实现数据通信;Communication module, used to implement data communication;
一个或多个处理器;one or more processors;
存储器,用于存储一个或多个程序;Memory, used to store one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第二方面所述的镜像管理方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image management method as described in the second aspect.
第七方面,本申请一个实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如第一方面所述的镜像管理方法或如第二方面所述的镜像管理方法。In a seventh aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the image management method as described in the first aspect or the image management method as described in the second aspect is implemented. Described image management method.
在本申请一个实施例中,服务器接收第一终端发送的第一下载请求,并基于第一下载请求将第一镜像中心的第二镜像文件下发至第一终端,以使第一终端使用新的第二镜像文件替换本地的第二镜像文件,进而使第一终端应用第一终端运行云桌面时使用新的第二镜像文件,并且,第一终端运行过程中新增的数据均写入新的第二镜像文件对应的第三镜像文件的技术手段,解决了相关技术中服务器将镜像文件下发至终端需要耗费较多的网络资源的技术问题。通过将镜像分为三个层级的文件,并且,第一终端下载新的镜像文件时,服务器无需下发全部的镜像文件,只需要下发第二镜像文件,减小了下载文件的内存,节省了网络资源,减小了下载时长。并且,由于第三镜像文件创建后是空白的文件,因此,即使需要下发对应的第三镜像文件,也只占用很少的网络资源,保证了网络资源的合理运用。In one embodiment of the present application, the server receives the first download request sent by the first terminal, and delivers the second image file of the first image center to the first terminal based on the first download request, so that the first terminal uses the new The second image file replaces the local second image file, so that the first terminal uses the new second image file when the first terminal runs the cloud desktop, and all new data added during the operation of the first terminal is written into the new The technical means of creating a third image file corresponding to the second image file solves the technical problem in related technologies that the server needs to consume a lot of network resources to deliver the image file to the terminal. By dividing the image into three levels of files, and when the first terminal downloads a new image file, the server does not need to deliver all the image files, but only the second image file, which reduces the memory for downloading files and saves money. Use network resources and reduce download time. Moreover, since the third image file is a blank file after creation, even if the corresponding third image file needs to be delivered, only a small amount of network resources will be occupied, ensuring the rational use of network resources.
附图说明Description of the drawings
图1为相关技术中镜像文件分发流程第一示意图;Figure 1 is a first schematic diagram of the image file distribution process in related technologies;
图2为相关技术中镜像文件分发流程第二示意图;Figure 2 is a second schematic diagram of the image file distribution process in related technologies;
图3为本申请一个实施例提供的一种镜像关系示意图;Figure 3 is a schematic diagram of a mirroring relationship provided by an embodiment of the present application;
图4为本申请一个实施例提供的一种镜像管理方法的流程图;Figure 4 is a flow chart of an image management method provided by an embodiment of the present application;
图5为本申请一个实施例提供的一种镜像管理方法的流程图;Figure 5 is a flow chart of an image management method provided by an embodiment of the present application;
图6为本申请一个实施例提供的一种镜像注册流程图;Figure 6 is an image registration flow chart provided by an embodiment of the present application;
图7为本申请一个实施例提供的一种镜像管理方法的流程图;Figure 7 is a flow chart of an image management method provided by an embodiment of the present application;
图8为本申请一个实施例提供的一种镜像合并流程图;Figure 8 is a flow chart of image merging provided by an embodiment of the present application;
图9为本申请一个实施例提供的一种镜像管理方法的流程图;Figure 9 is a flow chart of an image management method provided by an embodiment of the present application;
图10为本申请一个实施例提供的一种镜像还原流程图;Figure 10 is an image restoration flow chart provided by an embodiment of the present application;
图11为本申请一个实施例提供的一种镜像管理方法的流程图;Figure 11 is a flow chart of an image management method provided by an embodiment of the present application;
图12为本申请一个实施例提供的一种镜像克隆流程图;Figure 12 is an image cloning flow chart provided by an embodiment of the present application;
图13为本申请一个实施例提供的一种镜像管理方法的流程图;Figure 13 is a flow chart of an image management method provided by an embodiment of the present application;
图14为本申请一个实施例提供的一种镜像管理装置的结构示意图;Figure 14 is a schematic structural diagram of an image management device provided by an embodiment of the present application;
图15为本申请一个实施例提供的一种镜像管理装置的结构示意图Figure 15 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
图16为本申请一个实施例提供的一种镜像管理设备的结构示意图。Figure 16 is a schematic structural diagram of an image management device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The present application will be further described in detail below in conjunction with the accompanying drawings and examples. It can be understood that the specific embodiments described here are used to explain the present application, but not to limit the present application. In addition, it should be noted that, for convenience of description, only some but not all structures related to the present application are shown in the drawings.
IDV类型下,向Guest(终端用户)分发镜像文件时可以包含两种方案: Under the IDV type, there are two options when distributing image files to Guests (end users):
方案一:图1为相关技术中镜像文件分发流程第一示意图。参考图1,终端(即终端用户)存在下载镜像文件的需求时,向服务器发送下载请求,服务器确定该下载请求合法后,将基础镜像文件发送至终端,之后,终端基于基础镜像文件启动虚拟机,以运行云桌面。其中,基础镜像文件也即镜像文件,终端基于基础镜像文件进行定制,即可在运行过程中加入自身的个性化数据。Option 1: Figure 1 is the first schematic diagram of the image file distribution process in related technologies. Referring to Figure 1, when the terminal (that is, the end user) has a need to download an image file, it sends a download request to the server. After the server determines that the download request is legal, it sends the basic image file to the terminal. After that, the terminal starts the virtual machine based on the basic image file. , to run cloud desktop. Among them, the basic image file is also an image file. When the terminal is customized based on the basic image file, it can add its own personalized data during operation.
方案二:图2为相关技术中镜像文件分发流程第二示意图。参考图2,终端存在下载镜像文件的需求时,向服务器发送下载请求,服务器确定该下载请求合法后,将差分镜像文件发送至终端,终端将差分镜像文件合并到基础镜像文件,之后,终端基于基础镜像文件启动虚拟机,以运行云桌面。其中,差分镜像文件是指利用差分技术得到的镜像文件。Option 2: Figure 2 is a second schematic diagram of the image file distribution process in related technologies. Referring to Figure 2, when the terminal needs to download an image file, it sends a download request to the server. After the server determines that the download request is legal, it sends the differential image file to the terminal. The terminal merges the differential image file into the basic image file. After that, the terminal The basic image file starts the virtual machine to run the cloud desktop. Among them, the differential image file refers to the image file obtained by using differential technology.
一般而言,基于镜像文件运行云桌面时,对镜像文件的管理过程中,通常需要更新镜像文件,例如,服务器对镜像文件进行升级后,需要更新镜像文件。再如,终端使用云桌面时,将自身的个性化数据填入镜像文件后,需要更新镜像文件。此时,使用方案一分发镜像文件时,服务器对镜像文件进行升级更新后,无论改动的大小,使用镜像文件的全部终端均需重新下载全量的镜像文件,这样需要耗费大量的网络资源,需要较长的下载时间,并不利于终端对镜像文件的统一更新。使用方案二时,可以只下载存在更新的差分镜像文件,这样虽然减小了数据下载量,但是,在终端增加了差分镜像文件合并时间,并且,还需要对基础镜像文件进行本地备份,以防止合并过程中因断电等情况导致的基础镜像文件损坏。这样不仅增加了终端对镜像文件的处理时长,还浪费了终端的本地存储空间。并且,无论使用方案一还是方案二分发镜像文件时,当管理员在终端修改镜像文件后,均需要终端先将镜像文件提交到服务器中以便服务器向使用该镜像文件的各终端下发修改后的镜像文件,这样不仅需要各终端下载完整的镜像文件,还需要管理员使用的终端上传完整的镜像文件,增加了下载和上传过程所需的网络资源以及传输耗时,不利于服务器对镜像文件的管理。此时,由于公网带宽的限制,也很大程度上阻碍了IDV类型的云桌面的普及和应用。Generally speaking, when running a cloud desktop based on an image file, the image file usually needs to be updated during the management of the image file. For example, after the server upgrades the image file, the image file needs to be updated. For another example, when a terminal uses a cloud desktop, after filling in its own personalized data into the image file, the image file needs to be updated. At this time, when using scheme 1 to distribute the image file, after the server upgrades the image file, no matter the size of the change, all terminals using the image file need to re-download the full amount of the image file, which consumes a lot of network resources and requires a lot of time. The long download time is not conducive to the unified update of image files by the terminal. When using option 2, you can only download updated differential image files. This reduces the amount of data downloaded, but increases the time for merging differential image files on the terminal. In addition, you also need to perform a local backup of the basic image file to prevent The basic image file is damaged due to power outage during the merge process. This not only increases the processing time of the image file by the terminal, but also wastes the local storage space of the terminal. Moreover, whether using option 1 or 2 to distribute image files, after the administrator modifies the image file on the terminal, the terminal needs to submit the image file to the server first so that the server can deliver the modified image file to each terminal using the image file. Image file, which not only requires each terminal to download the complete image file, but also requires the terminal used by the administrator to upload the complete image file, which increases the network resources required for the download and upload process and the transmission time, which is not conducive to the server's use of the image file. manage. At this time, due to the limitations of public network bandwidth, the popularity and application of IDV-type cloud desktops have also been greatly hindered.
综上,在使用镜像文件运行IDV类型的云桌面时,如何在镜像文件管理时,保证网络资源合理运用以及节省传输耗时,成为了急需解决的技术问题。In summary, when using image files to run IDV-type cloud desktops, how to ensure the rational use of network resources and save time on transmission during image file management has become an urgent technical issue that needs to be solved.
据此,本申请实施例提供了一种镜像管理方法、装置、服务器、终端及存储介质,以在终端运行IDV类型的云桌面的场景下,进行镜像文件管理时保证网络资源的合理利用以及节省传输耗时。Accordingly, embodiments of the present application provide an image management method, device, server, terminal and storage medium to ensure reasonable utilization and saving of network resources when managing image files in a scenario where the terminal runs an IDV-type cloud desktop. The transfer takes time.
本申请一个实施例提供了一种镜像管理方法,该镜像管理方法可以由镜像管理设备执行,该镜像管理设备可以是两个或多个物理实体构成,也可以是一个物理实体构成。An embodiment of the present application provides an image management method. The image management method can be executed by an image management device. The image management device can be composed of two or more physical entities, or it can be composed of one physical entity.
一个实施例中,镜像管理设备为镜像管理服务器(也可称为服务器),该服务器可以作为IDV类型云桌面的服务器,用于实现镜像(image)管理,以及为终端提供运行云桌面所需的镜像文件。当前,终端(也可以记为终端设备、电子终端等)可以是支持虚拟化的任何终端,如终端可以是个人计算机、平板电脑、交互平板、手机等。其中,虚拟化通常是指计算元件在虚拟的基础上而不是真实的基础上运行,虚拟化技术可以扩大硬件的容量,简化软件的重新配置过程。虚拟机是实现虚拟化的一种表现方式,虚拟机是指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统,当前,终端运行云桌面便通过虚拟机实现。In one embodiment, the image management device is an image management server (also called a server). The server can be used as a server of the IDV type cloud desktop to implement image (image) management and provide terminals with the necessary information to run the cloud desktop. Image file. Currently, a terminal (which can also be recorded as a terminal device, electronic terminal, etc.) can be any terminal that supports virtualization. For example, the terminal can be a personal computer, a tablet computer, an interactive tablet, a mobile phone, etc. Among them, virtualization usually means that computing elements run on a virtual basis rather than a real basis. Virtualization technology can expand the capacity of hardware and simplify the reconfiguration process of software. A virtual machine is a way of realizing virtualization. A virtual machine refers to a complete computer system with complete hardware system functions simulated through software and running in a completely isolated environment. Currently, terminals run cloud desktops through virtual machines. .
镜像(image)也可以记为镜像文件,其是终端启动虚拟机时所依赖的文件。一个实施例中,每个镜像均包含三种类型的镜像文件。三种类型的镜像文件可分别记为:BaseImage、LowerIamge和UpperImage。Image can also be recorded as an image file, which is a file that the terminal relies on when starting a virtual machine. In one embodiment, each image includes three types of image files. The three types of image files can be recorded as: BaseImage, LowerIamge and UpperImage.
BaseImage记录操作系统,该操作系统供云桌面使用。当前,BaseImage记录的为纯净的操作,不带操作系统中的应用程序以及额外的设备驱动。每个镜像可以拥有独立的BaseImage,也可以多个镜像共用同一BaseImage。当多个镜像共用同一BaseImage时,BaseImage以硬链接的方式供镜像使用,这样可以节约服务器的存储空间。其中,硬链接(hard link)是 指一个文件的一个或多个文件名,即用多个文件名与同一个文件进行链接,这些文件名可以在同一目录或不同目录。可选的,终端运行云桌面时,BaseImage可被读取,但不会被修改,以便于保护BaseImage不被损坏。BaseImage records the operating system, which is used by the cloud desktop. Currently, BaseImage records pure operations without operating system applications or additional device drivers. Each image can have an independent BaseImage, or multiple images can share the same BaseImage. When multiple images share the same BaseImage, the BaseImage is used by the image in the form of a hard link, which can save storage space on the server. Among them, the hard link is Refers to one or more file names of a file, that is, multiple file names are used to link to the same file. These file names can be in the same directory or different directories. Optionally, when the terminal runs the cloud desktop, the BaseImage can be read but will not be modified to protect the BaseImage from damage.
LowerImage是BaseImage的子盘,即LowerImage基于BaseImage创建,并作为BaseImage的下一级文件。LowerImage记录基于操作系统安装的设备驱动和应用程序等内容。一个实施例中,每个Guest镜像针对不同的终端型号会带上一个初始的LowerImage,该LowerImage包含对应型号下的终端在运行操作系统时内置的应用程序和设备驱动。之后,用户可以基于初始的LowerImage衍生出自己的LowerImage,该LowerImage中存在用户使用过程中的个性化数据,如用户新安装的设备驱动、应用程序、保存的文件或数据等内容。可选的,每个用户可拥有独立的LowerImage。LowerImage is a sub-disk of BaseImage, that is, LowerImage is created based on BaseImage and serves as the next-level file of BaseImage. LowerImage records content such as device drivers and applications installed based on the operating system. In one embodiment, each Guest image carries an initial LowerImage for different terminal models. The LowerImage contains built-in applications and device drivers when the terminal under the corresponding model runs the operating system. After that, the user can derive his or her own LowerImage based on the initial LowerImage. The LowerImage contains personalized data during the user's use, such as the user's newly installed device drivers, applications, saved files or data, etc. Optionally, each user can have an independent LowerImage.
UpperImage是LowerImage的子盘,即UpperImage基于LowerImage创建,并作为LowerImage的下一级文件。UpperImage记录终端运行云桌面时新增的数据。可选的,创建UpperImage时其可以认为是空白的文件,没有记录任何与用户有关的数据,在用户使用云桌面时,UpperImage中记录当前新增的数据。UpperImage中记录的数据可以提交到LowerImage中,以在LowerImage中增加用户使用过程中的个性化数据。UpperImage is a sub-disk of LowerImage, that is, UpperImage is created based on LowerImage and serves as a lower-level file of LowerImage. UpperImage records the data newly added when the terminal runs the cloud desktop. Optionally, when the UpperImage is created, it can be considered as a blank file, and no user-related data is recorded. When the user uses the cloud desktop, the current newly added data is recorded in the UpperImage. The data recorded in the UpperImage can be submitted to the LowerImage to add personalized data during the user's use in the LowerImage.
此时,BaseImage、LowerIamge和UpperImage也可认为是镜像包含的三个层级文件。At this time, BaseImage, LowerIamge and UpperImage can also be considered as three levels of files included in the image.
一个实施例中,镜像快照(也可称为快照、Snapshot)是指镜像文件在某一时刻的还原点,即镜像文件可以从任何一个状态还原到快照(即还原点)对应的状态。每个快照均有对应的快照名,快照名的命名规则当前不作限定,一般而言,快照名包含唯一标识符,以通过快照名区分各快照。可选的,BaseImage、LowerIamge和UpperImage均可创建快照。每个镜像文件均可查找它对应的的快照列表。例如,LowerIamge对应的快照列表中记录有其包含的各快照名等内容,LowerIamge基于快照列表可以查找所需要的快照。In one embodiment, an image snapshot (also called snapshot or Snapshot) refers to a restore point of an image file at a certain moment, that is, the image file can be restored from any state to the state corresponding to the snapshot (ie, the restore point). Each snapshot has a corresponding snapshot name. The naming rules for snapshot names are currently not limited. Generally speaking, the snapshot name contains a unique identifier to distinguish each snapshot through the snapshot name. Optionally, BaseImage, LowerIamge and UpperImage can all create snapshots. Each image file can be searched for its corresponding snapshot list. For example, the snapshot list corresponding to LowerIamge records the name of each snapshot it contains, and LowerIamge can find the required snapshot based on the snapshot list.
一个实施例中,BaseImage中创建唯一的一个快照,基于BaseImage在唯一快照时的状态创建LowerIamge。可选的,创建LowerIamge前,先将BaseImage的文件名改成BaseImage的唯一快照的快照名,之后,创建LowerIamge时,在LowerIamge中记录BaseImage的文件名,以保证在LowerIamge中准确记录BaseImage的快照名,进而通过BaseImage的快照名查找到LowerIamge对应的BaseImage。In one embodiment, a unique snapshot is created in BaseImage, and a LowerIamge is created based on the state of BaseImage at the time of the unique snapshot. Optionally, before creating LowerIamge, first change the file name of BaseImage to the snapshot name of the unique snapshot of BaseImage. Then, when creating LowerIamge, record the file name of BaseImage in LowerIamge to ensure that the snapshot name of BaseImage is accurately recorded in LowerIamge. , and then find the BaseImage corresponding to LowerIamge through the snapshot name of BaseImage.
一个实施例中,LowerIamge中创建多个快照。可选的,针对不同的终端型号创建LowerIamge(当前为初始LowerIamge)时,在LowerIamge中安装操作系统内置的设备驱动后创建驱动快照,安装操作系统内置的应用程序(也可以称为基础应用)后创建应用快照,通过这两个快照可以使LowerImage分别还原到安装设备驱动和应用程序时的状态。可选的,LowerIamge被终端应用时,还中还可写入终端新增的个性化数据,并且基于写入的个性化数据可以创建对应的快照。一个实施例中,基于LowerIamge的某个快照状态可以创建对应的UpperImage,即UpperImage对应于LowerIamge的一个快照,与创建LowerIamge类似,UpperImage中记录它在LowerIamge中对应快照的快照名,以通过UpperImage中LowerIamge的快照名查找到对应的LowerIamge并在LowerIamge中确定对应的快照。可选的,在LowerIamge中创建一个快照时,便可生成对应的UpperImage,此时,终端基于该快照下的LowerIamge运行云桌面时,可以在UpperImage中写入以该快照为节点,运行云桌面时新增的数据,之后,由服务器将UpperImage提交到LowerIamge中,即将对应快照节点下的个性化数据写入LowerIamge,之后,可以在LowerIamge中创建新的快照,并基于新的快照再次创建对应的UpperImage,以使终端基于新的快照所对应的LowerIamge运行云桌面,并在UpperImage中写入新增的数据。此时,对于终端而言,以LowerIamge的快照为区分,将终端新增的数据写入快照对应的UpperImage,而不会在终端中修改BaseImage和LowerIamge。In one embodiment, multiple snapshots are created in LowerIamge. Optional, when creating a LowerIamge for different terminal models (currently the initial LowerIamge), create a driver snapshot after installing the device driver built into the operating system in the LowerIamge, and install the application built into the operating system (also called a basic application) Create an application snapshot. Through these two snapshots, the LowerImage can be restored to the state when the device driver and application were installed. Optionally, when LowerIamge is used by the terminal, the terminal's new personalized data can also be written into it, and corresponding snapshots can be created based on the written personalized data. In one embodiment, a corresponding UpperImage can be created based on a certain snapshot status of LowerIamge, that is, UpperImage corresponds to a snapshot of LowerIamge. Similar to creating LowerIamge, UpperImage records the snapshot name of its corresponding snapshot in LowerIamge, so as to pass LowerIamge in UpperImage. Find the corresponding LowerIamge based on the snapshot name and determine the corresponding snapshot in LowerIamge. Optionally, when creating a snapshot in LowerIamge, the corresponding UpperImage can be generated. At this time, when the terminal runs the cloud desktop based on the LowerIamge under the snapshot, it can write in the UpperImage that the snapshot is used as the node. When running the cloud desktop After adding the new data, the server submits the UpperImage to LowerIamge, that is, writes the personalized data under the corresponding snapshot node to LowerIamge. After that, a new snapshot can be created in LowerIamge, and the corresponding UpperImage can be created again based on the new snapshot. , so that the terminal runs the cloud desktop based on the LowerIamge corresponding to the new snapshot and writes the new data in the UpperImage. At this time, for the terminal, the snapshot of LowerIamge is used as a distinction, and the new data added by the terminal is written to the UpperImage corresponding to the snapshot, without modifying BaseImage and LowerIamge in the terminal.
一个实施例中,LowerIamge中的每个快照对应一个版本(也可称为镜像版本、revision),即在LowerIamge中创建一个新的快照时,可以认为是创建了一个新的版本。对于终端而言,可以通过切换LowerIamge的不同快照,来实现切换运行 不同的版本。每个版本均有对应的版本ID,版本ID具有唯一性,其具体的命名规则当前不作限定,每个版本还有对应的版本UUID(即版本的通用唯一识别码)。终端运行云桌面时,若想要更改自身使用的版本,只需要从服务器中获取该版本对应的LowerIamge(LowerIamge为该版本对应的快照状态)并使用即可。可理解,一个镜像供多个用户使用时,基于数据安全性的考虑,每个用户拥有自己独立的LowerImage文件,同时每个用户的版本数据以内置快照的方式存储在自己的LowerImage文件中,用户只允许下载属于自己的LowerImage文件。同一用户的每个版本对应LowerIamge中的一个内置快照,该内置快照的快照名为版本UUID,通过内置快照的快照名,可以确定当前对应的版本是否可以供用户使用。可选的,每个版本和对应快照的快照名可以关联记录在快照列表中。通过版本,可以查找到对应的快照名,通过快照名可以查找到对应的LowerIamge,基于LowerIamge中记录的BaseImage的快照名可以查找到对应的BaseImage,通过版本对应的快照名还可以查找到对应的UpperImage。此时,查找到的BaseImage、LowerIamge和UpperImage可以认为与对应的版本关联。即每个镜像的每个版本均具有关联的BaseImage、LowerIamge和UpperImage。一个实施例中,每个版本均有对应的版本记录和版本目录,其中,版本记录用于记录版本的元数据(用于描述版本的属性)等内容,版本目录用于记录其关联的BaseImage和LowerIamge,可选的,版本目录还可以记为其关联的UpperImage。可选的,BaseImage以硬链接的方式链接到版本目录下,且不同的版本间可以共享BaseImage。In one embodiment, each snapshot in LowerIamge corresponds to a version (also called a mirror version or revision). That is, when a new snapshot is created in LowerIamge, it can be considered that a new version is created. For the terminal, switching operations can be achieved by switching different snapshots of LowerIamge. different versions. Each version has a corresponding version ID. The version ID is unique. Its specific naming rules are currently not limited. Each version also has a corresponding version UUID (that is, the universal unique identification code of the version). When the terminal is running the cloud desktop, if you want to change the version it is using, you only need to obtain the LowerIamge corresponding to the version from the server (LowerIamge is the snapshot status corresponding to the version) and use it. It is understandable that when an image is used by multiple users, based on data security considerations, each user has his own independent LowerImage file. At the same time, each user's version data is stored in his own LowerImage file in the form of a built-in snapshot. Only your own LowerImage files are allowed to be downloaded. Each version of the same user corresponds to a built-in snapshot in LowerIamge. The snapshot name of the built-in snapshot is version UUID. Through the snapshot name of the built-in snapshot, you can determine whether the current corresponding version can be used by the user. Optionally, each version and the snapshot name of the corresponding snapshot can be associated and recorded in the snapshot list. You can find the corresponding snapshot name through the version. You can find the corresponding LowerIamge through the snapshot name. You can find the corresponding BaseImage based on the snapshot name of BaseImage recorded in LowerIamge. You can also find the corresponding UpperImage through the snapshot name corresponding to the version. . At this time, the found BaseImage, LowerIamge, and UpperImage can be considered to be associated with the corresponding versions. That is, each version of each image has an associated BaseImage, LowerIamge, and UpperImage. In one embodiment, each version has a corresponding version record and version directory, where the version record is used to record metadata (used to describe the attributes of the version) and other contents of the version, and the version directory is used to record its associated BaseImage and LowerIamge, optionally, the version directory can also record its associated UpperImage. Optionally, BaseImage is linked to the version directory as a hard link, and BaseImage can be shared between different versions.
一个实施例中,一个镜像可以有一个或多个分支(也可称为镜像版本分支、branch),一个分支可以有一个或多个版本,每个使用镜像的用户均可拥有独立的分支。不同的镜像或相同镜像的不同分支可以共用一个BaseImage。为了便于理解,图3为本申请一个实施例提供的一种镜像关系示意图,其示例性的示出了镜像、分支和版本间的关系,以及BaseImage、LowerIamge和UpperImage间的关系。如图3所示,一个BaseImage可以通过硬链接的方式供多个镜像使用,图3中包含镜像A和镜像B,镜像A包含分支a,镜像B包含分支b和分支c。分支a由用户A使用,用户A具有独立的LowerIamge(即为LowerIamgeA),LowerIamgeA包含快照A1(即SnapshotA1)、快照A2(即SnapshotA2)和快照A3(即SnapshotA3),快照A1对应版本1,快照A2对应版本2,快照A3对应版本3,每个快照均可生成对应的UpperImage,可理解,图3中为例便于描述快照和版本的对应关系,将LowerIamgeA中包含的快照以虚线框的方式示出,实际应用中,快照包含在LowerIamgeA中。并且,图3中将快照A1、快照A2和快照A3指向UpperImageA是指每个快照均会创建对应的UpperImage,并非指三个快照共用一个UpperImage。分支b由用户B使用,分支c由用户c使用,此时,分支b和分支c对应的快照、版本以及三类文件的关系与分支a类似,当前不作赘述。基于图3所示的内容可知,BaseImage、LowerIamge和UpperImage之间可以形成一条文件链,这样可以避免不同分支之间的文件关系的错乱。In one embodiment, an image can have one or more branches (also called image version branches, branches), a branch can have one or more versions, and each user who uses the image can have an independent branch. Different images or different branches of the same image can share a BaseImage. To facilitate understanding, Figure 3 is a schematic diagram of an image relationship provided by an embodiment of the present application, which exemplarily shows the relationship between images, branches, and versions, as well as the relationship between BaseImage, LowerIamge, and UpperImage. As shown in Figure 3, a BaseImage can be used by multiple images through hard links. Figure 3 contains image A and image B. Image A contains branch a, and image B contains branch b and branch c. Branch a is used by user A, who has an independent LowerIamge (LowerIamgeA). LowerIamgeA includes snapshot A1 (SnapshotA1), snapshot A2 (SnapshotA2) and snapshot A3 (SnapshotA3). Snapshot A1 corresponds to version 1, and snapshot A2 Corresponds to version 2, and snapshot A3 corresponds to version 3. Each snapshot can generate the corresponding UpperImage. It is understandable that Figure 3 is an example to facilitate the description of the corresponding relationship between snapshots and versions. The snapshots included in LowerIamgeA are shown in a dotted box. ,In actual applications, the snapshot is included in LowerIamgeA. Moreover, pointing snapshot A1, snapshot A2 and snapshot A3 to UpperImageA in Figure 3 means that each snapshot will create a corresponding UpperImage, not that the three snapshots share one UpperImage. Branch b is used by user B, and branch c is used by user c. At this time, the relationship between the snapshots, versions, and three types of files corresponding to branch b and branch c is similar to that of branch a, and will not be described in detail at this time. Based on the content shown in Figure 3, it can be seen that a file chain can be formed between BaseImage, LowerIamge and UpperImage, which can avoid confusion of file relationships between different branches.
对于终端而言,其虚拟机启动需要同时具备BaseImage、LowerIamge和UpperImage。并且,虚拟机可直接基于UpperImage启动,不需要将BaseImage、LowerIamge和UpperImage合并为一个文件。For the terminal, its virtual machine needs to have BaseImage, LowerIamge and UpperImage at the same time. Moreover, the virtual machine can be started directly based on the UpperImage, without merging BaseImage, LowerIamge and UpperImage into one file.
服务器中还存储有镜像表(osimages),镜像表中记录有多条镜像记录,每条镜像记录对应一个镜像且用于记录该镜像的元数据(用于描述镜像的属性)等内容。The server also stores an image table (osimages). There are multiple image records recorded in the image table. Each image record corresponds to an image and is used to record the metadata of the image (used to describe the attributes of the image) and other contents.
服务器中存储的BaseImage、LowerIamge和UpperImage可供终端下载使用。可选的,BaseImage、LowerIamge和UpperImage均以种子文件的形式供终端下载,即服务器可分别生成BaseImage对应的BaseImage种子文件、LowerIamge对应的LowerIamge种子文件和UpperImage对应的UpperImage种子文件。其中,种子文件是指P2P下载种子文件,P2P(peer-to-peer)是一种对等计算机网络,客户端通过P2P下载种子文件后,可以获取到对应的BaseImage、LowerIamge或UpperImage。The BaseImage, LowerIamge and UpperImage stored in the server can be downloaded and used by the terminal. Optionally, BaseImage, LowerIamge and UpperImage are available for terminal download in the form of seed files, that is, the server can respectively generate the BaseImage seed file corresponding to BaseImage, the LowerIamge seed file corresponding to LowerIamge, and the UpperImage seed file corresponding to UpperImage. Among them, the torrent file refers to the P2P download of the torrent file. P2P (peer-to-peer) is a peer-to-peer computer network. After the client downloads the torrent file through P2P, it can obtain the corresponding BaseImage, LowerIamge or UpperImage.
需要说明的是,上述提及的用户是指使用终端的用户,其中,一个用户可以使用不同的终端,一个终端可以被多个用户使用,各用户可以通过登陆时使用的用户ID等进行区分。 It should be noted that the users mentioned above refer to users who use terminals. One user can use different terminals, one terminal can be used by multiple users, and each user can be distinguished by the user ID used when logging in.
一个实施例中,图4为本申请一个实施例提供的一种镜像管理方法的流程图,服务器执行该镜像管理方法时,可以包括:In one embodiment, Figure 4 is a flow chart of an image management method provided by an embodiment of the present application. When the server executes the image management method, it may include:
步骤110、接收第一终端发送的第一下载请求,第一终端应用第一镜像,第一镜像包含第一镜像文件和第二镜像文件,第一镜像文件记录有第一终端中云桌面所使用的操作系统,第二镜像文件记录有基于操作系统安装的设备驱动和应用程序。Step 110: Receive the first download request sent by the first terminal. The first terminal applies the first image. The first image includes a first image file and a second image file. The first image file records the cloud desktop used by the first terminal. operating system, the second image file records device drivers and applications installed based on the operating system.
示例性的,以服务器为一个终端提供服务为例,描述服务器如何实现镜像管理。当前,将服务器提供服务的终端记为第一终端。将第一终端使用的镜像记为第一镜像,即第一终端通过第一镜像运行云桌面。第一终端基于第一镜像运行云桌面时,所使用的BaseImage、LowerIamge和UpperImage分别记为第一镜像文件、第二镜像文件和第三镜像文件。当前,将第二镜像文件中的快照记为第二快照,将第一镜像文件中的快照记为第一快照。基于前述内容可知,第一镜像文件包含唯一的第一快照,第二镜像文件包含第一快照的第一快照名;第二镜像文件包含至少一个第二快照,第三镜像文件包含所对应的第二快照的第二快照名。其中,第一快照的快照名记为第一快照名,第二快照的快照名记为第二快照名。第一终端运行云桌面时使用的第二镜像文件对应于一个版本,且使用的第三镜像文件是基于该版本在第二镜像文件中对应的快照所生成。第一镜像在服务器中记录有至少一个版本,每个版本对应第二镜像文件中的一个第二快照且关联于第二镜像文件、第二镜像文件中第一快照名对应的第一镜像文件以及第二快照对应的第三镜像文件,每个版本均有对应的版本ID。可选的,第一终端运行第一镜像可以认为是运行第一镜像的一个分支。第一镜像在服务器中记录有至少一个镜像分支,每个镜像分支包含至少一个版本,第一终端应用第一镜像的一个镜像分支。可选的,终端运行的第一镜像可具体为该镜像分支下的一个版本,此时,后续提及的第一镜像ID也可认为是第一镜像中镜像分支的ID。As an example, the server provides services for a terminal to describe how the server implements image management. Currently, the terminal where the server provides services is recorded as the first terminal. The image used by the first terminal is recorded as the first image, that is, the first terminal runs the cloud desktop through the first image. When the first terminal runs the cloud desktop based on the first image, the BaseImage, LowerIamge, and UpperImage used are recorded as the first image file, the second image file, and the third image file respectively. Currently, the snapshot in the second image file is recorded as the second snapshot, and the snapshot in the first image file is recorded as the first snapshot. Based on the foregoing content, it can be known that the first image file contains a unique first snapshot, the second image file contains the first snapshot name of the first snapshot, the second image file contains at least one second snapshot, and the third image file contains the corresponding first snapshot. The second snapshot name of the second snapshot. Wherein, the snapshot name of the first snapshot is recorded as the first snapshot name, and the snapshot name of the second snapshot is recorded as the second snapshot name. The second image file used when the first terminal runs the cloud desktop corresponds to one version, and the third image file used is generated based on the corresponding snapshot of the version in the second image file. The first image has at least one version recorded in the server. Each version corresponds to a second snapshot in the second image file and is associated with the second image file, the first image file corresponding to the first snapshot name in the second image file, and Each version of the third image file corresponding to the second snapshot has a corresponding version ID. Optionally, running the first image on the first terminal can be considered as running a branch of the first image. The first image is recorded in the server with at least one image branch, each image branch includes at least one version, and the first terminal applies one image branch of the first image. Optionally, the first image run by the terminal may be specifically a version under the image branch. In this case, the first image ID mentioned later may also be considered as the ID of the image branch in the first image.
第一终端首次运行云桌面前,需要先从服务器中下载第一镜像文件和第二镜像文件,并结合自身的实际确定创建第三镜像文件或者从服务器中下载第三镜像文件。可选的,第一终端具备创建第三镜像文件的功能时,可以结合当前版本所对应的第二快照创建第三镜像文件。第一终端不具备创建第三镜像文件的功能时,可以由服务器生成第三镜像文件并下发至第一终端。之后,第一终端基于第一镜像文件、第二镜像文件和第三镜像文件运行虚拟机,并通过虚拟机运行云桌面。Before the first terminal runs the cloud desktop for the first time, it needs to download the first image file and the second image file from the server, and then create a third image file based on its own actual determination or download the third image file from the server. Optionally, when the first terminal has the function of creating a third image file, the third image file can be created in combination with the second snapshot corresponding to the current version. When the first terminal does not have the function of creating the third image file, the server can generate the third image file and deliver it to the first terminal. Afterwards, the first terminal runs the virtual machine based on the first image file, the second image file and the third image file, and runs the cloud desktop through the virtual machine.
当第一终端存在版本更新的需求时,生成对应的下载请求,并基于下载请求从服务器中获取对应的第二镜像文件,以基于第二镜像文件实现版本更新。当前,将第一终端生成的下载请求记为第一下载请求。第一终端生成第一下载请求时,已经在本地存储有第一镜像文件和第二镜像文件,且第二镜像文件可以记录有用户的个性化数据,也可以还未添加用户的个性化数据。When the first terminal has a need for version update, a corresponding download request is generated, and a corresponding second image file is obtained from the server based on the download request, so as to implement version update based on the second image file. Currently, the download request generated by the first terminal is recorded as the first download request. When the first terminal generates the first download request, the first image file and the second image file have been stored locally, and the second image file may record the user's personalized data, or may not have the user's personalized data added.
第一下载请求的生成方式当前不作限定,例如,服务器确定第二镜像文件的版本更新(即生成了新的版本)时,向使用该第二镜像文件的第一终端发送版本更新的通知,之后,第一终端的用户可以基于该通知确定是否更新版本,并在确定更新版本时,生成第一下载请求并发送至服务器中。再如,第一终端的用户存在版本更新的需求时,生成第一下载请求,并发送至服务器中。又如,第一终端的用户确认需要基于云桌面当前的运行状态创建还原点(即快照)时,将当前记录新增数据的第三镜像文件上传至服务器中,由服务器将第三镜像文件提交到第二镜像文件中,并创建对应的快照及版本,即更新第二镜像文件的版本,此时,服务器可以通过第一终端完成创建还原点,之后,第一终端生成第一下载请求,并发送至服务器,或者是,第一终端上传第三镜像文件前生成第一下载请求,并将第三镜像文件和第一下载请求一同发送至服务器中。The method of generating the first download request is currently not limited. For example, when the server determines that the version of the second image file is updated (that is, a new version is generated), it sends a notification of the version update to the first terminal using the second image file, and then , the user of the first terminal can determine whether to update the version based on the notification, and when determining to update the version, generate a first download request and send it to the server. For another example, when the user of the first terminal has a need for version update, a first download request is generated and sent to the server. For another example, when the user of the first terminal confirms that a restore point (that is, a snapshot) needs to be created based on the current running status of the cloud desktop, the third image file currently recording the new data is uploaded to the server, and the server submits the third image file. to the second image file, and create the corresponding snapshot and version, that is, update the version of the second image file. At this time, the server can complete the creation of the restore point through the first terminal. After that, the first terminal generates the first download request, and Send to the server, or the first terminal generates a first download request before uploading the third image file, and sends the third image file and the first download request to the server together.
一个实施例中,结合第一终端是否具备创建第三镜像文件的功能,将第一下载请求分为两种类型,一种类型是用于从服务器中下载第二镜像文件,此时,第一终端可以基于第二镜像文件在本地创建第三镜像文件,另一种类型是用于从服务器中下载第二镜像文件和第三镜像文件。可理解,第一终端具备先创建第三镜像文件的功能时,也可以选择从服务器中下载第三镜像文件。In one embodiment, based on whether the first terminal has the function of creating a third image file, the first download request is divided into two types. One type is used to download the second image file from the server. At this time, the first The terminal can create a third image file locally based on the second image file. Another type is used to download the second image file and the third image file from the server. It is understandable that when the first terminal has the function of creating a third image file first, it can also choose to download the third image file from the server.
服务器接收到第一下载请求后,对其进行解析,确定其用于下载第二镜像文件时,执行步骤120,确定其用于下载第二 镜像文件和第三镜像文件时,执行步骤130。可选的,第一终端在第一下载请求中写入第一终端是否能生成第三镜像文件的标识,以使服务器通过该标识确定是否需要发送第三镜像文件。还可选的,服务器中预先记录可以本地生成第三镜像文件的终端型号,第一终端生成第一下载请求时,在第一下载请求中写入第一终端的终端型号,服务器根据第一下载请求中的终端型号确定是否需要发送第三镜像文件。After the server receives the first download request, it parses it and determines that it is used to download the second image file, and then executes step 120 to determine that it is used to download the second image file. image file and the third image file, perform step 130. Optionally, the first terminal writes an identifier of whether the first terminal can generate the third image file in the first download request, so that the server determines whether the third image file needs to be sent based on the identifier. Optionally, the server pre-records the terminal model that can locally generate the third image file. When the first terminal generates the first download request, the terminal model of the first terminal is written in the first download request, and the server determines the first download request based on the first download request. The terminal model in the request determines whether a third image file needs to be sent.
需要说明,当前以第一终端包括具备创建第三镜像文件功能以及不具备创建第三镜像文件功能为例,描述两种不同的处理方式。实际应用中,服务器提供服务的各终端也可以全部具备创建第三镜像文件的功能,此时,第一下载请求仅用于从服务器中下载新的第二镜像文件,或者是,服务器提供服务的各终端均不具备创建第三镜像文件功能,此时,第一下载请求仅用于从服务器中下载新的第二镜像文件和对应的第三镜像文件。实际应用中,也可以无论终端是否具备创建第三镜像文件的功能,均由服务器生成第三镜像文件,此时,第一下载请求仅用于从服务器中下载新的第二镜像文件。It should be noted that two different processing methods are currently described, taking the first terminal having the function of creating a third image file and not having the function of creating the third image file as an example. In actual applications, all terminals provided by the server can also have the function of creating a third image file. In this case, the first download request is only used to download a new second image file from the server, or the terminals provided by the server can Each terminal does not have the function of creating a third image file. At this time, the first download request is only used to download a new second image file and the corresponding third image file from the server. In practical applications, the server may generate the third image file regardless of whether the terminal has the function of creating the third image file. In this case, the first download request is only used to download a new second image file from the server.
步骤120、当第一下载请求用于从服务器中下载新的第二镜像文件,将新的第二镜像文件发送至第一终端,以使第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件并基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,第一镜像还包含第三镜像文件,第三镜像文件记录有云桌面在设定第二快照的状态下运行时新增的数据。Step 120: When the first download request is used to download a new second image file from the server, send the new second image file to the first terminal, so that the first terminal uses the received second image file to replace the local original image file. The second image file is a second image file and a corresponding third image file is created based on the second snapshot of settings in the received second image file. The first image also includes a third image file, and the third image file records the settings of the cloud desktop in the third image file. Data newly added when running in the second snapshot state.
示例性的,第一终端从服务器中下载的第二镜像文件和本地原有的第二镜像文件可以认为是同一第二镜像文件的不同版本,不同版本下第二镜像文件的内容存在差异,此时,为了便于区别,将下载的第二镜像文件记为新的第二镜像文件。For example, the second image file downloaded by the first terminal from the server and the local original second image file can be considered as different versions of the same second image file. There are differences in the contents of the second image file under different versions. This is In order to facilitate the distinction, the downloaded second image file is recorded as the new second image file.
当前,第一下载请求用于从服务器中下载新的第二镜像文件。服务器接收第一下载请求后对其进行解析,以查找到需要下载的新的第二镜像文件。一个实施例中,第一下载请求可以包含当前需要下载的版本ID,可选的,当前需要下载的版本ID可以由服务器下发至第一终端,例如,服务器进行版本更新后,将当前的版本ID下发至第一终端。还可选的,当前需要下载的版本ID可以由第一终端的用户选择,例如,第一终端的用户登陆后可以在服务器中查找第一镜像中当前使用的第二镜像文件所对应的各版本,之后,选择当前需要下载的版本,此时,为了保证数据安全性,服务器可以向用户显示可供用户使用的各版本,而不可供用户使用的各版本则不会显示,或者是,服务器可以为不同的用户设置不同的权限,只有特定权限的用户可以进行版本查找。服务器接收第一下载请求后,获取其中的版本ID,并查找对应版本关联的第二镜像文件作为新的第二镜像文件。一个实施例中,第一下载请求可以包含第一镜像的镜像ID,服务器获取到镜像ID后,根据镜像ID查找到第一镜像中供第一终端使用的第二镜像文件的最新版本,并将最新版本关联的第二镜像文件作为新的第二镜像文件。一个实施例中,第一下载请求可以包含镜像ID和版本ID,之后,服务器根据镜像ID和版本ID查找到新的第二镜像文件。一个实施例中,第一下载请求包括用户ID,服务器根据用户ID确定第一终端使用的第一镜像,并将第一镜像中供第一终端使用的第二镜像文件的最新版本作为新的第二镜像文件。服务器也可以通过其他方式确定新的第二镜像文件。Currently, the first download request is used to download a new second image file from the server. After receiving the first download request, the server parses it to find the new second image file that needs to be downloaded. In one embodiment, the first download request may include the version ID that currently needs to be downloaded. Optionally, the version ID that currently needs to be downloaded may be issued by the server to the first terminal. For example, after the server performs a version update, the current version The ID is sent to the first terminal. Optionally, the version ID that currently needs to be downloaded can be selected by the user of the first terminal. For example, after logging in, the user of the first terminal can search the server for each version corresponding to the second image file currently used in the first image. , and then select the version that currently needs to be downloaded. At this time, in order to ensure data security, the server can display to the user the versions that are available for the user, while the versions that are not available for the user will not be displayed, or the server can Set different permissions for different users. Only users with specific permissions can perform version search. After receiving the first download request, the server obtains the version ID and searches for the second image file associated with the corresponding version as the new second image file. In one embodiment, the first download request may include the image ID of the first image. After obtaining the image ID, the server finds the latest version of the second image file in the first image for use by the first terminal according to the image ID, and adds the The second image file associated with the latest version is used as the new second image file. In one embodiment, the first download request may include the image ID and the version ID. After that, the server finds the new second image file based on the image ID and the version ID. In one embodiment, the first download request includes a user ID, and the server determines the first image used by the first terminal based on the user ID, and uses the latest version of the second image file in the first image for use by the first terminal as the new third image. Two image files. The server can also determine the new second image file through other methods.
服务器将新的第二镜像文件下发至第一终端。第一终端接收到新的第二镜像文件时,使用新的第二镜像文件替换本地原有的第二镜像文件,以实现版本的更新。可选的,版本更新后,需要使用当前版本对应的第三镜像文件记录第一终端基于当前版本运行云桌面时新增的数据,此时,第一终端获取第二镜像文件中与当前版本对应的第二快照,并基于第二快照生成第三镜像文件,即第三镜像文件是基于第二镜像文件中设定第二快照(当前为与更新的版本对应的第二快照)生成的。之后,第一终端便可以基于当前的版本运行云桌面。可选的,更新前,第一终端原有的版本也可存在对应的第三镜像文件,用户在版本更新前可以确定原有的第三镜像文件中记录的数据是否需要放弃,若放弃,则可以直接在本地删除第三镜像文件,即放弃对原有版本的修改;若不需要放弃,则可以先将第三镜像文件上传至服务器,由服务器将第三镜像文件提交到对应的第二镜像文件中,之后,服务器再基于提交结果创建新的版本,新的版本所对应的第二镜像文件可以作为新的第二镜像文件供第一终端下载。第一终端上传第三镜像文件后,可以删除本地的第三镜像文件,或者将第三镜像文件和对应的版本关联保存,或者由服务器将第三镜像文件和对应的版本关联保存。 The server delivers the new second image file to the first terminal. When the first terminal receives the new second image file, it uses the new second image file to replace the original local second image file to implement version updating. Optionally, after the version is updated, the third image file corresponding to the current version needs to be used to record the data newly added when the first terminal runs the cloud desktop based on the current version. At this time, the first terminal obtains the second image file corresponding to the current version. a second snapshot, and generate a third image file based on the second snapshot, that is, the third image file is generated based on the second snapshot set in the second image file (currently the second snapshot corresponding to the updated version). After that, the first terminal can run the cloud desktop based on the current version. Optionally, before the update, the original version of the first terminal may also have a corresponding third image file. The user can determine whether the data recorded in the original third image file needs to be discarded before the version is updated. If so, then You can directly delete the third image file locally, that is, give up modifications to the original version; if you do not need to give up, you can upload the third image file to the server first, and the server will submit the third image file to the corresponding second image. file, and then the server creates a new version based on the submission result, and the second image file corresponding to the new version can be used as a new second image file for the first terminal to download. After the first terminal uploads the third image file, it can delete the local third image file, or associate and save the third image file with the corresponding version, or the server can associate and save the third image file with the corresponding version.
步骤130、当第一下载请求用于从服务器中下载新的第二镜像文件和对应的第三镜像文件,将新的第二镜像文件和第三镜像文件发送至第一终端,以使第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件,第三镜像文件基于新的第二镜像文件中的设定第二快照生成。Step 130: When the first download request is used to download the new second image file and the corresponding third image file from the server, send the new second image file and the third image file to the first terminal, so that the first The terminal uses the received second image file to replace the local original second image file, and the third image file is generated based on the set second snapshot in the new second image file.
本步骤与步骤120的区别在于,本步骤中第三镜像文件在服务器中生成。一个实施例中,服务器为第二镜像文件创建一个快照(即一个版本)时,生成该版本对应的第三镜像文件,并在接收到第一下载请求时,将第二镜像文件和对应的第三镜像文件一同发送至第一终端。The difference between this step and step 120 is that in this step, the third image file is generated in the server. In one embodiment, when the server creates a snapshot (ie, a version) of the second image file, it generates a third image file corresponding to the version, and when receiving the first download request, combines the second image file and the corresponding third image file. The three image files are sent to the first terminal together.
可选的,服务器接收第一下载请求后对其进行解析,以查找到需要下载的新的第二镜像文件以及对应的第三镜像文件。可选的,根据新的第二镜像文件的版本可以查找对应的第三镜像文件。其中,服务器解析第一下载请求的过程可参考步骤120中的相关描述,当前不作赘述。Optionally, the server parses the first download request after receiving it to find the new second image file that needs to be downloaded and the corresponding third image file. Optionally, the corresponding third image file can be searched according to the version of the new second image file. For the process of the server parsing the first download request, reference can be made to the relevant description in step 120, which will not be described in detail at this time.
服务器将查找到的新的第二镜像文件和对应的第三镜像文件发送至第一终端。示例性的,第一终端接收到新的第二镜像文件时,使用新的第二镜像文件替换本地原有的第二镜像文件,以实现版本的更新,之后,基于当前的版本运行云桌面,并将新增的数据写入当前版本对应的第三镜像文件中。可选的,更新前,第一终端原有的版本也可存在对应的第三镜像文件,此时,对于第三镜像文件的处理可参考步骤120中的相关描述,当前不作赘述。The server sends the found new second image file and the corresponding third image file to the first terminal. For example, when the first terminal receives the new second image file, it uses the new second image file to replace the original local second image file to update the version, and then runs the cloud desktop based on the current version. And write the newly added data into the third image file corresponding to the current version. Optionally, before the update, the original version of the first terminal may also have a corresponding third image file. At this time, for the processing of the third image file, refer to the relevant description in step 120, which will not be described again at this time.
上述,服务器接收第一终端发送的第一下载请求,并基于第一下载请求将第一镜像中心的第二镜像文件下发至第一终端,以使第一终端使用新的第二镜像文件替换本地的第二镜像文件,进而使第一终端应用第一终端运行云桌面时使用新的第二镜像文件,并且,第一终端运行过程中新增的数据均写入新的第二镜像文件对应的第三镜像文件的技术手段,解决了相关技术中服务器将镜像文件下发至终端需要耗费较多的网络资源的技术问题。通过将镜像分为三个层级的文件,并且,第一终端下载新的镜像文件时,服务器无需下发全部的镜像文件,只需要下发第二镜像文件,减小了下载文件的内存,节省了网络资源,减小了下载时长。并且,由于第三镜像文件创建后是空白的文件,因此,即使需要下发对应的第三镜像文件,也只占用很少的网络资源,保证了网络资源的合理运用。As mentioned above, the server receives the first download request sent by the first terminal, and delivers the second image file of the first image center to the first terminal based on the first download request, so that the first terminal uses the new second image file to replace The local second image file enables the first terminal to use the new second image file when the first terminal runs the cloud desktop, and the new data added during the operation of the first terminal is written into the new second image file corresponding to The technical means of the third image file solves the technical problem in related technologies that the server needs to consume a lot of network resources to deliver the image file to the terminal. By dividing the image into three levels of files, and when the first terminal downloads a new image file, the server does not need to deliver all the image files, but only the second image file, which reduces the memory for downloading files and saves money. Use network resources and reduce download time. Moreover, since the third image file is a blank file after creation, even if the corresponding third image file needs to be delivered, only a small amount of network resources will be occupied, ensuring the rational use of network resources.
本申请一个实施例中,服务器中的镜像需要注册后才可供终端使用,当前,以第一镜像为例,描述镜像的注册过程。图5为本申请一个实施例提供的一种镜像管理方法的流程图,其为服务器进行镜像注册管理时的具体流程,参考图5,该镜像管理方法包括:In one embodiment of the present application, the image in the server needs to be registered before it can be used by the terminal. Currently, the first image is taken as an example to describe the image registration process. Figure 5 is a flow chart of an image management method provided by an embodiment of the present application. It is a specific process when the server performs image registration and management. Referring to Figure 5, the image management method includes:
步骤210、获取第一镜像文件和第二镜像文件。Step 210: Obtain the first image file and the second image file.
示例性的,第一镜像文件和第二镜像文件被创建后,需要先上传至服务器中,以供服务器注册,其中,第一镜像文件和第二镜像文件可以分别上传或同时上传,创建第一镜像文件和第二镜像文件的终端以及使用上传规则当前不作限定。一个实施例中,当前上传的第一镜像文件和第二镜像文件可分别认为是初始的BaseImage和初始的LowerImage。第二镜像文件基于第一镜像文件创建。For example, after the first image file and the second image file are created, they need to be uploaded to the server first for server registration. The first image file and the second image file can be uploaded separately or at the same time to create the first image file. There are currently no restrictions on the terminals and upload rules for image files and second image files. In one embodiment, the first image file and the second image file currently uploaded can be considered as the initial BaseImage and the initial LowerImage respectively. The second image file is created based on the first image file.
可理解,第一镜像文件和第二镜像文件上传的过程,也可以认为是服务器获取第一镜像文件和第二镜像文件的过程。It can be understood that the process of uploading the first image file and the second image file can also be considered as the process of the server obtaining the first image file and the second image file.
步骤220、将第一镜像文件和第二镜像文件分别硬链接到第一镜像。Step 220: Hard link the first image file and the second image file to the first image respectively.
示例性的,为了保证终端正确使用第一镜像,将第一镜像文件和第二镜像文件分别硬链接到第一镜像,即明确第一镜像当前使用的第一镜像文件和第二镜像文件,可理解,若第二镜像文件供一个分支使用,那么,将第一镜像文件和第二镜像文件硬链接到第一镜像时可以是连接到其所属的分支。之后,当创建第一镜像的新的分支时,可以在基于新的分支使用的第二镜像文件更新第一镜像的镜像元数据,再将第一镜像文本和新的分支使用的第二镜像文件硬链接到第一镜像(具体为新的分 支)中。For example, in order to ensure that the terminal uses the first image correctly, the first image file and the second image file are hard-linked to the first image respectively, that is, the first image file and the second image file currently used by the first image are clearly defined. It is understood that if the second image file is used by a branch, then when the first image file and the second image file are hard-linked to the first image, they can be connected to the branch to which they belong. Later, when a new branch of the first image is created, the image metadata of the first image can be updated based on the second image file used by the new branch, and then the first image text and the second image file used by the new branch can be updated. Hard link to the first image (specifically the new Branch) in.
一个实施例中,将第一镜像文件和第二镜像文件分别硬链接到第一镜像时,还包括:创建第一镜像的镜像记录,并在镜像记录中添加第一镜像的镜像元数据。In one embodiment, hard linking the first image file and the second image file to the first image respectively also includes: creating an image record of the first image, and adding image metadata of the first image to the image record.
其中,第一镜像的镜像元数据描述了第一镜像的属性,如镜像元数据记载第一镜像包含的分支以及每个分支对应的用户ID等内容。镜像元数据可以基于第一镜像文件和第二镜像文件确定。可选的,生成第一镜像的镜像元数据后,记录第一镜像的镜像元数据。其中,将镜像元数据记录在镜像记录中。示例性的,创建第一镜像的镜像记录,该镜像记录添加在镜像表中,之后,在镜像记录添加第一镜像的镜像元数据。可选的,第一镜像更新时(如第一镜像中创建了新的分支、新的版本等),镜像记录中的镜像元数据也同步更新。Among them, the image metadata of the first image describes the attributes of the first image. For example, the image metadata records the branches included in the first image and the user ID corresponding to each branch. The image metadata may be determined based on the first image file and the second image file. Optionally, after generating the image metadata of the first image, record the image metadata of the first image. Among them, the image metadata is recorded in the image record. For example, a mirror record of the first mirror is created, the mirror record is added to the mirror table, and then the mirror metadata of the first mirror is added to the mirror record. Optionally, when the first image is updated (for example, a new branch, a new version, etc. is created in the first image), the image metadata in the image record is also updated simultaneously.
上述过程也可以认为是镜像注册的过程。The above process can also be considered as the image registration process.
步骤230、基于第二镜像文件初始的第二快照创建对应的版本目录,并将第一镜像文件和第二镜像文件分别硬链接到版本目录中,得到第一镜像。Step 230: Create a corresponding version directory based on the initial second snapshot of the second image file, and hard-link the first image file and the second image file to the version directory respectively to obtain the first image.
示例性的,注册完成后,进行版本创建。一个实施例中,第一镜像文件包含唯一的第一快照,第二镜像文件创建前,将第一镜像文件的文件名改为第一快照的第一快照名,第二镜像文件创建时记录第一快照的第一快照名。可选的,第二镜像文件创建后创建初始的第二快照。创建初始的第二快照时,第二镜像文件包含操作系统内置的设备驱动和应用程序,后续,用户可以基于第二镜像文件衍生出自己的第二镜像文件。第一镜像文件和初始的第二镜像文件(只包含设备驱动和供应商内置的应用程序,并生成第二快照)可以由第一镜像的供应商创建并上传至服务器中。后续用户根据第二镜像文件生成自己的快照(此时,包含个性化数据,比如应用程序的升级补丁)。For example, after registration is completed, version creation is performed. In one embodiment, the first image file contains a unique first snapshot. Before the second image file is created, the file name of the first image file is changed to the first snapshot name of the first snapshot. When the second image file is created, the first snapshot name is recorded. The first snapshot name of a snapshot. Optionally, create an initial second snapshot after the second image file is created. When the initial second snapshot is created, the second image file contains the device drivers and applications built into the operating system. Subsequently, the user can derive his or her own second image file based on the second image file. The first image file and the initial second image file (which only contains device drivers and vendor-built applications and generates a second snapshot) can be created by the vendor of the first image and uploaded to the server. Subsequent users generate their own snapshots based on the second image file (this time, including personalized data, such as application upgrade patches).
基于初始第二快照创建初始的第二快照对应的版本,并创建该版本对应的版本目录,在该版本目录中添加该版本所使用的第一镜像文件和第二镜像文件。可选的,创建版本时,可以确定版本ID,创建版本目录时,可以记录版本目录对应的版本ID,以将版本和版本目录关联起来。一个实施例中,第一镜像文件和第二镜像文件均以硬链接的方式添加在版本目录中。可选的,对于第一镜像文件而言,其先被硬链接到第一镜像,之后,再将第一镜像中的第一镜像文件硬链接至版本目录,第二镜像文件与第一镜像文件的硬连接过程相似的,当前不作赘述。此时,在版本目录中添加第一镜像文件和第二镜像文件后,可以认为得到第一镜像。可选的,由于终端通过种子文件下载对应的镜像,因此,将第一镜像文件和第二镜像文件硬链接到版本目录后,还需要针对第一镜像文件和第二镜像文件分别创建对应的P2P下载的种子文件,以使终端进行下载。Create a version corresponding to the initial second snapshot based on the initial second snapshot, create a version directory corresponding to the version, and add the first image file and the second image file used by the version in the version directory. Optionally, when creating a version, the version ID can be determined, and when creating a version directory, the version ID corresponding to the version directory can be recorded to associate the version with the version directory. In one embodiment, both the first image file and the second image file are added in the version directory in the form of hard links. Optionally, for the first image file, it is first hard-linked to the first image, and then the first image file in the first image is hard-linked to the version directory, and the second image file and the first image file are The hard connection process is similar and will not be described in detail at this time. At this time, after adding the first image file and the second image file to the version directory, it can be considered that the first image is obtained. Optionally, since the terminal downloads the corresponding image through the seed file, after hard linking the first image file and the second image file to the version directory, it is also necessary to create corresponding P2P images for the first image file and the second image file respectively. Download the torrent file to enable the terminal to download.
一个实施例中,基于第二镜像文件初始的第二快照创建对应的版本目录时,还包括:创建初始的第二快照对应的版本记录,并在版本记录中记录初始的第二快照对应版本的版本元数据。In one embodiment, when creating a corresponding version directory based on the initial second snapshot of the second image file, it also includes: creating a version record corresponding to the initial second snapshot, and recording the version corresponding to the initial second snapshot in the version record. Version metadata.
示例性的,创建版本时,除了创建版本目录还创建版本记录,版本记录也可以通过版本ID与版本关联。一个实施例中,基于版本中使用的第一镜像文件和第二镜像文件确定版本的版本元数据。其中,版本元数据可以包括用户ID、版本ID以及前序版本ID等内容,前序版本是指当前版本的前一版本,即第二镜像文件创建当前版本之前的版本。版本元数据可以结合版本的属性进行更新。之后,将版本元数据添加在版本对应的版本记录中。For example, when creating a version, in addition to creating a version directory, a version record is also created. The version record can also be associated with the version through the version ID. In one embodiment, the version metadata of the version is determined based on the first image file and the second image file used in the version. The version metadata may include user ID, version ID, pre-order version ID, etc. The pre-order version refers to the previous version of the current version, that is, the version before the current version is created in the second image file. Version metadata can be updated in conjunction with version attributes. Afterwards, the version metadata is added to the version record corresponding to the version.
一个实施例中,以服务器创建第三镜像文件为例。此时,步骤230之后还包括步骤240。In one embodiment, taking the server creating a third image file as an example. At this time, step 240 is also included after step 230.
步骤240、基于初始的第二快照创建对应的第三镜像文件。Step 240: Create a corresponding third image file based on the initial second snapshot.
可选的,服务器创建第二镜像文件的初始的第二快照后,基于初始的第二快照创建对应的第三镜像文件。一种可行手段,将第二镜像文件的文件名改成初始的第二快照的快照名,以在创建第三镜像文件中,在第三镜像文件中记录第二快照的快照 名。Optionally, after the server creates an initial second snapshot of the second image file, the server creates a corresponding third image file based on the initial second snapshot. A feasible method is to change the file name of the second image file to the snapshot name of the initial second snapshot, so as to record the snapshot of the second snapshot in the third image file when creating the third image file. name.
可选的,创建完成后,在对应的版本目录中添加第三镜像文件,以通过版本目录明确对应版本包含的三类镜像文件。其中,第三镜像文件添加在版本目录的实现手段当前不作限定。Optionally, after creation, add a third image file in the corresponding version directory to identify the three types of image files included in the corresponding version through the version directory. Among them, the implementation method of adding the third image file to the version directory is currently not limited.
可选的,创建第三镜像文件后,针对第三镜像文件创建对应的P2P下载的种子文件,以使终端进行下载。Optionally, after creating the third image file, create a corresponding P2P download seed file for the third image file so that the terminal can download it.
第一终端首次运行云桌面前,需要先从服务器中下载第一镜像的第一镜像文件、初始的第二镜像文件以及初始的第二镜像文件所对应的第三镜像文件(当前为下载种子文件,之后,基于种子文件得到对应的镜像文件)。后续更新时,无需重复下载第一镜像文件。Before the first terminal runs the cloud desktop for the first time, it needs to download the first image file of the first image, the initial second image file, and the third image file corresponding to the initial second image file from the server (currently downloading the seed file , and then obtain the corresponding image file based on the seed file). During subsequent updates, there is no need to download the first image file again.
实际应用中,也可以由第一终端创建第三镜像文件。可选的,第一终端创建第三镜像文件后,可以通知服务器,以使服务器在对应的版本目录中添加第三镜像文件。In actual applications, the third image file can also be created by the first terminal. Optionally, after the first terminal creates the third image file, it may notify the server so that the server adds the third image file in the corresponding version directory.
下面对镜像注册过程进行示例性描述,图6为本申请一个实施例提供的一种镜像注册流程图。参考图6,其示出了镜像上传和注册的流程以及各流程下镜像文件的处理方式。注册开始后,先进行镜像上传,即上传所需的文件,图6以第一镜像文件和第二镜像文件为例,该过程中服务器分别获取第一镜像文件和第二镜像文件。之后,进行镜像注册。该过程中,生成第一镜像的镜像元数据,对应的文件处理方式是将第一镜像文件和第二镜像文件分别硬链接至第一镜像。之后,创建第一镜像的镜像记录并将镜像元数据添加在镜像记录中。之后,创建初始的还原点(也可理解为创建初始的版本),初始的还原点是指第二镜像文件初始的第二快照,对应的文件处理方式是创建对应版本的版本目录,将镜像注册过程中硬链接的第一镜像文件和第二镜像文件分别硬链接至版本目录中。并且,基于第二镜像文件的初始的第二快照创建对应的第三镜像文件。之后,进行种子创建,即分别创建第一镜像文件、第二镜像文件和第三镜像文件对应的种子文件,以供第一终端进行下载。The following is an exemplary description of the image registration process. Figure 6 is an image registration flow chart provided by an embodiment of the present application. Referring to Figure 6, it shows the process of image uploading and registration as well as the processing method of image files under each process. After registration starts, image upload is performed first, that is, the required files are uploaded. Figure 6 takes the first image file and the second image file as an example. During this process, the server obtains the first image file and the second image file respectively. After that, perform image registration. In this process, image metadata of the first image is generated, and the corresponding file processing method is to hard-link the first image file and the second image file to the first image respectively. After that, create an image record for the first image and add image metadata to the image record. After that, create an initial restore point (which can also be understood as creating an initial version). The initial restore point refers to the initial second snapshot of the second image file. The corresponding file processing method is to create a version directory of the corresponding version and register the image. The first image file and the second image file hard-linked during the process are hard-linked to the version directory respectively. Furthermore, a corresponding third image file is created based on the initial second snapshot of the second image file. After that, seed creation is performed, that is, seed files corresponding to the first image file, the second image file, and the third image file are respectively created for the first terminal to download.
可选的,第一终端下载第一镜像文件和初始的第二镜像文件后,以内置第一镜像文件和初始的第二镜像文件。Optionally, after downloading the first image file and the initial second image file, the first terminal builds the first image file and the initial second image file.
上述,在镜像注册过程中,通过硬链接的方式,可以实现镜像文件的复用,并且第一镜像文件和第二镜像文件独立上传和注册,便于后续镜像管理,如版本更新时,只需要修改第二镜像文件,无需修改第一镜像文件。As mentioned above, during the image registration process, image files can be reused through hard links, and the first image file and the second image file are uploaded and registered independently, which facilitates subsequent image management. For example, when the version is updated, only modifications are required. The second image file does not need to modify the first image file.
本申请一个实施例中,服务器进行管理时,还需要进行镜像合并管理,其中,镜像合并可理解为将UpperImage中记录的用户个性化数据写入对应的LowerImage中,以实现在LowerImage中添加用户的个性化数据。当前,以第一镜像为例,描述镜像的合并过程。其中,第一镜像在服务器中记录有对应的快照列表,快照列表中记录第一镜像的各版本及各版本对应的第二快照,可选的,快照列表中记录各版本ID及对应的第二快照名。图7为本申请一个实施例提供的一种镜像管理方法的流程图,其为服务器进行镜像合并管理时的流程,参考图7,该镜像管理方法包括:In one embodiment of the present application, when the server is managed, image merging management is also required. Image merging can be understood as writing the user personalized data recorded in the UpperImage into the corresponding LowerImage, so as to add the user's data in the LowerImage. Personalized data. Currently, the first image is taken as an example to describe the image merging process. Among them, the first image is recorded in the server with a corresponding snapshot list. The snapshot list records each version of the first image and the second snapshot corresponding to each version. Optionally, the snapshot list records each version ID and the corresponding second snapshot. Snapshot name. Figure 7 is a flow chart of an image management method provided by an embodiment of the present application. It is a process when the server performs image merge management. Referring to Figure 7, the image management method includes:
步骤310、接收第一终端上传的第三镜像文件。Step 310: Receive the third image file uploaded by the first terminal.
示例性的,第一终端运行云桌面时,将新增的数据(即用户的个性化)数据写入第三镜像文件中,例如,第一终端在云桌面中安装新的应用程序或新的设备驱动时,新的应用程序和新的设备驱动被写入第三镜像文件中,再如,第一终端在云桌面中存储新的文件和数据时,新的文件或数据写入第三镜像文件中。当第一终端的用户存在将第三镜像文件的数据写入第二镜像文件的需求时,可以将第三镜像文件上传至服务器中,可选的,在上传时,还可以发送镜像合并请求,以使服务器进行镜像合并。Exemplarily, when the first terminal runs the cloud desktop, the new data (ie, the user's personalized) data is written into the third image file. For example, the first terminal installs a new application or a new application in the cloud desktop. When the device is driven, new applications and new device drivers are written into the third image file. For another example, when the first terminal stores new files and data in the cloud desktop, the new files or data are written into the third image file. in the file. When the user of the first terminal needs to write the data of the third image file into the second image file, the third image file can be uploaded to the server. Optionally, when uploading, an image merging request can also be sent. to enable the server to perform image merging.
可选的,服务器进行镜像合并前,先确定第一终端使用的第一镜像,之后,锁定第一镜像。示例性的,确定第一终端使用的第一镜像时所使用的技术手段当前不作限定,例如,第一终端上传第三镜像文件时,告知服务器自身使用的第一镜像,再如,服务器中记录使用各镜像的各终端,第一终端上传第三镜像文件时,告知第一终端的身份数据(如用户ID等),之 后服务器根据身份数据确定第一终端所使用的第一镜像。示例性的,锁定第一镜像的目的是禁止第一镜像被下载,此时,各终端无法下载第一镜像包含的各种子文件。Optionally, before merging images, the server first determines the first image used by the first terminal, and then locks the first image. For example, the technical means used to determine the first image used by the first terminal are not currently limited. For example, when the first terminal uploads the third image file, it informs the server of the first image used by itself. For another example, the server records Each terminal using each image, when the first terminal uploads the third image file, informs the first terminal of its identity data (such as user ID, etc.), and then The server determines the first image used by the first terminal based on the identity data. For example, the purpose of locking the first image is to prohibit the first image from being downloaded. At this time, each terminal cannot download various sub-files included in the first image.
可选的,第三镜像文件已经包含了第二快照名,服务器基于第二快照名可以查找到对应的版本、第二镜像文件等内容。因此,第一终端上传第三镜像文件前无需进行版本校验。可选的,可以通过差分的方式上传第三镜像文件。Optionally, the third image file already contains the second snapshot name, and the server can find the corresponding version, the second image file, and other contents based on the second snapshot name. Therefore, the first terminal does not need to perform version verification before uploading the third image file. Optionally, the third image file can be uploaded in a differential manner.
步骤320、获取第一终端中第一镜像当前的版本ID。Step 320: Obtain the current version ID of the first image in the first terminal.
示例性的,服务器确定第一终端当前使用的版本ID,即确定ClientRevisionId。例如,第一终端上传第三镜像文件时,上传版本ID,服务器可以直接获取版本ID,又如,第一终端上传第三镜像文件后,服务器通过解析第三镜像文件获取第三镜像文件中记录的第二快照的第二快照名,之后,基于第二快照名在快照列表中查找对应的版本以获取版本ID,还如,服务器解析第一终端当前使用版本对应的版本元数据,以在版本元数据中获取到版本ID,其中,服务器可以查找第一终端当前使用版本的版本记录,之后,基于版本记录中的版本元数据得到版本ID。For example, the server determines the version ID currently used by the first terminal, that is, the ClientRevisionId. For example, when the first terminal uploads the third image file, the server can directly obtain the version ID by uploading the version ID. Another example is, after the first terminal uploads the third image file, the server obtains the records in the third image file by parsing the third image file. The second snapshot name of the second snapshot, and then, based on the second snapshot name, search the corresponding version in the snapshot list to obtain the version ID. For example, the server parses the version metadata corresponding to the version currently used by the first terminal to obtain the version ID. The version ID is obtained from the metadata, where the server can search for the version record of the version currently used by the first terminal, and then obtain the version ID based on the version metadata in the version record.
步骤330、查找版本ID对应的第二镜像文件。Step 330: Search for the second image file corresponding to the version ID.
一个实施例中,服务器中存储的各数据可以存放在数据库中,即BaseImage、LowerIamge和UpperImage均存放在数据库中。服务器获取版本ID后,基于版本ID在数据库中查找对应的第二镜像文件。In one embodiment, each data stored in the server can be stored in a database, that is, BaseImage, LowerImage, and UpperImage are all stored in the database. After the server obtains the version ID, it searches for the corresponding second image file in the database based on the version ID.
可选的,查找第二镜像文件时,先根据版本ID,在数据库中查找到第一终端使用的第三镜像文件的存储路径(Client UpperIamge Path)和第二镜像文件的存储路径(LowerIamge Path)。其中,根据版本ID可以查找到对应的版本目录,根据版本目录的记载可以得到Client UpperIamge Path和LowerIamge Path。或者是,根据版本ID获取对应的第二快照名,并基于第二快照名得到Client UpperIamge Path和LowerIamge Path。之后,根据LowerIamge Path可以获取到对应的第二镜像文件。Optionally, when searching for the second image file, first find the storage path of the third image file (Client UpperIamge Path) and the storage path of the second image file (LowerIamge Path) used by the first terminal in the database based on the version ID. . Among them, the corresponding version directory can be found according to the version ID, and the Client UpperIamge Path and LowerIamge Path can be obtained according to the records in the version directory. Or, obtain the corresponding second snapshot name based on the version ID, and obtain the Client UpperIamge Path and LowerIamge Path based on the second snapshot name. After that, the corresponding second image file can be obtained according to the LowerIamge Path.
步骤340、将第三镜像文件提交到第二镜像文件,以得到新的第二镜像文件。Step 340: Submit the third image file to the second image file to obtain a new second image file.
示例性的,将第三镜像文件中记录的数据以信息块的方式写入第二镜像文件中,以实现镜像的合并。其中,第三镜像文件提交到第二镜像文件中也可以认为是commit过程。将第三镜像文件提交到第二镜像文件后,可以认为更新了第二镜像文件,此时,为了与原有的第二镜像文件进行区别,将提交得到的第二镜像文件记为新的第二镜像文件。For example, the data recorded in the third image file is written into the second image file in the form of information blocks to achieve image merging. Among them, the submission of the third image file to the second image file can also be considered as a commit process. After the third image file is submitted to the second image file, it can be considered that the second image file has been updated. At this time, in order to distinguish it from the original second image file, the submitted second image file is recorded as the new third image file. Two image files.
一个实施例中,由于第二镜像文件可能包含多个快照,因此,步骤330中查找到的第二镜像文件当前的版本(即最新的版本)可能不是第一终端所使用的版本,即第二镜像文件并非是创建第三镜像文件时使用的版本。为了保证镜像合并的正常实现,需要先将第二镜像文件调整至与第三镜像文件对应的版本,此时,步骤340可包括步骤341-步骤343:In one embodiment, since the second image file may contain multiple snapshots, the current version of the second image file found in step 330 (ie, the latest version) may not be the version used by the first terminal, that is, the second The image file is not the version used when creating the third image file. In order to ensure the normal implementation of image merging, it is necessary to first adjust the second image file to the version corresponding to the third image file. At this time, step 340 may include steps 341 to 343:
步骤341、将第二镜像文件还原到第三镜像文件所对应的第二快照。Step 341: Restore the second image file to the second snapshot corresponding to the third image file.
示例性的,根据第三镜像文件中记录的第二快照名确定对应的第二快照,之后,将第二镜像文件还原到该第二快照对应的状态。For example, the corresponding second snapshot is determined according to the second snapshot name recorded in the third image file, and then the second image file is restored to a state corresponding to the second snapshot.
步骤342、对还原后的第二镜像文件进行重命名,以使第二镜像文件使用第二快照的第二快照名。Step 342: Rename the restored second image file so that the second image file uses the second snapshot name of the second snapshot.
可理解,在第二镜像文件中创建一个新的第二快照时,将第二镜像文件的文件名修改成新的第二快照的第二快照名,以便于明确第二镜像文件当前使用的版本,并且,将第三镜像文件提交到第二镜像文件时,需要保证第三镜像文件中记录的第二快照名与第二镜像文件的文件名一致。若第二镜像文件的文件名与第三镜像文件中记录的第二快照名不一致,则无法准确、安全的将第三镜像文件提交到第二镜像文件中,因此,对第二镜像文件进行还原后,重命名第二镜像文件,重命名后,第二 镜像文件的文件名更改为第一终端上传的第三镜像文件中记录的第二快照名。It can be understood that when creating a new second snapshot in the second image file, the file name of the second image file is modified to the second snapshot name of the new second snapshot, so as to clarify the version currently used by the second image file. , and when submitting the third image file to the second image file, it is necessary to ensure that the second snapshot name recorded in the third image file is consistent with the file name of the second image file. If the file name of the second image file is inconsistent with the second snapshot name recorded in the third image file, the third image file cannot be accurately and safely submitted to the second image file. Therefore, the second image file must be restored. After that, rename the second image file. After renaming, the second The file name of the image file is changed to the second snapshot name recorded in the third image file uploaded by the first terminal.
步骤343、将第三镜像文件提交到重命名后的第二镜像文件。Step 343: Submit the third image file to the renamed second image file.
示例性的,将第三镜像文件commit到重命名后的第二镜像文件中。For example, commit the third image file to the renamed second image file.
步骤350、在新的第二镜像文件中创建新的第二快照。Step 350: Create a new second snapshot in the new second image file.
示例性的,第三镜像文件提交到第二镜像文件后,新的第二镜像文件新增了用户的个性化数据,之后,为第二镜像文件创建一个新的第二快照,以在后续需要时,将第二镜像文件还原到提交第三镜像文件后的状态。可选的,创建新的第二快照时,生成新的第二快照的快照名。可选的,创建了新的快照也可以理解为创建了新的版本,此时,可以建立新的版本记录和版本目录,并在新的版本记录中添加新的版本元数据,并在版本目录中记录该版本对应的第一镜像文件、第二镜像文件和第三镜像文件。For example, after the third image file is submitted to the second image file, the new second image file adds the user's personalized data, and then a new second snapshot is created for the second image file for subsequent needs. When, restore the second image file to the state after submitting the third image file. Optionally, when creating a new second snapshot, generate a snapshot name for the new second snapshot. Optionally, creating a new snapshot can also be understood as creating a new version. At this time, you can create a new version record and version directory, add new version metadata to the new version record, and add new version metadata to the version directory. The first image file, second image file and third image file corresponding to this version are recorded in.
一个实施例中,每个UpperIamge均有唯一标识符,通过唯一标识符可以区分不同的UpperIamg,唯一标识符可以在UpperIamge创建时生成。可选的,第一终端上传第三镜像文件时,提供第三镜像文件的唯一标识符,第二镜像文件创建对应新的第二快照时,可以将唯一标识符作为对应的第二快照名,即满足了第二快照名唯一性的需求。In one embodiment, each UpperIamge has a unique identifier. Different UpperIamges can be distinguished through the unique identifier. The unique identifier can be generated when the UpperIamge is created. Optionally, when the first terminal uploads the third image file, it provides a unique identifier of the third image file. When the second image file creates a corresponding new second snapshot, the unique identifier can be used as the corresponding second snapshot name. That is, the requirement for uniqueness of the second snapshot name is met.
当前,以在服务器中创建第三镜像文件为例,此时,步骤350之后,还包括步骤360-步骤370:Currently, taking the creation of the third image file in the server as an example, at this time, after step 350, steps 360 to 370 are also included:
步骤360、删除第三镜像文件。Step 360: Delete the third image file.
示例性的,由于已经在新的第二镜像文件中写入了第三镜像文件所记录的数据,因此,可以删除第三镜像文件。可选的,若第一终端存储第三镜像文件,则可以通知第一终端删除第三镜像文件。For example, since the data recorded in the third image file has been written in the new second image file, the third image file can be deleted. Optionally, if the first terminal stores the third image file, the first terminal may be notified to delete the third image file.
步骤370、基于新的第二快照创建新的第三镜像文件。Step 370: Create a new third image file based on the new second snapshot.
示例性的,新的第二镜像文件中创建了新的第二快照,因此,需要基于新的第二快照创建新的第三镜像文件,以在第一终端使用新的第二镜像文件时,在新的第三镜像文件中记录新增的数据。可理解,新的第三镜像文件包含新的第二快照的快照名。For example, a new second snapshot is created in the new second image file. Therefore, a new third image file needs to be created based on the new second snapshot to use the new second image file on the first terminal. Record the newly added data in the new third image file. It can be understood that the new third image file contains the snapshot name of the new second snapshot.
一个实施例中,创建新的第二快照后,第一镜像中使用的第二镜像文件的内容发生了变化,因此,需要更新快照列表和镜像记录。此时,步骤370之后,还可以包括步骤380。In one embodiment, after a new second snapshot is created, the content of the second image file used in the first image changes. Therefore, the snapshot list and the image record need to be updated. At this time, after step 370, step 380 may also be included.
步骤380、更新快照列表,并更新镜像记录中的镜像元数据。Step 380: Update the snapshot list and update the image metadata in the image record.
示例性的,创建新的第二快照或创建第三镜像文件后,更新第一镜像的快照列表,以在快照列表中添加新的第二快照以及基于新的第二快照对应的版本。For example, after creating a new second snapshot or creating a third image file, the snapshot list of the first image is updated to add the new second snapshot and the version corresponding to the new second snapshot in the snapshot list.
可选的,更新快照列表后,可以分别为新的第二镜像文件和新的第三镜像文件创建对应的种子文件,以供第一终端进行下载。Optionally, after updating the snapshot list, corresponding seed files can be created for the new second image file and the new third image file respectively for the first terminal to download.
示例性的,更新快照列表后,还需要更新镜像表中第一镜像对应的镜像记录,即基于新的第二镜像文件更新镜像记录中第一镜像的镜像元数据。可选的,更新镜像记录可以在创建种子文件之后执行。For example, after updating the snapshot list, you also need to update the image record corresponding to the first image in the image table, that is, update the image metadata of the first image in the image record based on the new second image file. Optionally, updating the image record can be performed after creating the seed file.
更新第一镜像的镜像元数据后,解锁第一镜像,以供第一终端进行下载。可选的,服务器通知第一终端进行了版本更新,之后,第一终端生成用于下载新的第二镜像文件和对应的第三镜像文件的第一下载请求并发送至服务器中,服务器根据第一下载请求,将新的第二镜像文件和对应的第三镜像文件发送至第一终端,以供第一终端使用。 After updating the image metadata of the first image, the first image is unlocked for download by the first terminal. Optionally, the server notifies the first terminal of a version update. After that, the first terminal generates a first download request for downloading the new second image file and the corresponding third image file and sends it to the server. Upon a download request, the new second image file and the corresponding third image file are sent to the first terminal for use by the first terminal.
需要说明,本步骤也可在新的第二镜像文件中创建新的第二快照之后执行。It should be noted that this step can also be performed after creating a new second snapshot in the new second image file.
可理解,实际应用中,由第一终端创建第三镜像文件时,步骤370中创建新的第三镜像文件的过程在第一终端中实现。It can be understood that in actual applications, when the third image file is created by the first terminal, the process of creating a new third image file in step 370 is implemented in the first terminal.
下面对镜像注册的一般过程进行示例性描述,图8为本申请一个实施例提供的一种镜像合并流程图。参考图8,合并开始后,先锁定对应的镜像,之后,解析终端使用的版本所对应的版本元数据(即ClientRevisionmeta),以得到ClientRevisionID(终端使用的版本ID),之后,根据ClientRevisionID从数据库中查找到Client UpperImage Path(即终端使用的第三镜像文件的路径)和LowerImage Path(即第二镜像文件的路径),之后,将LowerImage还原到Client UpperImage依赖的快照,重命名LowerImage,将Client UpperImage提交到LowerImage,为LowerImage创建新的快照,删除旧的UpperImage,创建新的UpperImage,更新快照列表,创建LowerImage和UpperImage的种子文件,更新镜像表中的镜像记录,解除锁定。以此,完成镜像合并。The following is an exemplary description of the general process of image registration. Figure 8 is an image merging flow chart provided by an embodiment of the present application. Referring to Figure 8, after the merger starts, the corresponding image is first locked, and then the version metadata (i.e. ClientRevisionmeta) corresponding to the version used by the terminal is parsed to obtain the ClientRevisionID (the version ID used by the terminal). After that, the clientRevisionID is retrieved from the database based on the ClientRevisionID. Find the Client UpperImage Path (that is, the path of the third image file used by the terminal) and the LowerImage Path (that is, the path of the second image file). After that, restore the LowerImage to the snapshot that the Client UpperImage depends on, rename the LowerImage, and submit the Client UpperImage. Go to LowerImage, create a new snapshot for LowerImage, delete the old UpperImage, create a new UpperImage, update the snapshot list, create seed files for LowerImage and UpperImage, update the mirror record in the mirror table, and unlock. In this way, the image merge is completed.
上述,第一终端运行云桌面时新增的数据均写到第三镜像文件中,不会修改第一镜像文件和第二镜像文件,因此,当第一终端或服务器存在镜像合并的需求时,只需要将本地的第三镜像文件上传至服务器中,然后服务器将第三镜像文件提交到第二镜像文件即可,减少了第一终端上传数据量,提高了上传速度和效率,节约了网络资源,进而提高了镜像合并的效率和速度。As mentioned above, the newly added data when the first terminal runs the cloud desktop is written to the third image file, and the first image file and the second image file will not be modified. Therefore, when there is a need for image merging on the first terminal or server, You only need to upload the local third image file to the server, and then the server submits the third image file to the second image file. This reduces the amount of data uploaded by the first terminal, improves upload speed and efficiency, and saves network resources. , thereby improving the efficiency and speed of image merging.
本申请一个实施例中,服务器进行管理时,还需要进行镜像还原管理,其中,镜像还原可以理解为将LowerImage还原到某个制定的版本。当前,以第一镜像为例,描述镜像的还原过程。图9为本申请一个实施例提供的一种镜像管理方法的流程图,其为服务器进行镜像还原管理时的流程,参考图,该镜像管理方法包括:In one embodiment of this application, when the server is managed, image restoration management is also required. Image restoration can be understood as restoring the LowerImage to a certain specified version. Currently, the first image is used as an example to describe the image restoration process. Figure 9 is a flow chart of an image management method provided by an embodiment of the present application. It is a process when the server performs image restoration management. Referring to the figure, the image management method includes:
步骤410、接收镜像还原指令。Step 410: Receive the image restoration instruction.
示例性的,镜像还原指令用于指示服务器进行镜像还原,其可以在终端处生成也可以在服务器处生成,当服务器生成镜像还原指令时,服务器的用户(如具有一定权限的管理人员)可以选择需要还原的LowerImage以及需要还原的版本,之后,服务器根据选择生成镜像还原指令,进而接收镜像还原指令。当前,以镜像还原指令还原第一镜像中的第二镜像文件为例进行描述。For example, the image restoration instruction is used to instruct the server to perform image restoration, which can be generated at the terminal or at the server. When the server generates the image restoration instruction, the user of the server (such as an administrator with certain permissions) can select The LowerImage that needs to be restored and the version that needs to be restored. After that, the server generates an image restoration instruction based on the selection, and then receives the image restoration instruction. Currently, the image restoration instruction is used to restore the second image file in the first image as an example for description.
可选的,服务器接收到镜像还原指令后,确定进行镜像还原,并锁定第一终端使用的第一镜像,其中,锁定第一镜像的过程可参考步骤310中锁定第一镜像的过程,当前不作赘述。Optionally, after receiving the image restoration instruction, the server determines to perform image restoration and locks the first image used by the first terminal. The process of locking the first image can refer to the process of locking the first image in step 310, which is not currently performed. Repeat.
步骤420、根据镜像还原指令,获取待还原的版本ID。Step 420: Obtain the version ID to be restored according to the image restoration instruction.
示例性的,待还原的版本ID是指期望第二镜像文件还原到的版本ID。可选的,镜像还原指令包含待还原的版本ID。还可选的,服务器根据镜像还原指令,调用对应的参数,以通过该参数获取待还原的版本ID,其中,调用的参数以字符串变量的方式呈现,且可包含第一镜像的镜像ID、第一终端的用户ID、版本ID等内容。For example, the version ID to be restored refers to the version ID to which the second image file is expected to be restored. Optionally, the image restore command includes the version ID to be restored. Optionally, the server calls the corresponding parameter according to the image restoration instruction to obtain the version ID to be restored through the parameter. The parameter called is presented in the form of a string variable and may include the image ID of the first image, The user ID, version ID and other contents of the first terminal.
步骤430、根据版本ID查找对应的第二镜像文件以及对应的第二快照名。Step 430: Search the corresponding second image file and the corresponding second snapshot name according to the version ID.
可选的,由于每个第二快照对应一个版本,因此,通过待还原的版本ID在第一镜像所对应的快照列表中进行查询,以得到对应的第二快照名,并且得到第二快照名对应第二快照所在的第二镜像文件。Optionally, since each second snapshot corresponds to a version, query the snapshot list corresponding to the first image through the version ID to be restored to obtain the corresponding second snapshot name, and obtain the second snapshot name Corresponds to the second image file where the second snapshot is located.
步骤440、根据第二快照名,将第二镜像文件还原到对应的第二快照。Step 440: Restore the second image file to the corresponding second snapshot according to the second snapshot name.
示例性的,根据第二快照名对应的第二快照,对第二镜像文件进行还原,即还原到创建第二快照时,第二镜像文件的状态,此时,第二快照之后,第二镜像文件中添加的用户的个性化数据会被删除。 Exemplarily, the second image file is restored according to the second snapshot corresponding to the second snapshot name, that is, restored to the state of the second image file when the second snapshot was created. At this time, after the second snapshot, the second image file The user's personalization data added to the file will be deleted.
一个实施例中,由服务器创建第三镜像文件,此时,步骤440之后,还包括步骤450和步骤460。In one embodiment, the server creates a third image file. At this time, after step 440, steps 450 and 460 are also included.
步骤450、删除第二镜像文件对应的第三镜像文件。Step 450: Delete the third image file corresponding to the second image file.
示例性的,由于第二镜像文件已经发生了变化,因此,需要删除第二镜像文件变化前对应的第三镜像文件,即旧的第三镜像文件。For example, since the second image file has changed, the third image file corresponding to the second image file before the change, that is, the old third image file needs to be deleted.
步骤460、基于还原到的第二快照创建新的第三镜像文件。Step 460: Create a new third image file based on the restored second snapshot.
示例性的,基于还原的第二快照创建对应的第三镜像文件,该第三镜像文件可以认为是第二镜像文件对应的新的第三镜像文件。For example, a corresponding third image file is created based on the restored second snapshot, and the third image file can be considered as a new third image file corresponding to the second image file.
一个实施例中,分别生成第二镜像文件和第三镜像文件对应的种子文件,以供第一终端进行下载。In one embodiment, seed files corresponding to the second image file and the third image file are respectively generated for the first terminal to download.
可选的,由于第一镜像包含的第二镜像文发生了更新,因此,还需要更新镜像表中第一镜像对应的镜像记录,此时,步骤460之后,还包括:Optionally, since the second image file contained in the first image has been updated, the image record corresponding to the first image in the image table also needs to be updated. At this time, after step 460, it also includes:
步骤470、更新镜像记录中的镜像元数据。Step 470: Update the image metadata in the image record.
可选的,镜像元数据更新后,可以确定完成镜像还原,此时,服务器可以解锁第一镜像,以使第一终端下载对应的种子文件。一个实施例中,镜像还原后,服务器可以通知第一终端完成镜像还原,之后,第一终端根据服务器的通知,生成对应的第一下载指令,并反馈给服务器,由服务器对第一下载指令进行响应,以将还原后的第二镜像文件作为新的第二镜像文件推送给第一终端。Optionally, after the image metadata is updated, it can be determined that the image restoration is completed. At this time, the server can unlock the first image so that the first terminal can download the corresponding seed file. In one embodiment, after the image is restored, the server can notify the first terminal to complete the image restoration. After that, the first terminal generates the corresponding first download instruction according to the notification from the server and feeds it back to the server, and the server executes the first download instruction. In response, the restored second image file is pushed to the first terminal as a new second image file.
一个实施例中,服务器记录每个镜像当前最新的版本ID,镜像还原后,将对应镜像当前最新的版本ID更改为还原后的版本ID。In one embodiment, the server records the latest version ID of each image, and after the image is restored, changes the latest version ID of the corresponding image to the restored version ID.
下面对镜像还原过程进行示例性描述,图10为本申请一个实施例提供的一种镜像还原流程图。参考图10,开始后,先锁定对应的镜像,之后,解析调用的参数(即Parse Args),以得到ImageID和RevisionID,之后,根据RevisionID定位到对应的LowerImage需要还原到的目标SnapshotName,之后,将LowerImage还原到对应的目标Snapshot,之后,删除旧的UpperImage,创建新的UpperImage,分别创建LowerImage和UpperImage的种子文件,更新镜像表中的镜像记录,解锁镜像,恢复镜像的下载,以完成镜像还原。The following is an exemplary description of the image restoration process. Figure 10 is a flow chart of an image restoration provided by an embodiment of the present application. Referring to Figure 10, after starting, first lock the corresponding image, and then parse the parameters of the call (i.e. Parse Args) to get the ImageID and RevisionID. Then, locate the target SnapshotName to which the corresponding LowerImage needs to be restored based on the RevisionID. After that, LowerImage is restored to the corresponding target Snapshot. After that, delete the old UpperImage, create a new UpperImage, create seed files for LowerImage and UpperImage respectively, update the image record in the image table, unlock the image, and resume the download of the image to complete the image restoration.
上述,当存在镜像还原的需求时,只需要将第二镜像文件还原到对应的版本即可,无需修改第一镜像文件,节省了还原时的数据处理量,提高了镜像还原的效率和速度。As mentioned above, when there is a need for image restoration, you only need to restore the second image file to the corresponding version without modifying the first image file, which saves the amount of data processing during restoration and improves the efficiency and speed of image restoration.
本申请一个实施例中,服务器进行管理时,还需要进行镜像克隆管理,其中,镜像克隆可以理解为基于一个镜像克隆得到另一个镜像。当前,以第一镜像为例,描述镜像的克隆过程。图11为本申请一个实施例提供的一种镜像管理方法的流程图,其为服务器进行镜像克隆管理时的流程,参考图,该镜像管理方法包括:In one embodiment of the present application, when the server is managed, image cloning management is also required. Image cloning can be understood as obtaining another image based on one image clone. Currently, the first image is used as an example to describe the image cloning process. Figure 11 is a flow chart of an image management method provided by an embodiment of the present application. It is a process when the server performs image cloning management. Referring to the figure, the image management method includes:
步骤510、接收镜像克隆指令,该镜像克隆指令用于克隆第一镜像。Step 510: Receive an image cloning instruction, which is used to clone the first image.
示例性的,镜像克隆指令用于指示服务器进行镜像克隆。当前,第一镜像作为被克隆的镜像,此时,镜像克隆指令可被认为是用于克隆第一镜像。For example, the image cloning instruction is used to instruct the server to perform image cloning. Currently, the first image is used as the cloned image. At this time, the image clone instruction can be considered as being used to clone the first image.
示例性的,镜像克隆指令可以由用户在第一终端或服务器中发出,也可以由镜像的管理员在服务器中发出。可选的,生成镜像还原指令时,在镜像还原指令中写入被还原的镜像的ID,以使服务器确定被还原的镜像(当前,镜像还原指令写入 第一镜像的镜像ID)。可选的,镜像克隆时,可以只针对某个版本进行克隆,此时,镜像还原指令中还可以包含需要克隆的版本ID。可选的,但由于第一镜像中可能记录有用户的个性化数据,因此,为了数据安全性,只有具有一定权限的管理员可以发出镜像克隆指令,或者是,只有用户可以对自身使用的第一镜像进行克隆。For example, the image cloning instruction may be issued by the user in the first terminal or server, or may be issued by the administrator of the image in the server. Optionally, when generating an image restore command, write the ID of the restored image in the image restore command so that the server can determine the restored image (currently, the image restore command writes The image ID of the first image). Optionally, when cloning an image, you can clone only a certain version. At this time, the image restore command can also include the ID of the version that needs to be cloned. Optional, but because the user's personalized data may be recorded in the first image, for data security, only administrators with certain permissions can issue image cloning instructions, or only users can use the second image for themselves. Clone an image.
步骤520、根据第一镜像所包含的第一镜像文件和第二镜像文件克隆得到第二镜像,第二镜像为克隆后的镜像。Step 520: Clone the first image file and the second image file included in the first image to obtain a second image, and the second image is the cloned image.
示例性的,将基于第一镜像克隆得到的镜像记为第二镜像。可选的,由于第一镜像中使用的第一镜像文件仅记录操作系统且不会在使用过程中被修改,因此,第一镜像文件可以被第二镜像共用,一个实施例中,第一镜像文件可以通过硬链接的方式连接到第二镜像中。可选的,第一镜像中的第二镜像文件可以被复制到第二镜像中,之后,还可以基于第二镜像文件创建对应的第三镜像文件,以保证通过三个层级的镜像文件使第二镜像正常被使用。For example, the image cloned based on the first image is recorded as the second image. Optionally, since the first image file used in the first image only records the operating system and will not be modified during use, the first image file can be shared by the second image. In one embodiment, the first image Files can be linked to the secondary image via hard links. Optionally, the second image file in the first image can be copied to the second image, and then a corresponding third image file can be created based on the second image file to ensure that the third image file is used through the three levels of image files. The second image is used normally.
一个实施例中,步骤510可包括步骤511-步骤516:In one embodiment, step 510 may include steps 511 to 516:
步骤511、根据镜像克隆指令,生成第二镜像的镜像记录和版本目录,第二镜像的镜像记录中记录第一镜像的镜像元数据。Step 511: Generate an image record and a version directory of the second image according to the image cloning instruction, and record the image metadata of the first image in the image record of the second image.
示例性的,克隆第二镜像时,也可以需要进行镜像注册,即创建第二镜像的镜像记录和版本目录,还可创建第二镜像的版本记录。当前,先在第二镜像的镜像记录中写入第一镜像的镜像元数据。For example, when cloning the second image, you may also need to perform image registration, that is, create an image record and version directory of the second image, and also create a version record of the second image. Currently, the image metadata of the first image is first written in the image record of the second image.
步骤512、在版本目录中创建第一镜像中的第一镜像文件的硬链接。Step 512: Create a hard link to the first image file in the first image in the version directory.
示例性的,第二镜像和第一镜像共用第一镜像文件,因此,将第一镜像文件以硬链接的方式连接到第二镜像中,当前,将第一镜像文件硬链接到第二镜像的版本目录下。For example, the second image and the first image share the first image file. Therefore, the first image file is connected to the second image in a hard link. Currently, the first image file is hard linked to the second image. version directory.
步骤513、将第一镜像中的第二镜像文件复制到版本目录中。Step 513: Copy the second image file in the first image to the version directory.
示例性的,由于每个镜像均需要有自身的LowerImage,因此,克隆时,对第一镜像中使用的第二镜像文件进行复制,并粘贴在第二镜像的版本目录中,以明确第二镜像使用的第二镜像文件。可理解,当前复制的第二镜像文件包含当前全部的第二快照。For example, since each image needs to have its own LowerImage, when cloning, copy the second image file used in the first image and paste it in the version directory of the second image to clarify the second image The second image file used. It can be understood that the currently copied second image file includes all current second snapshots.
步骤514、在复制后的第二镜像文件中保留目标版本并删除其他第二版本,目标第二版本通过镜像克隆指令确定。Step 514: Keep the target version in the copied second image file and delete other second versions. The target second version is determined through the image cloning instruction.
示例性的,镜像克隆时,只对第二镜像文件中指定版本进行克隆,当前,将指定的版本记为目标版本。因此,复制第二镜像文件后需要对第二镜像文件进行初始化,初始化时,在第二镜像文件中只保留目标版本对应的状态,删除其他版本,即初始化后第二镜像文件中只有一个版本,且该版本为目标版本,此时,初始化后的第二镜像文件可以认为是第二镜像中初始的第二镜像文件,之后,在第二镜像的版本记录中可以对目标版本对应的元数据进行记录。需说明,步骤511-步骤513中提及的版本目录可以认为是目标版本对应的版本目录。For example, when cloning an image, only the specified version in the second image file is cloned. Currently, the specified version is recorded as the target version. Therefore, after copying the second image file, you need to initialize the second image file. During initialization, only the state corresponding to the target version is retained in the second image file, and other versions are deleted. That is, there is only one version in the second image file after initialization. And this version is the target version. At this time, the initialized second image file can be considered as the initial second image file in the second image. After that, the metadata corresponding to the target version can be processed in the version record of the second image. Record. It should be noted that the version directory mentioned in steps 511 to 513 can be considered as the version directory corresponding to the target version.
一个实施例中,由服务器生成第三镜像文件,因此,步骤514后还可包括:基于目标版本创建对应的第三镜像文件。In one embodiment, the server generates the third image file. Therefore, after step 514, it may also include: creating a corresponding third image file based on the target version.
示例性的,基于第二镜像中的第二镜像文件创建对应的第三镜像文件,此时,第三镜像文件对应第二镜像文件的目标版本,即第三镜像文件包含目标版本对应的第二快照的第二快照名。Exemplarily, a corresponding third image file is created based on the second image file in the second image. At this time, the third image file corresponds to the target version of the second image file, that is, the third image file contains the second image file corresponding to the target version. The second snapshot name of the snapshot.
可选的,分别创建第二镜像文件和第三镜像文件的种子文件,以供终端进行下载,可理解,当终端首次下载镜像且下载的镜像为第二镜像时,服务器通过版本目录中的硬链接可以找到第一镜像文件,并将第一镜像文件的种子文件发送至的终端,以供终端使用。 Optionally, seed files of the second image file and the third image file are respectively created for the terminal to download. It is understandable that when the terminal downloads the image for the first time and the downloaded image is the second image, the server passes the hard disk in the version directory. The link can find the first image file and send the seed file of the first image file to the terminal for use by the terminal.
步骤515、更新第二镜像的镜像记录中的镜像元数据。Step 515: Update the image metadata in the image record of the second image.
示例性的,创建第二镜像的镜像记录时,镜像记录中记录的第一镜像的镜像元数据,对第二镜像文件进行初始化后,镜像元数据也会发生变化,因此,当前根据初始化后的第二镜像文件更新第二镜像的镜像记录中的镜像元数据。For example, when creating the image record of the second image, the image metadata of the first image recorded in the image record will also change after the second image file is initialized. Therefore, the image metadata is currently based on the initialized The second image file updates the image metadata in the image record of the second image.
可选的,克隆过程中,第二镜像可以包含多种状态,以通过不同状态指示第二镜像当前的克隆节点,一个实施例中,根据镜像克隆指令,生成第二镜像的镜像记录和版本目录时,还包括:将第二镜像标记为等待克隆状态。更新第二镜像的镜像记录中的镜像元数据时,还包括:将第二镜像标记为完成克隆状态。Optionally, during the cloning process, the second image may contain multiple states to indicate the current clone node of the second image through different states. In one embodiment, the image record and version directory of the second image are generated according to the image cloning instruction. When, it also includes: marking the second image as waiting for cloning. When updating the image metadata in the image record of the second image, it also includes: marking the second image as a completed clone state.
其中,等待克隆状态(waiting)是指等待克隆开始的状态,完成克隆状态(ready)是指克隆完成可被使用的状态。除此之外,还可以包括正在克隆状态(copy),其是指正在进行克隆。可选的,生成第二镜像的镜像记录和版本目录时,将第二镜像标记为等待克隆状态,将第一镜像中的第二镜像文件复制到版本目录时,将第二镜像的等待克隆状态变换为正在克隆的状态,更新第二镜像的镜像记录中的镜像元数据时,将第二镜像的正在克隆状态变换为完成克隆状态。Among them, the waiting clone state (waiting) refers to the state waiting for cloning to start, and the completed clone state (ready) refers to the state when the clone is completed and can be used. In addition, the cloning status (copy) can also be included, which means that cloning is in progress. Optionally, when generating the image record and version directory of the second image, mark the second image as waiting for cloning, and when copying the second image file in the first image to the version directory, mark the second image as waiting for cloning. When changing to the cloning state and updating the image metadata in the image record of the second image, the cloning state of the second image is changed to the completed cloning state.
下面对镜像克隆过程进行示例性描述,图12为本申请一个实施例提供的一种镜像克隆流程图。参考图12,开始后,先创建镜像元数据,该镜像元数据为克隆后得到的新镜像的镜像元数据,并生成新镜像的镜像记录、初始版本记录和初始版本目录,此时,新镜像处于等待克隆状态(waiting)。之后,在初始版本目录下创建源镜像(被克隆的镜像)的BaseImage的硬链接,之后,将源镜像的LowerImage复制到初始版本目录下,对复制得到的LowerImage初始化,保留目标版本,之后,基于LowerImage创建UpperImage,分别创建LowerImage和UpperImage的种子文件,更新镜像表中的镜像记录,并将新镜像改为完成克隆状态,以完成镜像克隆。The following is an exemplary description of the image cloning process. Figure 12 is an image cloning flow chart provided by an embodiment of the present application. Referring to Figure 12, after starting, first create the image metadata, which is the image metadata of the new image obtained after cloning, and generate the image record, initial version record and initial version directory of the new image. At this time, the new image In waiting state (waiting). After that, create a hard link to the BaseImage of the source image (the cloned image) in the initial version directory. Then, copy the LowerImage of the source image to the initial version directory, initialize the copied LowerImage, and retain the target version. After that, based on LowerImage creates UpperImage, creates seed files for LowerImage and UpperImage respectively, updates the image record in the image table, and changes the new image to the clone completion status to complete the image cloning.
上述,当第一终端或服务器存在镜像克隆的需求时,只需要对第二镜像文件进行复制并创建镜像记录即可,第一镜像文件可以通过硬链接的方式添加在新的镜像中,不需要进行复制,节省了服务器的磁盘空间,且提高了镜像克隆的效率和速度.As mentioned above, when there is a need for image cloning on the first terminal or server, you only need to copy the second image file and create an image record. The first image file can be added to the new image through a hard link. No need to Copying saves server disk space and improves the efficiency and speed of image cloning.
可理解,镜像合并、镜像还原和镜像克隆时,均不需要修改BaseImage,保证了BaseImage的安全性,也避免了终端重复下载BaseImage。It is understandable that there is no need to modify the BaseImage during image merging, image restoration, and image cloning, which ensures the security of the BaseImage and avoids repeated downloading of the BaseImage by the terminal.
本申请一个实施例中,镜像管理设备除了是服务器外,还可以是镜像管理终端,该终端也可以认为是供用户使用的终端,该终端可以是个人计算机、平板电脑、交互平板、手机等,当前不作限定。该终端通过运行虚拟机来实现云桌面,其中,终端运行时所需的镜像可从服务器中获取,此时,终端与服务器配合后,可以实现镜像管理方法。一个实施例中,以第一终端为例,描述终端如何执行镜像管理方法。In one embodiment of the present application, in addition to a server, the image management device can also be an image management terminal. The terminal can also be considered as a terminal for users. The terminal can be a personal computer, a tablet computer, an interactive tablet, a mobile phone, etc. There are currently no restrictions. The terminal implements a cloud desktop by running a virtual machine. The image required when the terminal is running can be obtained from the server. At this time, after the terminal cooperates with the server, the image management method can be implemented. In one embodiment, the first terminal is taken as an example to describe how the terminal performs the image management method.
图13为本申请一个实施例提供的一种镜像管理方法的流程图,参考图13,第一终端执行该镜像管理方法时,可以包括:Figure 13 is a flow chart of an image management method provided by an embodiment of the present application. Referring to Figure 13, when the first terminal executes the image management method, it may include:
步骤610、向云桌面的服务器发送第一下载请求。Step 610: Send the first download request to the server of the cloud desktop.
示例性的,第一终端应用第一镜像,第一镜像包含第一镜像文件和第二镜像文件,第一镜像文件记录有第一终端中云桌面所使用的操作系统,第二镜像文件记录有基于操作系统安装的设备驱动和应用程序。Exemplarily, the first terminal applies a first image. The first image includes a first image file and a second image file. The first image file records the operating system used by the cloud desktop in the first terminal, and the second image file records Device drivers and applications installed based on the operating system.
第一终端生成第一下载请求后,向服务器发送第一下载请求。After generating the first download request, the first terminal sends the first download request to the server.
其中,通过第一下载请求可以下载第二镜像文件时,执行步骤620,通过第一下载请求可以下载第二镜像文件和对应的第三镜像文件时,执行步骤650。When the second image file can be downloaded through the first download request, step 620 is executed. When the second image file and the corresponding third image file can be downloaded through the first download request, step 650 is executed.
步骤620、当第一下载请求用于从服务器中下载新的第二镜像文件,接收服务器发送的新的第二镜像文件。 Step 620: When the first download request is used to download a new second image file from the server, receive the new second image file sent by the server.
步骤630、使用接收的第二镜像文件替换本地原有的第二镜像文件。Step 630: Use the received second image file to replace the original local second image file.
可选的,将服务器发送的新的第二镜像文件作为本地使用的第二镜像文件,此时,第一终端认为进行了版本的更换。可选的,对于初始的第二镜像文件,可以一直保存在本地中,其他版本的第二镜像文件可以保存在第一终端也可以随着版本的替换而在第一终端中删除。Optionally, the new second image file sent by the server is used as the second image file for local use. At this time, the first terminal considers that the version has been changed. Optionally, the initial second image file can always be saved locally, and other versions of the second image file can be saved in the first terminal or deleted in the first terminal as versions are replaced.
步骤640、基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,第一镜像还包含第三镜像文件,第三镜像文件记录有云桌面在设定第二快照的状态下运行时新增的数据。Step 640: Create a corresponding third image file based on the setting of the second snapshot in the received second image file. The first image also includes a third image file. The third image file records that the cloud desktop is setting the second snapshot. Data added when running in the state.
示例性的,接收的第二镜像文件中的最新的第二快照作为设定第二快照,并基于设定第二快照在本地创建对应的第三镜像文件。之后,运行云桌面。For example, the latest second snapshot in the received second image file is used as the set second snapshot, and a corresponding third image file is created locally based on the set second snapshot. After that, run the cloud desktop.
步骤650、当第一下载请求用于从服务器中下载新的第二镜像文件和对应的第三镜像文件,接收服务器发送的新的第二镜像文件和第三镜像文件,第三镜像文件基于新的第二镜像文件中的设定第二快照生成。Step 650: When the first download request is used to download the new second image file and the corresponding third image file from the server, receive the new second image file and the third image file sent by the server, and the third image file is based on the new The second snapshot is generated based on the settings in the second image file.
步骤660、使用接收的第二镜像文件替换本地原有的第二镜像文件。Step 660: Use the received second image file to replace the original local second image file.
上述,当第一终端需要更新第一镜像时,只需要从服务器中获取新的第二镜像文件并进行替换即可,无需获取第一镜像文件,解决了相关技术中服务器将镜像文件下发至终端需要耗费较多的网络资源的技术问题。并且,由于第三镜像文件创建后是空白的文件,因此,即使需要下载对应的第三镜像文件,也只占用很少的网络资源,保证了网络资源的合理运用。As mentioned above, when the first terminal needs to update the first image, it only needs to obtain the new second image file from the server and replace it. There is no need to obtain the first image file, which solves the problem in the related technology that the server delivers the image file to The terminal needs to consume more network resources due to technical issues. Moreover, since the third image file is a blank file after creation, even if the corresponding third image file needs to be downloaded, it only takes up very few network resources, ensuring the rational use of network resources.
本申请一个实施例中,第一终端可以将本地云桌面运行过程中新增的数据提交到第二镜像文件,以进行版本的升级(即镜像合并),此时,第一终端执行镜像管理方法时,还可以包括:根据本地现有的第一镜像文件、第二镜像文件和对应的第三镜像文件运行云桌面,并在运行过程中,将新增的数据写入第三镜像文件;将第三镜像文件上传至服务器,以使服务器将第三镜像文件提交到对应的第二镜像文件中。In one embodiment of the present application, the first terminal can submit the newly added data during the operation of the local cloud desktop to the second image file for version upgrade (ie, image merging). At this time, the first terminal executes the image management method When running, it may also include: running the cloud desktop based on the local existing first image file, second image file and corresponding third image file, and writing the newly added data into the third image file during the running process; The third image file is uploaded to the server, so that the server submits the third image file to the corresponding second image file.
示例性的,第一终端启动虚拟机时,需要具备第一镜像文件、第二镜像文件和第三镜像文件,且虚拟机直接基于第三镜像文件启动,不需要合并三类文件,并且在虚拟机中运行云桌面时,在第三镜像文件中记录当前新增的数据。若用户在运行云桌面的过程中,需要对当前的运行状态创建还原点,即创建新的版本,可以将当前使用的第三镜像文件发送至服务器中,并指示服务器进行镜像合并,服务器根据指示将第三镜像文件提交到对应的第二镜像文件中,之后,服务器通知第一终端合并完成,第一终端可以基于服务器的通知生成第一下载指令,以下载已创建还原点对应的第二快照的第二镜像文件,并结合实际情况创建或从服务器中下载对应的第三镜像文件。For example, when the first terminal starts the virtual machine, it needs to have the first image file, the second image file and the third image file, and the virtual machine is started directly based on the third image file, without merging the three types of files, and in the virtual machine When the cloud desktop is running on the computer, the newly added data is recorded in the third image file. If the user needs to create a restore point for the current running status while running the cloud desktop, that is, create a new version, the user can send the currently used third image file to the server and instruct the server to merge the images. The server will follow the instructions. Submit the third image file to the corresponding second image file. After that, the server notifies the first terminal that the merger is completed. The first terminal can generate a first download instruction based on the server's notification to download the second snapshot corresponding to the created restore point. the second image file, and create or download the corresponding third image file from the server based on the actual situation.
可理解,由于第三镜像文件用于写入新增的数据,因此,当第一终端的用户想到放弃对云桌面的修改时,只需要删除当前的第三镜像文件,并且,重建第三镜像文件或者从服务器中获取第三镜像文件,简化了第一终端中镜像还原的过程。It is understandable that since the third image file is used to write new data, when the user of the first terminal wants to give up modifying the cloud desktop, he only needs to delete the current third image file and rebuild the third image. file or obtain the third image file from the server, which simplifies the image restoration process in the first terminal.
上述,第一终端在运行过程中,将新增的数据写入第三镜像文件,不会修改第一镜像文件和第二镜像文件,因此,在创建新的版本时,只需要将本地的第三镜像文件上传到服务器,即可在服务器中创建新的版本,极大的减少了上传数据量,提高了上传效率。As mentioned above, during the running process, the first terminal writes the newly added data to the third image file and does not modify the first image file and the second image file. Therefore, when creating a new version, only the local third image file needs to be Once the three image files are uploaded to the server, a new version can be created in the server, which greatly reduces the amount of uploaded data and improves upload efficiency.
本申请一个实施例中,第一终端还可以将本地使用的第二镜像文件同步到第二终端中,以在第二终端中运行第一终端中的云桌面,此时,第一终端执行镜像管理方法时,还可以包括:接收第二终端发送的同步请求,第二终端与第一终端使用相同的第一镜像文件;将本地现有的第二镜像文件发送至第二终端,以使第二终端使用接收的第二镜像文件替换原有的第二镜像文件。 In one embodiment of the present application, the first terminal can also synchronize the second image file used locally to the second terminal to run the cloud desktop in the first terminal in the second terminal. At this time, the first terminal executes the image The management method may also include: receiving a synchronization request sent by the second terminal, and the second terminal uses the same first image file as the first terminal; sending the locally existing second image file to the second terminal, so that the second terminal The second terminal uses the received second image file to replace the original second image file.
示例性的,第二终端可以是实现云桌面物理漂移的终端,即将第一终端使用的云桌面漂移到第二终端中使用,第二终端也可以是用户更换的终端,即用户使用第二终端替换当前使用的第一终端。For example, the second terminal can be a terminal that implements physical cloud desktop drift, that is, the cloud desktop used by the first terminal is moved to the second terminal for use. The second terminal can also be a terminal replaced by the user, that is, the user uses the second terminal. Replaces the currently used first terminal.
一个实施例中,第二终端运行过云桌面,已经存储有第一镜像文件和第二镜像文件,此时,第一终端可以将自身第二镜像文件发送至第二终端,之后,第二终端使用接收的第二镜像文件替换自身的第二镜像文件,以保证运行第一终端中的云桌面。一个实施例中,第二终端未运行过云桌面,此时,第二终端可以先从服务器中下载第一镜像包含的各层文件,之后,使用接收的第二镜像文件替换自身的第二镜像文件。In one embodiment, the second terminal has run the cloud desktop and has stored the first image file and the second image file. At this time, the first terminal can send its second image file to the second terminal. After that, the second terminal Use the received second image file to replace its own second image file to ensure that the cloud desktop in the first terminal runs. In one embodiment, the second terminal has not run Cloud Desktop. At this time, the second terminal can first download the files of each layer contained in the first image from the server, and then replace its own second image with the received second image file. document.
可选的,第二终端可以创建第三镜像文件时,基于接收的第二镜像文件中的设定版本创建第三镜像文件,或者,由服务器创建第三镜像文件并发送至第二镜像文件。Optionally, when creating the third image file, the second terminal may create the third image file based on the set version in the received second image file, or the server may create the third image file and send it to the second image file.
可选的,第一终端将第二镜像文件发送至第二终端时,可以直接发送给第二终端,或者是通过服务器发送给第二终端。其中,通过服务器发送给第二终端时,若需要生成第三镜像文件,则可以将第二镜像文件和生成的第三镜像文件一同发送至第二终端。Optionally, when the first terminal sends the second image file to the second terminal, it can send it directly to the second terminal, or send it to the second terminal through the server. When sending to the second terminal through the server, if a third image file needs to be generated, the second image file and the generated third image file can be sent to the second terminal together.
可选的,对第二终端进行同步后,可以在服务器中进行记录,以使服务器明确第二终端当前使用的镜像版本。Optionally, after the second terminal is synchronized, it can be recorded in the server so that the server can know the image version currently used by the second terminal.
上述,同步过程中,只需要将LowerImage由第一终端发送到第二终端即可,简化了同步所需的环节。As mentioned above, during the synchronization process, it is only necessary to send the LowerImage from the first terminal to the second terminal, which simplifies the steps required for synchronization.
可理解,上述过程中未提及的技术细节可参考前述实施例中的相关描述,且具备相应的功能和有益效果。It can be understood that technical details not mentioned in the above process can refer to the relevant descriptions in the foregoing embodiments, and have corresponding functions and beneficial effects.
图14为本申请一个实施例提供的一种镜像管理装置的结构示意图。该镜像管理装置应用于服务器,参考图14,该镜像管理装置包括:第一接收单元701、第一发送单元702和第二发送单元703。Figure 14 is a schematic structural diagram of an image management device provided by an embodiment of the present application. The image management device is applied to a server. Referring to Figure 14, the image management device includes: a first receiving unit 701, a first sending unit 702 and a second sending unit 703.
第一接收单元701,用于接收第一终端发送的第一下载请求,第一终端应用第一镜像,第一镜像包含第一镜像文件和第二镜像文件,第一镜像文件记录有第一终端中云桌面所使用的操作系统,第二镜像文件记录有基于操作系统安装的设备驱动和应用程序;第一发送单元702,用于当第一下载请求用于从服务器中下载新的第二镜像文件,将新的第二镜像文件发送至第一终端,以使第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件并基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,第一镜像还包含第三镜像文件,第三镜像文件记录有云桌面在设定第二快照的状态下运行时新增的数据;第二发送单元,用于当第一下载请求用于从服务器中下载新的第二镜像文件和对应的第三镜像文件,将新的第二镜像文件和第三镜像文件发送至第一终端,以使第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件,第三镜像文件基于新的第二镜像文件中的设定第二快照生成。The first receiving unit 701 is configured to receive a first download request sent by a first terminal. The first terminal applies a first image. The first image includes a first image file and a second image file. The first image file records the first terminal. The operating system used by Zhongyun Desktop, the second image file records device drivers and applications installed based on the operating system; the first sending unit 702 is used to download a new second image from the server when the first download request is made file, sending the new second image file to the first terminal, so that the first terminal uses the received second image file to replace the local original second image file and based on the settings in the received second image file. The snapshot creates a third image file corresponding to the first image. The first image also contains the third image file. The third image file records the data newly added when the cloud desktop is running in the state of setting the second snapshot; the second sending unit is used for When the first download request is used to download the new second image file and the corresponding third image file from the server, the new second image file and the third image file are sent to the first terminal, so that the first terminal uses the receive The second image file replaces the original local second image file, and the third image file is generated based on the second snapshot setting in the new second image file.
一个实施例中,第一镜像文件包含唯一的第一快照,第二镜像文件包含第一快照的第一快照名;第二镜像文件包含至少一个第二快照,第三镜像文件包含所对应的第二快照的第二快照名。In one embodiment, the first image file contains a unique first snapshot, the second image file contains the first snapshot name of the first snapshot, the second image file contains at least one second snapshot, and the third image file contains the corresponding first snapshot. The second snapshot name of the second snapshot.
一个实施例中,第一镜像在服务器中记录有至少一个版本,每个版本对应第二镜像文件中的一个第二快照且关联于第二镜像文件、第二镜像文件中第一快照名对应的第一镜像文件以及第二快照对应的第三镜像文件,每个版本均有对应的版本ID。In one embodiment, the first image is recorded in the server with at least one version, and each version corresponds to a second snapshot in the second image file and is associated with the second image file and the first snapshot name in the second image file. Each version of the first image file and the third image file corresponding to the second snapshot has a corresponding version ID.
一个实施例中,第一镜像在服务器中记录有至少一个镜像分支,每个镜像分支包含至少一个版本,第一终端应用第一镜像的一个镜像分支。In one embodiment, the first image is recorded in the server with at least one image branch, each image branch includes at least one version, and the first terminal applies one image branch of the first image.
一个实施例中,还包括:第一获取单元,用于获取第一镜像文件和第二镜像文件;第一链接单元,用于将第一镜像文件 和第二镜像文件分别硬链接到第一镜像;第二链接单元,用于基于第二镜像文件初始的第二快照创建对应的版本目录,并将第一镜像文件和第二镜像文件分别硬链接到版本目录中,得到第一镜像。In one embodiment, the method further includes: a first acquisition unit, used to acquire the first image file and a second image file; a first linking unit, used to convert the first image file and the second image file are respectively hard-linked to the first image; the second link unit is used to create a corresponding version directory based on the initial second snapshot of the second image file, and hard-link the first image file and the second image file respectively. Go to the version directory and get the first image.
一个实施例中,还包括:第一创建单元,用于将第一镜像文件和所第二镜像文件分别硬链接到版本目录中之后,基于初始的第二快照创建对应的第三镜像文件。In one embodiment, the method further includes: a first creation unit configured to create a corresponding third image file based on the initial second snapshot after hard-linking the first image file and the second image file to the version directory respectively.
一个实施例中,第一链接单元还用于:创建第一镜像的镜像记录,并在镜像记录中添加第一镜像的镜像元数据;第二链接单元还用于:创建初始的第二快照对应的版本记录,并在版本记录中记录初始的第二快照对应版本的版本元数据。In one embodiment, the first link unit is also used to: create a mirror record of the first mirror, and add the mirror metadata of the first mirror to the mirror record; the second link unit is also used to: create an initial second snapshot corresponding to version record, and record the version metadata of the corresponding version of the initial second snapshot in the version record.
一个实施例中,还包括:第二接收单元,用于接收第一终端上传的第三镜像文件;第二获取单元,用于获取第一终端中第一镜像当前的版本ID;第一查找单元,用于查找版本ID对应的第二镜像文件;提交单元,用于将第三镜像文件提交到第二镜像文件,以得到新的第二镜像文件;第二创建单元,用于在新的第二镜像文件中创建新的第二快照。In one embodiment, the system further includes: a second receiving unit for receiving the third image file uploaded by the first terminal; a second obtaining unit for obtaining the current version ID of the first image in the first terminal; and a first search unit. , used to find the second image file corresponding to the version ID; the submission unit is used to submit the third image file to the second image file to obtain a new second image file; the second creation unit is used to create a new second image file in the new image file. Create a new second snapshot in the second image file.
一个实施例中,第一删除单元,用于在新的第二镜像文件中创建新的第二快照之后,删除第三镜像文件;第三创建单元,用于基于新的第二快照创建新的第三镜像文件。In one embodiment, the first deletion unit is used to delete the third image file after creating a new second snapshot in the new second image file; the third creation unit is used to create a new image file based on the new second snapshot. Third image file.
一个实施例中,提交单元包括:第一还原子单元,用于将第二镜像文件还原到第三镜像文件所对应的第二快照;重命名子单元,用于对还原后的第二镜像文件进行重命名,以使第二镜像文件使用第二快照的第二快照名;文件提交子单元,用于将第三镜像文件提交到重命名后的第二镜像文件。In one embodiment, the submission unit includes: a first restoration sub-unit, used to restore the second image file to the second snapshot corresponding to the third image file; a renaming sub-unit, used to restore the restored second image file Renaming is performed so that the second image file uses the second snapshot name of the second snapshot; the file submission subunit is used to submit the third image file to the renamed second image file.
一个实施例中,第一镜像在服务器中记录有对应的快照列表,快照列表中记录第一镜像的各版本及各版本对应的第二快照;所述装置还包括:第一更新单元,用于在新的第二镜像文件中创建新的第二快照之后,更新快照列表,并更新镜像记录中的镜像元数据。In one embodiment, the first image is recorded in the server with a corresponding snapshot list, and the snapshot list records each version of the first image and the second snapshot corresponding to each version; the device further includes: a first update unit, configured to After creating a new second snapshot in the new second image file, update the snapshot list and update the image metadata in the image record.
一个实施例中,还包括:第三接收单元,用于接收镜像还原指令;第三获取单元,用于根据镜像还原指令,获取待还原的版本ID;第二查找单元,用于根据版本ID查找对应的第二镜像文件以及对应的第二快照名;第二还原单元,用于根据第二快照名,将第二镜像文件还原到对应的第二快照。In one embodiment, the method further includes: a third receiving unit, configured to receive an image restoration instruction; a third acquisition unit, configured to obtain the version ID to be restored according to the image restoration instruction; and a second search unit, configured to search according to the version ID. The corresponding second image file and the corresponding second snapshot name; the second restoration unit is used to restore the second image file to the corresponding second snapshot according to the second snapshot name.
一个实施例中,还包括:第二删除单元,用于根据第二快照名,将第二镜像文件还原到对应的第二快照之后,删除第二镜像文件对应的第三镜像文件;第四创建单元,用于基于还原到的第二快照创建新的第三镜像文件。In one embodiment, the method further includes: a second deletion unit, configured to restore the second image file to the corresponding second snapshot according to the second snapshot name, and then delete the third image file corresponding to the second image file; a fourth creation Unit used to create a new third image file based on the second snapshot restored to.
一个实施例中,还包括:第四接收单元,用于接收镜像克隆指令,镜像克隆指令用于克隆第一镜像;克隆单元,用于根据第一镜像所包含的第一镜像文件和第二镜像文件克隆得到第二镜像,第二镜像为克隆后的镜像。In one embodiment, the method further includes: a fourth receiving unit, configured to receive an image cloning instruction, which is used to clone the first image; and a cloning unit, configured to clone the first image according to the first image file and the second image contained in the first image. The file is cloned to obtain a second image, and the second image is the cloned image.
一个实施例中,克隆单元包括:生成子单元,用于根据镜像克隆指令,生成第二镜像的镜像记录和版本目录,第二镜像的镜像记录中记录第一镜像的镜像元数据;第三链接子单元,用于在版本目录中创建第一镜像中第一镜像文件的硬链接;复制子单元,用于将第一镜像中的第二镜像文件复制到版本目录中;第三删除子单元,用于在复制后的第二镜像文件中保留目标版本并删除其他版本,目标版本通过所像克隆指令确定;第二更新子单元,用于更新第二镜像的镜像记录中的镜像元数据。In one embodiment, the cloning unit includes: a generation subunit, configured to generate an image record and a version directory of the second image according to the image cloning instruction, and the image metadata of the first image is recorded in the image record of the second image; a third link The subunit is used to create a hard link to the first image file in the first image in the version directory; the copy subunit is used to copy the second image file in the first image to the version directory; the third deletion subunit is, It is used to retain the target version and delete other versions in the copied second image file. The target version is determined by the image clone instruction; the second update subunit is used to update the image metadata in the image record of the second image.
一个实施例中,生成子单元还用于:将第二镜像标记为等待克隆状态;第二更新子单元还用于:将第二镜像标记为完成克隆状态。In one embodiment, the generation subunit is also used to mark the second image as waiting for cloning; the second update subunit is also used to mark the second image as cloning completed.
上述提供的镜像管理装置可用于执行上述任意实施例提供的服务器执行的镜像管理方法,具备相应的功能和有益效果。The image management device provided above can be used to execute the image management method executed by the server provided in any of the above embodiments, and has corresponding functions and beneficial effects.
图15为本申请一个实施例提供的一种镜像管理装置的结构示意图。该镜像管理装置应用于第一终端,第一终端应用第一镜像,第一镜像包含第一镜像文件和第二镜像文件,第一镜像文件记录有第一终端中云桌面所使用的操作系统,第二镜像 文件记录有基于操作系统安装的设备驱动和应用程序,参考图15,该镜像管理装置包括:第三发送单元801、第一下载单元802、第一替换单元803、第一创建单元804、第二下载单元805和第二替换单元806。Figure 15 is a schematic structural diagram of an image management device provided by an embodiment of the present application. The image management device is applied to a first terminal. The first terminal applies a first image. The first image includes a first image file and a second image file. The first image file records the operating system used by the cloud desktop in the first terminal. Second mirror The file records device drivers and applications installed based on the operating system. Referring to Figure 15, the image management device includes: a third sending unit 801, a first download unit 802, a first replacement unit 803, a first creation unit 804, a second Download unit 805 and second replacement unit 806.
第三发送单元801,用于向云桌面的服务器发送第一下载请求;第一下载单元802,用于当第一下载请求用于从服务器中下载新的第二镜像文件,接收服务器发送的新的第二镜像文件;第一替换单元803,用于使用接收的第二镜像文件替换本地原有的第二镜像文件;第一创建单元804,用于基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,第一镜像还包含第三镜像文件,第三镜像文件记录有云桌面在设定第二快照的状态下运行时新增的数据;第二下载单元805,用于当第一下载请求用于从服务器中下载新的第二镜像文件和对应的第三镜像文件,接收服务器发送的新的第二镜像文件和第三镜像文件,所第三镜像文件基于新的第二镜像文件中的设定第二快照生成;第二替换单元806,用于使用接收的第二镜像文件替换本地原有的第二镜像文件。The third sending unit 801 is used to send the first download request to the server of the cloud desktop; the first download unit 802 is used to receive the new second image file sent by the server when the first download request is used to download a new second image file from the server. the second image file; the first replacement unit 803 is used to replace the local original second image file with the received second image file; the first creation unit 804 is used to based on the settings in the received second image file The second snapshot creates a corresponding third image file. The first image also includes a third image file. The third image file records the data newly added when the cloud desktop is running in the state of setting the second snapshot; the second download unit 805 , used when the first download request is used to download a new second image file and the corresponding third image file from the server, and receive the new second image file and the third image file sent by the server, and the third image file is based on The second snapshot of the settings in the new second image file is generated; the second replacement unit 806 is configured to replace the original local second image file with the received second image file.
一个实施例中,还包括:运行单元,用于根据本地现有的第一镜像文件、第二镜像文件和对应的第三镜像文件运行云桌面,并在运行过程中,将新增的数据写入第三镜像文件;上传单元,用于将第三镜像文件上传至服务器,以使服务器将第三镜像文件提交到对应的第二镜像文件中。In one embodiment, it also includes: an operating unit, configured to run the cloud desktop based on the local existing first image file, the second image file and the corresponding third image file, and write the newly added data during the operation process. Enter the third image file; the upload unit is used to upload the third image file to the server, so that the server submits the third image file to the corresponding second image file.
一个实施例中,还包括:第五接收单元,用于接收第二终端发送的同步请求,第二终端与第一终端使用相同的第一镜像文件;第四发送单元,用于将本地现有的第二镜像文件发送至第二终端,以使第二终端使用接收的第二镜像文件替换原有的第二镜像文件。In one embodiment, the method further includes: a fifth receiving unit, configured to receive a synchronization request sent by a second terminal, which uses the same first image file as the first terminal; and a fourth sending unit, configured to transfer the local existing The second image file is sent to the second terminal, so that the second terminal uses the received second image file to replace the original second image file.
上述提供的镜像管理装置可用于执行上述任意实施例提供的第一终端执行的镜像管理方法,具备相应的功能和有益效果。The image management device provided above can be used to execute the image management method executed by the first terminal provided in any of the above embodiments, and has corresponding functions and beneficial effects.
值得注意的是,上述镜像管理装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。It is worth noting that in the above embodiment of the image management device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, each unit and module is not limited to the above division. 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 application.
图16为本申请一个实施例提供的一种镜像管理设备的结构示意图。该镜像管理设备可以是镜像管理服务器,也可以是镜像管理终端。如图16所示,该镜像管理设备包括处理器90、存储器91和通信模块92;处理器90的数量可以是一个或多个,图16中以一个处理器90为例。镜像管理设备中处理器90、存储器91和通信模块92可以通过总线或其他方式连接,图16中以通过总线连接为例。Figure 16 is a schematic structural diagram of an image management device provided by an embodiment of the present application. The image management device may be an image management server or an image management terminal. As shown in Figure 16, the image management device includes a processor 90, a memory 91 and a communication module 92; the number of processors 90 can be one or more, and one processor 90 is taken as an example in Figure 16. The processor 90, the memory 91 and the communication module 92 in the image management device can be connected through a bus or other means. In Figure 16, connection through a bus is taken as an example.
存储器91作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本申请实施例中的镜像管理方法对应的程序指令/模块(例如,镜像管理设备为镜像管理服务器时,镜像管理装置中的第一接收单元701、第一发送单元702和第二发送单元703,镜像管理设备为镜像管理终端时,镜像管理装置中的第三发送单元801、第一下载单元802、第一替换单元803、第一创建单元804、第二下载单元805和第二替换单元806)。处理器90通过运行存储在存储器91中的软件程序、指令以及模块,从而执行镜像管理设备的各种功能应用以及数据处理,即实现上述的镜像管理方法。As a computer-readable storage medium, the memory 91 can be used to store software programs, computer executable programs and modules, such as program instructions/modules corresponding to the image management method in the embodiment of the present application (for example, the image management device is an image management server When the image management device is the first receiving unit 701, the first sending unit 702 and the second sending unit 703, when the image management device is an image management terminal, the third sending unit 801 and the first downloading unit 802 in the image management device , first replacement unit 803, first creation unit 804, second download unit 805 and second replacement unit 806). The processor 90 executes various functional applications and data processing of the image management device by running software programs, instructions and modules stored in the memory 91, that is, implementing the above image management method.
存储器91可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据镜像管理设备的使用所创建的数据等。此外,存储器91可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器91可进一步包括相对于处理器90远程设置的存储器,这些远程存储器可以通过网络连接至镜像管理设备。上述网络的实例包括但 不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 91 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system and at least one application program required for a function; the stored data area may store data created according to the use of the image management device, etc. In addition, the memory 91 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, the memory 91 may further include memory located remotely relative to the processor 90 , and these remote memories may be connected to the image management device through a network. Examples of the above networks include but Not limited to the Internet, intranet, local area network, mobile communication network and combinations thereof.
通信装置92用于根据处理器的指示实现数据通信,如镜像管理设备为服务器时,可以与终端进行数据通信,再如镜像管理设备为终端时,可以与服务器进行数据通信。镜像管理设备还可以包括输入装置和输出装置,输入装置可用于接收输入的数字或字符信息,以及产生与镜像管理设备的用户设置以及功能控制有关的键信号输入,还可以包括麦克风等音频输入设备。输出装置可包括显示屏、扬声器等设备。The communication device 92 is used to implement data communication according to instructions of the processor. For example, when the image management device is a server, it can perform data communication with the terminal. If the image management device is a terminal, it can perform data communication with the server. The image management device may also include an input device and an output device. The input device may be used to receive input numeric or character information and generate key signal input related to user settings and function control of the image management device. It may also include audio input devices such as microphones. . Output devices may include displays, speakers, and other devices.
上述镜像管理设备包含对应的镜像管理装置,可以用于执行任意实施例提供的对应的镜像管理法,具备相应的功能和有益效果。The above image management device includes a corresponding image management device, which can be used to execute the corresponding image management method provided by any embodiment, and has corresponding functions and beneficial effects.
此外,本申请一个实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行本申请任意实施例所提供的镜像管理方法中的相关操作,且具备相应的功能和有益效果。In addition, one embodiment of the present application also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform relevant aspects of the image management method provided by any embodiment of the present application. operation, and has corresponding functions and beneficial effects.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。Those skilled in the art will understand that embodiments of the present application may be provided as methods, systems, or computer program products.
因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. Memory may include non-volatile memory in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information. Information may be computer-readable instructions, data structures, modules of programs, 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), and read-only memory. (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商 品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprises,""comprises," or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements not only includes those elements, but also includes Other elements not expressly listed or included for the process, method, business factors inherent in the product or equipment. Without further limitation, an element qualified by the statement "comprises a..." does not exclude the presence of additional identical elements in the process, method, good, or device that includes the element.
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。 Note that the above are only the preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present application, and the present application The scope is determined by the scope of the appended claims.

Claims (24)

  1. 一种镜像管理方法,应用于服务器,其特征在于,包括:An image management method, applied to servers, is characterized by including:
    接收第一终端发送的第一下载请求,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序;Receive a first download request sent by a first terminal, the first terminal applies a first image, the first image includes a first image file and a second image file, the first image file records the first terminal The operating system used by Zhongyun Desktop, the second image file records device drivers and applications installed based on the operating system;
    当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,将新的第二镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件并基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;When the first download request is used to download a new second image file from the server, the new second image file is sent to the first terminal, so that the first terminal uses the received second image file. The file replaces the local original second image file and creates a corresponding third image file based on the set second snapshot in the received second image file. The first image also includes the third image file, and the third image file is The third image file records data newly added when the cloud desktop is running in the state of setting the second snapshot;
    当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,将新的第二镜像文件和所述第三镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成。When the first download request is used to download a new second image file and the corresponding third image file from the server, the new second image file and the third image file are sent to the third image file. A terminal, so that the first terminal uses the received second image file to replace the local original second image file, and the third image file is generated based on the second snapshot of the settings in the new second image file. .
  2. 根据权利要求1所述的镜像管理方法,其特征在于,所述第一镜像文件包含唯一的第一快照,所述第二镜像文件包含所述第一快照的第一快照名;The image management method according to claim 1, wherein the first image file contains a unique first snapshot, and the second image file contains a first snapshot name of the first snapshot;
    所述第二镜像文件包含至少一个第二快照,所述第三镜像文件包含所对应的第二快照的第二快照名。The second image file includes at least one second snapshot, and the third image file includes a second snapshot name of the corresponding second snapshot.
  3. 根据权利要求2所述的镜像管理方法,其特征在于,所述第一镜像在所述服务器中记录有至少一个版本,每个版本对应所述第二镜像文件中的一个第二快照且关联于所述第二镜像文件、所述第二镜像文件中第一快照名对应的第一镜像文件以及所述第二快照对应的第三镜像文件,每个所述版本均有对应的版本ID。The image management method according to claim 2, characterized in that the first image is recorded in the server with at least one version, and each version corresponds to a second snapshot in the second image file and is associated with Each version of the second image file, the first image file corresponding to the first snapshot name in the second image file, and the third image file corresponding to the second snapshot has a corresponding version ID.
  4. 根据权利要求3所述的镜像管理方法,其特征在于,所述第一镜像在所述服务器中记录有至少一个镜像分支,每个所述镜像分支包含至少一个版本,所述第一终端应用所述第一镜像的一个镜像分支。The image management method according to claim 3, characterized in that the first image is recorded in the server with at least one image branch, each of the image branches contains at least one version, and the first terminal application A mirror branch of the first mirror.
  5. 根据权利要求3所述的镜像管理方法,其特征在于,还包括:The image management method according to claim 3, further comprising:
    获取第一镜像文件和第二镜像文件;Obtain the first image file and the second image file;
    将所述第一镜像文件和所述第二镜像文件分别硬链接到所述第一镜像;Hard link the first image file and the second image file to the first image respectively;
    基于所述第二镜像文件初始的第二快照创建对应的版本目录,并将所述第一镜像文件和所述第二镜像文件分别硬链接到所述版本目录中,得到所述第一镜像。Create a corresponding version directory based on the initial second snapshot of the second image file, and hard-link the first image file and the second image file to the version directory respectively to obtain the first image.
  6. 根据权利要求5所述的镜像管理方法,其特征在于,所述将所述第一镜像文件和所述第二镜像文件分别硬链接到所述版本目录中之后,还包括:The image management method according to claim 5, characterized in that after hard linking the first image file and the second image file to the version directory respectively, it further includes:
    基于所述初始的第二快照创建对应的第三镜像文件。Create a corresponding third image file based on the initial second snapshot.
  7. 根据权利要求5或6所述的镜像管理方法,其特征在于,所述将所述第一镜像文件和所述第二镜像文件分别硬链接到所述第一镜像时,还包括:The image management method according to claim 5 or 6, characterized in that when hard linking the first image file and the second image file to the first image respectively, it further includes:
    创建所述第一镜像的镜像记录,并在所述镜像记录中添加第一镜像的镜像元数据;Create a mirror record of the first mirror, and add mirror metadata of the first mirror to the mirror record;
    所述基于所述第二镜像文件初始的第二快照创建对应的版本目录时,还包括:When creating the corresponding version directory based on the initial second snapshot of the second image file, it also includes:
    创建所述初始的第二快照对应的版本记录,并在所述版本记录中记录所述初始的第二快照对应版本的版本元数据。Create a version record corresponding to the initial second snapshot, and record version metadata of the version corresponding to the initial second snapshot in the version record.
  8. 根据权利要求3所述的镜像管理方法,其特征在于,还包括:The image management method according to claim 3, further comprising:
    接收所述第一终端上传的第三镜像文件;Receive the third image file uploaded by the first terminal;
    获取所述第一终端中所述第一镜像当前的版本ID;Obtain the current version ID of the first image in the first terminal;
    查找所述版本ID对应的第二镜像文件;Find the second image file corresponding to the version ID;
    将所述第三镜像文件提交到所述第二镜像文件,以得到新的第二镜像文件; Submit the third image file to the second image file to obtain a new second image file;
    在所述新的第二镜像文件中创建新的第二快照。Create a new second snapshot in the new second image file.
  9. 根据权利要求8所述的镜像管理方法,其特征在于,所述在所述新的第二镜像文件中创建新的第二快照之后,还包括:The image management method according to claim 8, characterized in that after creating a new second snapshot in the new second image file, it further includes:
    删除所述第三镜像文件;Delete the third image file;
    基于所述新的第二快照创建新的第三镜像文件。Create a new third image file based on the new second snapshot.
  10. 根据权利要求8所述的镜像管理方法,其特征在于,所述将所述第三镜像文件提交到所述第二镜像文件包括:The image management method according to claim 8, wherein said submitting the third image file to the second image file includes:
    将所述第二镜像文件还原到所述第三镜像文件所对应的第二快照;Restore the second image file to the second snapshot corresponding to the third image file;
    对还原后的第二镜像文件进行重命名,以使所述第二镜像文件使用所述第二快照的第二快照名;Rename the restored second image file so that the second image file uses the second snapshot name of the second snapshot;
    将所述第三镜像文件提交到重命名后的第二镜像文件。Submit the third image file to the renamed second image file.
  11. 根据权利要求9所述的镜像管理方法,其特征在于,所述第一镜像在所述服务器中记录有对应的快照列表,所述快照列表中记录所述第一镜像的各版本及各所述版本对应的第二快照;The image management method according to claim 9, characterized in that the first image is recorded in the server with a corresponding snapshot list, and the snapshot list records each version of the first image and each of the The second snapshot corresponding to the version;
    所述在所述新的第二镜像文件中创建新的第二快照之后,还包括:After creating a new second snapshot in the new second image file, the method further includes:
    更新所述快照列表,并更新所述镜像记录中的镜像元数据。Update the snapshot list and update the image metadata in the image record.
  12. 根据权利要求3所述的镜像管理方法,其特征在于,还包括:The image management method according to claim 3, further comprising:
    接收镜像还原指令;Receive image restore instructions;
    根据所述镜像还原指令,获取待还原的版本ID;Obtain the version ID to be restored according to the image restoration instruction;
    根据所述版本ID查找对应的第二镜像文件以及对应的第二快照名;Search the corresponding second image file and the corresponding second snapshot name according to the version ID;
    根据所述第二快照名,将所述第二镜像文件还原到对应的第二快照。According to the second snapshot name, the second image file is restored to the corresponding second snapshot.
  13. 根据权利要求12所述的镜像管理方法,其特征在于,所述根据所述第二快照名,将所述第二镜像文件还原到对应的第二快照之后,还包括:The image management method according to claim 12, characterized in that after restoring the second image file to the corresponding second snapshot according to the second snapshot name, it further includes:
    删除所述第二镜像文件对应的第三镜像文件;Delete the third image file corresponding to the second image file;
    基于还原到的第二快照创建新的第三镜像文件。Create a new tertiary image file based on the restored second snapshot.
  14. 根据权利要求3所述的镜像管理方法,其特征在于,还包括:The image management method according to claim 3, further comprising:
    接收镜像克隆指令,所述镜像克隆指令用于克隆所述第一镜像;Receive an image cloning instruction, which is used to clone the first image;
    根据所述第一镜像所包含的第一镜像文件和第二镜像文件克隆得到第二镜像,所述第二镜像为克隆后的镜像。A second image is obtained by cloning the first image file and the second image file included in the first image, and the second image is a cloned image.
  15. 根据权利要求14所述的镜像管理方法,其特征在于,所述根据所述第一镜像所包含的第一镜像文件和第二镜像文件克隆得到第二镜像包括:The image management method according to claim 14, wherein cloning the first image file and the second image file included in the first image to obtain the second image includes:
    根据所述镜像克隆指令,生成第二镜像的镜像记录和版本目录,所述第二镜像的镜像记录中记录所述第一镜像的镜像元数据;According to the image cloning instruction, generate an image record and a version directory of the second image, and record the image metadata of the first image in the image record of the second image;
    在所述版本目录中创建所述第一镜像中第一镜像文件的硬链接;Create a hard link to the first image file in the first image in the version directory;
    将所述第一镜像中的第二镜像文件复制到所述版本目录中;Copy the second image file in the first image to the version directory;
    在复制后的第二镜像文件中保留目标版本并删除其他版本,所述目标版本通过所述镜像克隆指令确定;Keep the target version in the copied second image file and delete other versions, where the target version is determined by the image cloning instruction;
    更新所述第二镜像的镜像记录中的镜像元数据。Update the image metadata in the image record of the second image.
  16. 根据权利要求15所述的镜像管理方法,其特征在于,所述根据所述镜像克隆指令,生成第二镜像的镜像记录和版本目录时,还包括:The image management method according to claim 15, characterized in that when generating the image record and version directory of the second image according to the image cloning instruction, it further includes:
    将第二镜像标记为等待克隆状态;Mark the second image as waiting for cloning;
    更新所述第二镜像的镜像记录中的镜像元数据时,还包括: When updating the image metadata in the image record of the second image, it also includes:
    将所述第二镜像标记为完成克隆状态。Mark the second image as clone complete.
  17. 一种镜像管理方法,应用于第一终端,其特征在于,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序,An image management method, applied to a first terminal, characterized in that the first terminal applies a first image, the first image includes a first image file and a second image file, and the first image file records The operating system used by the cloud desktop in the first terminal, and the second image file records device drivers and applications installed based on the operating system,
    所述方法包括:The methods include:
    向所述云桌面的服务器发送第一下载请求;Send a first download request to the server of the cloud desktop;
    当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,接收所述服务器发送的新的第二镜像文件;When the first download request is used to download a new second image file from the server, receive the new second image file sent by the server;
    使用接收的第二镜像文件替换本地原有的第二镜像文件;Use the received second image file to replace the local original second image file;
    基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;Create a corresponding third image file based on the set second snapshot in the received second image file. The first image also includes the third image file. The third image file records the location of the cloud desktop. The data added when running in the second snapshot state is set as described above;
    当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,接收所述服务器发送的新的第二镜像文件和所述第三镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成;When the first download request is used to download a new second image file and the corresponding third image file from the server, receive the new second image file and the third image file sent by the server , the third image file is generated based on the set second snapshot in the new second image file;
    使用接收的第二镜像文件替换本地原有的第二镜像文件。Use the received second image file to replace the local original second image file.
  18. 根据权利要求17所述的镜像管理方法,其特征在于,还包括:The image management method according to claim 17, further comprising:
    根据本地现有的第一镜像文件、第二镜像文件和对应的第三镜像文件运行所述云桌面,并在运行过程中,将新增的数据写入所述第三镜像文件;Run the cloud desktop based on the local existing first image file, second image file and corresponding third image file, and during the operation process, write new data into the third image file;
    将所述第三镜像文件上传至所述服务器,以使所述服务器将所述第三镜像文件提交到对应的第二镜像文件中。Upload the third image file to the server, so that the server submits the third image file to the corresponding second image file.
  19. 根据权利要求17所述的镜像管理方法,其特征在于,还包括:The image management method according to claim 17, further comprising:
    接收第二终端发送的同步请求,所述第二终端与所述第一终端使用相同的第一镜像文件;Receive a synchronization request sent by a second terminal, where the second terminal and the first terminal use the same first image file;
    将本地现有的第二镜像文件发送至所述第二终端,以使所述第二终端使用接收的第二镜像文件替换原有的第二镜像文件。Send the locally existing second image file to the second terminal, so that the second terminal uses the received second image file to replace the original second image file.
  20. 一种镜像管理装置,应用于服务器,其特征在于,包括:An image management device, applied to servers, is characterized by including:
    第一接收单元,用于接收第一终端发送的第一下载请求,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序;The first receiving unit is configured to receive the first download request sent by the first terminal. The first terminal applies a first image. The first image includes a first image file and a second image file. The first image file The operating system used by the cloud desktop in the first terminal is recorded, and the second image file records device drivers and applications installed based on the operating system;
    第一发送单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,将新的第二镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件并基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;A first sending unit, configured to send the new second image file to the first terminal when the first download request is used to download a new second image file from the server, so that the first The terminal uses the received second image file to replace the local original second image file and creates a corresponding third image file based on the set second snapshot in the received second image file. The first image also includes the third image file. Three image files, the third image file records data newly added when the cloud desktop is running in the state of setting the second snapshot;
    第二发送单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,将新的第二镜像文件和所述第三镜像文件发送至所述第一终端,以使所述第一终端使用接收的第二镜像文件替换本地原有的第二镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成。A second sending unit configured to, when the first download request is used to download a new second image file and the corresponding third image file from the server, send the new second image file and the corresponding third image file to the server. The image file is sent to the first terminal, so that the first terminal uses the received second image file to replace the local original second image file, and the third image file is based on the new second image file. The second snapshot of the settings is generated.
  21. 一种镜像管理装置,应用于第一终端,其特征在于,所述第一终端应用第一镜像,所述第一镜像包含第一镜像文件和第二镜像文件,所述第一镜像文件记录有所述第一终端中云桌面所使用的操作系统,所述第二镜像文件记录有基于所述操作系统安装的设备驱动和应用程序,An image management device, applied to a first terminal, characterized in that the first terminal applies a first image, the first image includes a first image file and a second image file, and the first image file records The operating system used by the cloud desktop in the first terminal, and the second image file records device drivers and applications installed based on the operating system,
    所述装置包括:The device includes:
    第三发送单元,用于向所述云桌面的服务器发送第一下载请求; The third sending unit is used to send the first download request to the server of the cloud desktop;
    第一下载单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件,接收所述服务器发送的新的第二镜像文件;A first download unit configured to receive the new second image file sent by the server when the first download request is used to download a new second image file from the server;
    第一替换单元,用于使用接收的第二镜像文件替换本地原有的第二镜像文件;The first replacement unit is used to replace the original local second image file with the received second image file;
    第一创建单元,用于基于接收的第二镜像文件中的设定第二快照创建对应的第三镜像文件,所述第一镜像还包含所述第三镜像文件,所述第三镜像文件记录有所述云桌面在所述设定第二快照的状态下运行时新增的数据;A first creation unit configured to create a corresponding third image file based on the set second snapshot in the received second image file, where the first image also includes the third image file, and the third image file records There is data newly added when the cloud desktop is running in the state of setting the second snapshot;
    第二下载单元,用于当所述第一下载请求用于从所述服务器中下载新的第二镜像文件和对应的所述第三镜像文件,接收所述服务器发送的新的第二镜像文件和所述第三镜像文件,所述第三镜像文件基于所述新的第二镜像文件中的设定第二快照生成;A second download unit configured to receive the new second image file sent by the server when the first download request is used to download a new second image file and the corresponding third image file from the server. and the third image file, the third image file is generated based on the set second snapshot in the new second image file;
    第二替换单元,用于使用接收的第二镜像文件替换本地原有的第二镜像文件。The second replacement unit is used to replace the original local second image file with the received second image file.
  22. 一种镜像管理服务器,其特征在于,包括:An image management server, which is characterized by including:
    通信模块,用于实现数据通信;Communication module, used to implement data communication;
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序;Memory, used to store one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-16中任一所述的镜像管理方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image management method as described in any one of claims 1-16.
  23. 一种镜像管理终端,其特征在于,包括:An image management terminal is characterized by including:
    通信模块,用于实现数据通信;Communication module, used to implement data communication;
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序;Memory, used to store one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求17-19中任一所述的镜像管理方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image management method as described in any one of claims 17-19.
  24. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-16中任一所述的镜像管理方法或实现如权利要求17-19中任一所述的镜像管理方法。 A computer-readable storage medium with a computer program stored thereon, characterized in that when the program is executed by a processor, the image management method as described in any one of claims 1-16 is implemented or the image management method as claimed in claims 17-19 is implemented The image management method described in any one of the above.
PCT/CN2023/084551 2022-04-13 2023-03-29 Mirror image management methods, apparatus, server, terminal, and storage medium WO2023197862A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210385398.X 2022-04-13
CN202210385398.XA CN116954681A (en) 2022-04-13 2022-04-13 Mirror image management method, device, server, terminal and storage medium

Publications (1)

Publication Number Publication Date
WO2023197862A1 true WO2023197862A1 (en) 2023-10-19

Family

ID=88328915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/084551 WO2023197862A1 (en) 2022-04-13 2023-03-29 Mirror image management methods, apparatus, server, terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN116954681A (en)
WO (1) WO2023197862A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873506A (en) * 2024-03-12 2024-04-12 山东乾云启创信息科技股份有限公司 Mirror image operation realization method and system based on VOI

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260229A (en) * 2015-10-28 2016-01-20 北京百度网讯科技有限公司 Method and device for pulling mirror image files of virtual machines
CN105450759A (en) * 2015-12-02 2016-03-30 浙江宇视科技有限公司 System mirror image management method and device
US20160092202A1 (en) * 2014-09-25 2016-03-31 International Business Machines Corporation Live Operating System Update Mechanisms
CN111221537A (en) * 2018-11-23 2020-06-02 中兴通讯股份有限公司 Cloud desktop upgrading method and device, cloud server and storage medium
CN112882729A (en) * 2019-11-29 2021-06-01 顺丰科技有限公司 Application image upgrading method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160092202A1 (en) * 2014-09-25 2016-03-31 International Business Machines Corporation Live Operating System Update Mechanisms
CN105260229A (en) * 2015-10-28 2016-01-20 北京百度网讯科技有限公司 Method and device for pulling mirror image files of virtual machines
CN105450759A (en) * 2015-12-02 2016-03-30 浙江宇视科技有限公司 System mirror image management method and device
CN111221537A (en) * 2018-11-23 2020-06-02 中兴通讯股份有限公司 Cloud desktop upgrading method and device, cloud server and storage medium
CN112882729A (en) * 2019-11-29 2021-06-01 顺丰科技有限公司 Application image upgrading method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873506A (en) * 2024-03-12 2024-04-12 山东乾云启创信息科技股份有限公司 Mirror image operation realization method and system based on VOI

Also Published As

Publication number Publication date
CN116954681A (en) 2023-10-27

Similar Documents

Publication Publication Date Title
US11375008B2 (en) Consumption of data services provisioned in cloud infrastructures
US11356509B2 (en) Service and APIs for remote volume-based block storage
CA2923068C (en) Method and system for metadata synchronization
JP5775177B2 (en) Clone file creation method and file system using it
US20190235968A1 (en) Archiving nas servers to the cloud
JP2022095781A (en) System and method of database tenant migration
US9515878B2 (en) Method, medium, and system for configuring a new node in a distributed memory network
US10911540B1 (en) Recovering snapshots from a cloud snapshot lineage on cloud storage to a storage system
US11199985B2 (en) Tracking storage capacity usage by snapshot lineages using metadata in a multi-level tree structure
US10740192B2 (en) Restoring NAS servers from the cloud
US10852996B2 (en) System and method for provisioning slave storage including copying a master reference to slave storage and updating a slave reference
JP2014503086A (en) File system and data processing method
US10102083B1 (en) Method and system for managing metadata records of backups
CN103002027A (en) System and method for data storage on basis of key-value pair system tree-shaped directory achieving structure
WO2023197862A1 (en) Mirror image management methods, apparatus, server, terminal, and storage medium
US10223206B1 (en) Method and system to detect and delete uncommitted save sets of a backup
US20220214814A1 (en) Cross-platform replication of logical units
US10620883B1 (en) Multi-format migration for network attached storage devices and virtual machines
US11537553B2 (en) Managing snapshots stored locally in a storage system and in cloud storage utilizing policy-based snapshot lineages
US11288134B2 (en) Pausing and resuming copying of snapshots from a local snapshot lineage to at least one cloud snapshot lineage
US8583600B2 (en) Deploying directory instances
CN113811867A (en) Hard linking operations for files in a file system
US11573923B2 (en) Generating configuration data enabling remote access to portions of a snapshot lineage copied to cloud storage
US11630736B2 (en) Recovering a storage volume associated with a snapshot lineage from cloud storage
US10713121B1 (en) Dynamic migration of a cloud based distributed file system metadata server

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23787508

Country of ref document: EP

Kind code of ref document: A1