WO2014100954A1 - Method and system for data controlling - Google Patents

Method and system for data controlling Download PDF

Info

Publication number
WO2014100954A1
WO2014100954A1 PCT/CN2012/087338 CN2012087338W WO2014100954A1 WO 2014100954 A1 WO2014100954 A1 WO 2014100954A1 CN 2012087338 W CN2012087338 W CN 2012087338W WO 2014100954 A1 WO2014100954 A1 WO 2014100954A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data block
memory
read
virtual machine
Prior art date
Application number
PCT/CN2012/087338
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 华为技术有限公司
Priority to PCT/CN2012/087338 priority Critical patent/WO2014100954A1/en
Priority to CN201280002917.4A priority patent/CN103229150B/en
Publication of WO2014100954A1 publication Critical patent/WO2014100954A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a data control method and system. Background technique
  • virtualization technology can virtualize the physical resources of one physical machine (that is, a physical computer) into multiple virtual machines, and each virtual machine can implement the functions of the physical machine.
  • the virtual machine has a cloning function.
  • One virtual machine (the virtual machine is equivalent to the source virtual machine) can clone one or more cloned virtual machines.
  • Each cloned virtual machine can have the same operating system and application software as the source virtual machine.
  • data files after the cloned virtual machine is generated, you can also add new data or update existing data.
  • the prior art provides a link cloning technology for implementing a clone virtual machine operation through a base image and an update image.
  • the base image is the data portion common to the cloned virtual machine and the source virtual machine
  • the update image is the data portion of the cloned virtual machine that is different from the source virtual machine.
  • the invention provides a data control method and system, which can improve the utilization rate of memory resources.
  • the first aspect provides a data control method, where the base image is saved in the memory, and the update image is saved in the disk, where the method includes:
  • the data block requested to be read belongs to the base image
  • the data block is read from the memory, and the data block is sent to the clone virtual machine
  • the basic image is compressed and saved in a virtual device in the memory
  • reading the data block from the memory, and sending the data block to the clone virtual machine includes: when the request is read When the data block belongs to the base image, the data block is read and decompressed from the virtual device of the memory, and the decompressed data block is sent to the clone virtual machine.
  • the method further includes:
  • the data block in the memory is saved in each page of the memory
  • the method further includes:
  • the hash operation is performed by using the data in each page to obtain the hash value of each page; If the page with the same hash value is greater than two, one of the pages with the same hash value is retained, and the remaining pages are deleted.
  • a data control system is provided.
  • the base image is saved in the memory, and the update image is saved in the disk.
  • the system includes:
  • a receiving module configured to receive a read data request sent by the clone virtual machine
  • control module configured to determine a mirror image to which the data block requested to be read by the read data request belongs
  • a reading module configured to: when the control module determines that the data block requested to be read belongs to a basic image, read the data block from the memory; and send a module, configured to send the data block to the Cloning a virtual machine;
  • the reading module is further configured to: when the control module determines that the data block requested to be read belongs to an update image, read the data block from the disk; and write a module, where the data is used to The block is written into the memory; the reading module is further configured to read the data block from the memory, and send the data block to the clone virtual machine by the sending module.
  • the basic image is compressed and saved in a virtual device in the memory
  • the reading module is specifically configured to: when the control module determines that the data block requested to be read belongs to a basic image, read and decompress the data block from the virtual device in the memory;
  • the sending module is specifically configured to send the decompressed data block to the clone virtual machine.
  • the receiving module is further configured to receive a write data request sent by the cloned virtual machine; the control module is further configured to determine whether the data requested by the write data request constitutes a complete data block;
  • the writing module is further configured to: if the control module determines that the data requested to be written by the write data request constitutes a complete data block, write the update image; the reading module further uses If the control module determines the write data, please If the data requested to be written does not constitute a complete data block, the data block corresponding to the data is taken out from the base image, and the data is updated into a data block corresponding to the data, the writing module Also used to write the updated data block to the update image.
  • the data block in the memory is saved in each page of the memory
  • the system also includes:
  • a scanning module configured to periodically scan each page in the memory
  • An operation module configured to perform hash operation by using data in each page, respectively, to obtain a hash value of each page
  • the processing module is configured to reserve one of the pages with the same hash value and delete the remaining pages if the pages with the same hash value are greater than two.
  • a data control system is provided.
  • the base image is saved in the memory, and the update image is saved in the disk.
  • the system includes:
  • a receiver configured to receive a read data request sent by the clone virtual machine
  • a processor configured to determine a mirror image of the data block requested to be read by the read data request
  • the processor is further configured to: when determining that the data block requested to be read belongs to a base image, read the data block from the memory; and send, by the transmitter, the data block to the clone virtual machine;
  • the processor is further configured to: when the data block requested to be read belongs to an update image, read the data block from the disk, and write the data block into the memory, from the The data block is read in memory and sent by the transmitter to the cloned virtual machine.
  • the basic image is compressed and saved in a virtual device in the memory
  • the processor is specifically configured to: when determining that the data block requested to be read belongs to the basic image, reading and decompressing the data block from the virtual device of the memory;
  • the transmitter is specifically configured to send the decompressed data block to the clone virtual machine.
  • the receiver is further configured to receive a write data request sent by the clone virtual machine; the processor is further configured to determine whether the data requested by the write data request is a complete data block;
  • the processor is further configured to write into the update image if it is determined that the data requested to be written by the write data request constitutes a complete data block;
  • the processor is further configured to: if it is determined that the data requested to be written by the write data request does not constitute a complete data block, extract a data block corresponding to the data from the base image, and update the data to the In the data block corresponding to the data, the updated data block is written into the update image.
  • the data block in the memory is saved in a page of the memory
  • the processor is further configured to periodically scan each page in the memory; respectively perform hash operation by using data in each page to obtain a hash value of each page; if the page with the same hash value is greater than two, Keep one of the pages with the same hash value and delete the remaining pages.
  • the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, the data read by the request may be directly read from the memory. Piece.
  • the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art.
  • the embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory.
  • FIG. 1 is a schematic diagram of a flow of reading and writing data of a cloned virtual machine according to an embodiment of the present invention
  • FIG. 2a is a first flowchart of a data control method according to an embodiment of the present invention
  • FIG. 2b is a second flowchart of a data control method according to an embodiment of the present invention
  • Figure 3a is a first structural diagram of a data control system according to an embodiment of the present invention
  • Figure 3b is a second structural diagram of a data control system according to an embodiment of the present invention
  • Figure 4 is a data control system according to an embodiment of the present invention
  • the third structural diagram The third structural diagram. detailed description
  • Embodiments of the present invention provide a data control method, which is applied to a clone virtual machine when reading and writing data from a base image and an update image.
  • the clone virtual machine is obtained by using a source virtual machine for cloning, and the base image is the same data part of the clone virtual machine and the source virtual machine, and the update image is different data of the clone virtual machine and the source virtual machine. section.
  • the schematic diagram of the process of reading and writing data of the cloned virtual machine shown in FIG. 1 is saved in the memory, and the updated image is saved in the disk.
  • Memory An electronic device made up of semiconductor technology used to store data.
  • the memory capacity is usually small (for example, 16M, 1 G, etc.), but read The speed is faster.
  • the memory When the memory is powered up, the data can be saved, but after the power is turned off, the saved data will be cleared, so it is also called a high-speed temporary storage of information hardware.
  • a disk can include a hard disk, an electronic device made of magnetic material that stores and retrieves data on a flat magnetic surface.
  • the information is written by the electromagnetic flow to the disk by the write head that is close to the magnetic surface, and the polarity is changed by the electromagnetic flow.
  • the information can be read back in the opposite way.
  • the capacity of a disk is usually large (for example, 40G, 100G, etc.), but the reading speed is slow.
  • a disk is a kind of non-volatile storage device. When the power is turned off, the saved data is not lost. Therefore, it is also called a low-speed hardware that stores information for a long time.
  • the data saved in the base image includes: an operating system, an application, and a data file cloned from the source virtual machine, where the data saved in the update image includes: a new data added by the clone virtual machine or a base image
  • the data obtained after the data is updated.
  • Each cloned virtual machine has its own update image, but shares the same base image. When each cloned virtual machine starts up, it needs to read data from the base image and read and write data to the respective update image according to their respective requirements.
  • a clone virtual machine is taken as an example to describe a data control method.
  • the execution body of the method is a data control system, which can process read and write data requests from the cloned virtual machine.
  • the method includes:
  • the data block is a minimum unit for performing data read and write operations. Generally, one data block includes 512 bytes.
  • the data block read by the request may be modified to determine whether the data block read by the request belongs to a basic image or an updated image.
  • the data control system can set the modification flag of each data block in the base image to be unmodified.
  • the data block saved in the update image is a new data block added by the clone virtual machine or a data block obtained by updating the data block in the base image, and the cloned virtual machine writes the data block to the update image when the data is written.
  • the control system can set the modification flags for these data blocks to have been modified.
  • the unmodified and modified representation of the modified mark of the data block is a relative concept, mainly to distinguish whether the data block belongs to the basic image or the updated image, that is, the data block marked as unmodified belongs to the basic Mirrored, and the data block marked as modified belongs to the update image.
  • the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, the data read by the request may be directly read from the memory. Piece.
  • the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art.
  • the embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory.
  • the read/write capability of the disk (the number of input/output (I/O) read/write per unit time) is usually It is fixed, thus limiting the number of cloned virtual machines running simultaneously.
  • the cloning virtual machine in the embodiment of the present invention does not need to read and write the disk when reading the basic image, and only reads and writes the disk when the updated image is read, thereby reducing the number of reading and writing to the disk, and further Support for more cloned virtual machine operations.
  • the prior art also needs to manually set the size of the cache required for cloning a virtual machine, which requires high technical and experience of the technician, and adopts an embodiment of the present invention.
  • the method for providing does not need to preset the size of the buffer required for cloning the virtual machine, and can further improve the practical scope of the embodiment of the present invention.
  • the method provided by the embodiment of the present invention can also process the write data request from the clone virtual machine. details as follows:
  • the data written by the cloned virtual machine does not necessarily constitute a complete data block.
  • the data that the cloned virtual machine needs to write is in a certain data block. Part of the byte is updated.
  • the clone virtual machine needs to write 20 bytes and use the 20 bytes to update the 100-120 bytes of a data block, then from the base image After reading the data block, updating the 100-120 bytes of the data block to the 20 bytes, and writing the updated data block into the update image, specifically requiring writing The cloned virtual machine is in the update image.
  • the basic image may be compressed and saved in the virtual device of the memory, so as to save memory resources.
  • step 203 when the data block requested to be read belongs to the basic image, the data block is read from the memory, and the data block is sent to the clone virtual machine, and the following steps are specifically replaced. Execution: When the data block read by the request belongs to the basic image, the data block is read and decompressed from the virtual device of the memory, and the decompressed data block is sent to the clone virtual machine.
  • the ZRAM tool can create a virtual device in memory.
  • the format of the virtual device can be ext4, ext2 or XFS.
  • Save the base image in In the virtual device the ZRAM tool will automatically compress the base image by using a compression algorithm and save it in the virtual device.
  • the compression algorithm employed is for example the LZO algorithm.
  • the ZRAM tool will automatically decompress the base image using the same compression algorithm and read the decompressed data.
  • the base image is stored in a virtual device in the memory, and all the saved data is cleared when the memory is powered off. Therefore, when the memory is powered on again, the ZRAM tool needs to be used again to perform the base image. Saved in a virtual device in memory.
  • the ZRAM tool is used to save the base image in a virtual device in the memory
  • the startup and shutdown of each virtual machine will not affect the base image saved in the memory.
  • the data block in the memory is stored in each page of the memory, that is, in the data block in the base image stored in advance in the memory, or in the update image read from the disk.
  • the memory is used to save the page in memory.
  • the memory management unit divides the virtual address space of the memory in the form of a page.
  • the size of the page in memory can be 2 to the power of n.
  • the data in the update image of the cloned virtual machine and the data in the base image may be the same, for example, an application in the base image of the cloned virtual machine and an application in the update image use the same link library. Therefore, the page in which the link library is stored in the memory will be duplicated; or, since the data in the updated image of each cloned virtual machine may also have the same situation, the image will be updated in each of the cloned virtual machines. When data is written to memory, it also causes problems with multiple pages holding the same data.
  • the method further includes the following steps:
  • the data control system records the calling end of each page, and the calling end is an application that needs to invoke data in the page, etc., when the data control system receives the request sent by the virtual machine to delete data in a certain page. For example, when an application that uses a certain page in a cloned virtual machine exits, the page needs to be deleted from the memory, and a request to delete data in a certain page is sent to the data control system, and the data control system determines Whether there are other callers on the page. If it exists, the operation of deleting the page is not performed. Otherwise, the page is deleted from the memory.
  • the page share diagram, the base image, the update image of the clone VM VM1, and the update mirror of the clone VM VM2 have the same data block (the slashes represent the same data block), and are only retained in memory.
  • the update image of the clone virtual machine VM1, the update image of the clone virtual machine VM2, and the base image all point to the one page through the page pointer.
  • the page pointer can be used to determine the page where the required data block is stored.
  • the embodiment of the present invention can further improve the utilization of memory resources.
  • the embodiment of the present invention further provides a data control system.
  • the base image is saved in the memory, and the update image is saved in the disk.
  • the basic image and the update image refer to the description of the virtual machine read/write data flow shown in FIG.
  • the system includes:
  • the receiving module 31 is configured to receive a read data request sent by the clone virtual machine, where the control module 32 is configured to determine a mirror image of the data block requested by the read data request, where the data block is for reading and writing data.
  • the smallest unit, usually, a block of data consists of 512 bytes.
  • the control module may determine whether the data block read by the request belongs to a base image or an update image according to whether the data block read by the request is modified. Specific can be See the related description in step 202 of the above method embodiment.
  • a reading module 33 configured to: when the control module determines that the data block requested to be read belongs to the basic image, read the data block from the memory; and send a module 34, configured to: a block is sent to the clone virtual machine;
  • the reading module 33 is further configured to: when the control module determines that the data block requested to be read belongs to the update image, read the data block from the disk; and write a module 35, configured to: Writing the data block into the memory; the reading module 33 is further configured to read the data block from the memory, and send the data block to the clone virtual machine by the sending module.
  • the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, the data read by the request may be directly read from the memory. Piece.
  • the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art.
  • the embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory.
  • the read/write capability of the disk (the number of input/output (I/O) read/write per unit time) is usually It is fixed, thus limiting the number of cloned virtual machines running simultaneously.
  • the cloned virtual machine does not need to read and write the disk when reading the base image, and only reads and writes the disk when the update image is read, thereby reducing read and write of the disk. The number of times, which in turn supports the operation of more cloned virtual machines.
  • the prior art also needs to manually set the size of the cache required for cloning the virtual machine.
  • the technical and experience of the technician is high.
  • the system provided by the embodiment of the present invention does not need to preset the cache required for the cloned virtual machine.
  • the size can further improve the practical range of the embodiments of the present invention.
  • the system can also request write data from the cloned virtual machine Processing, specifically:
  • the receiving module 31 is further configured to receive a write data request sent by the cloned virtual machine.
  • the control module 32 is further configured to determine whether the data requested by the write data request forms a complete data block
  • the writing module 35 is further configured to: if the control module determines that the data requested to be written by the write data request constitutes a complete data block, write the update image; the reading module 33, And if the control module determines that the data requested to be written by the write data request does not constitute a complete data block, extracting a data block corresponding to the data from the base image, and updating the data to In the data block corresponding to the data, the writing module 35 is further configured to write the updated data block into the update image.
  • the data written by the cloned virtual machine does not necessarily constitute a complete data block.
  • the data that the cloned virtual machine needs to write is in a certain data block. Part of the byte is updated.
  • the data block corresponding to the partial byte needs to be read from the base image, and the partial byte is updated to the At the location of the corresponding byte in the data block, for example, the clone virtual machine needs to write 20 bytes and use the 20 bytes to update the 100-120 bytes of a data block, then the data is After the block is read, the 100-120 bytes of the data block are updated to the 20 bytes, and the updated data block is written into the update image, specifically written into the clone virtual The machine is updated in the image.
  • the base image is compressed and stored in the memory, wherein the base image can be compressed and saved in a virtual device in the memory by using a ZRAM tool.
  • the reading module 33 is specifically configured to: when the control module determines that the data block requested to be read belongs to the basic image, read and decompress the data block from the virtual device in the memory;
  • the sending module 34 is specifically configured to send the decompressed data block to the clone virtual machine. Further, the data blocks in the memory are saved in each page of the memory, so as to further improve the utilization of memory resources, effectively saving memory resources, as shown in the figure.
  • the system further includes:
  • the scanning module 36 is configured to periodically scan each page in the memory
  • the operation module 37 is configured to perform hash operation by using data in each page to obtain a hash value of each page;
  • the processing module 38 is configured to reserve one page of the page with the same hash value if the number of pages with the same hash value is greater than two, and delete the remaining pages.
  • the data control system may also record the calling end of each page, where the calling end is an application that needs to invoke data in the page, etc., when the data control system receives the data sent by the virtual machine and deletes a certain page.
  • the data control system receives the data sent by the virtual machine and deletes a certain page.
  • the data control determines whether there are other callers on the page. If it exists, the operation of deleting the page is not performed. Otherwise, the page is deleted from the memory.
  • the embodiment of the present invention further provides a data control system, wherein the base image is saved in the memory, and the update image is saved in the disk.
  • the base image is saved in the memory
  • the update image is saved in the disk.
  • the data control system includes: a processor 41, a receiver 42, a transmitter 43, a memory 44, a bus 4000, and a driving circuit 4001.
  • the receiver 42 is configured to receive a read data request sent by the clone virtual machine, and the processor 41 is configured to determine a mirror image to which the read data request is requested to be read;
  • the processor 41 is further configured to: when determining that the data block requested to be read belongs to the basic image, read the data block from the memory; and the transmitter 43 is configured to send the data block to the Cloning a virtual machine;
  • the processor 41 is further configured to: when the data block requested to be read belongs to an update image Reading the data block from the disk and writing the data block into the memory, reading the data block from the memory, and transmitting by the transmitter 43 to the Clone a virtual machine.
  • the driving circuit 4001 is configured to provide drivers for each hardware in the data control system so that each hardware can work normally.
  • the memory includes at least one or more of the following memory devices, a read only memory, a random access memory or a nonvolatile random access memory, the memory providing instructions and data to the processor.
  • the processor may be an integrated circuit chip with signal processing capability.
  • each step of the above method may be completed by an integrated logic circuit of hardware in the processor or an instruction in a form of software.
  • These instructions may be implemented and controlled by a processor therein for performing the methods disclosed in the embodiments of the present invention.
  • the processor may also be a general purpose processor, a digital signal processing (DSP), an application specific integrated circuit, a Field Programmable Gate Array (FPGA) or other programmable logic. Devices, discrete gates or transistor logic devices, discrete hardware components.
  • the above general purpose processor may be a microprocessor or the processor may be any conventional processor, decoder or the like.
  • the steps of the method disclosed in the embodiment of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • bus system 4000 which in addition to the data bus includes a power bus, a control bus, and a status signal bus.
  • bus system 4000 various buses are labeled as bus system 4000 in FIG.
  • the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, Reading the data block read by the request directly from memory.
  • the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art.
  • the embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory.
  • the read/write capability of the disk (the number of input/output (I/O) read/write per unit time) is usually It is fixed, thus limiting the number of cloned virtual machines running simultaneously.
  • the cloned virtual machine does not need to read and write the disk when reading the base image, and only reads and writes the disk when the update image is read, thereby reducing the number of reads and writes to the disk. In turn, it supports the operation of more cloned virtual machines.
  • the prior art also needs to manually set the size of the cache required for cloning the virtual machine.
  • the technical and experience of the technician is high.
  • the system provided by the embodiment of the present invention does not need to preset the cache required for the cloned virtual machine.
  • the size can further improve the practical range of the embodiments of the present invention.
  • the system provided by the embodiment of the present invention can also process the write data request from the cloned virtual machine. details as follows:
  • the receiver 42 is further configured to receive a write data request sent by the clone virtual machine, where the processor 41 is further configured to determine whether the data requested by the write data request constitutes a complete data block;
  • the processor 41 is further configured to write into the update image if it is determined that the data requested to be written by the write data request constitutes a complete data block;
  • the processor 41 is further configured to: if it is determined that the data requested to be written by the write data request does not constitute a complete data block, extract a data block corresponding to the data from the base image, and update the data to the In the data block, the updated data block is written into the update image. Further, the base image is compressed and stored in the memory 44. Among them, you can use the ZRAM tool to compress the base image and save it in the virtual device of the memory.
  • the processor 41 is specifically configured to: when determining that the data block requested to be read belongs to the basic image, reading and decompressing the data block from the virtual device in the memory; The decompressed data block is sent to the clone virtual machine.
  • the processor 41 is further configured to periodically scan each of the memory. a page; respectively, using the data in each page to perform a hash operation to obtain a hash value of each page; if the number of pages having the same hash value is greater than two, one page of the same hash value is retained, and the rest is deleted. Page.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer.
  • a hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The present invention provides a method and system for data controlling and relates to the technical field of computer. The method includes: receiving a request to read data sent by a cloned virtual machine; determining which mirror the data block requested by the data reading request belongs to; when the data block requested by the reading request belongs to a base mirror, reading the data block from the memory, and sending the data block to the cloned virtual machine; when the data block requested by the reading request belongs to an update mirror, reading the data block from a disk, and sending the data block to the memory, then reading the data block from the memory, and sending the data block to the cloned virtual machine.

Description

数据控制方法及系统 技术领域  Data control method and system
本发明涉及计算机技术领域, 尤其涉及一种数据控制方法及系 统。 背景技术  The present invention relates to the field of computer technologies, and in particular, to a data control method and system. Background technique
目前, 通过虚拟化技术可以将一台物理机 ( 即实体计算机) 的 物理资源虚拟成多个虚拟机, 每个虚拟机均可以实现该物理机的功 能。 虚拟机具有克隆功能, 利用一个虚拟机 (该虚拟机相当于源虚 拟机) 可以克隆出来一个或多个克隆虚拟机, 每个克隆虚拟机可以 具有与源虚拟机完全相同的操作系统、 应用软件以及数据文档, 克 隆虚拟机生成之后,还可以 自行增加新的数据或者更新已有的数据。  Currently, virtualization technology can virtualize the physical resources of one physical machine (that is, a physical computer) into multiple virtual machines, and each virtual machine can implement the functions of the physical machine. The virtual machine has a cloning function. One virtual machine (the virtual machine is equivalent to the source virtual machine) can clone one or more cloned virtual machines. Each cloned virtual machine can have the same operating system and application software as the source virtual machine. As well as data files, after the cloned virtual machine is generated, you can also add new data or update existing data.
现有技术提供一种链接克隆技术, 通过基础镜像和更新镜像来 实现克隆虚拟机的运行。 基础镜像为克隆虚拟机和源虚拟机共同的 数据部分, 更新镜像是克隆虚拟机与源虚拟机不同的数据部分。  The prior art provides a link cloning technology for implementing a clone virtual machine operation through a base image and an update image. The base image is the data portion common to the cloned virtual machine and the source virtual machine, and the update image is the data portion of the cloned virtual machine that is different from the source virtual machine.
然而, 现有的基础镜像和更新镜像是保存在磁盘上的, 当各个 克隆虚拟机运行时, 每个克隆虚拟机在将读取的基础镜像中的数据 写入内存时, 由于每个克隆虚拟机在内存中写入的基础镜像均相同, 导致内存资源的利用率不高。 发明内容  However, the existing base image and update image are saved on the disk. When each cloned virtual machine runs, each cloned virtual machine writes the data in the base image to be read into memory. The basic images written by the machine in the same memory are the same, resulting in low utilization of memory resources. Summary of the invention
本发明提供一种数据控制方法及系统, 可以提高内存资源的利 用率。  The invention provides a data control method and system, which can improve the utilization rate of memory resources.
为了达到上述发明目的, 本发明采用如下技术方案:  In order to achieve the above object, the present invention adopts the following technical solutions:
第一方面, 提供一种数据控制方法, 基础镜像保存在内存中, 更新镜像保存在磁盘中, 所述方法包括:  The first aspect provides a data control method, where the base image is saved in the memory, and the update image is saved in the disk, where the method includes:
接收克隆虚拟机发送的读数据请求; 确定所述读数据请求所请求读取的数据块所属镜像; Receiving a read data request sent by the clone virtual machine; Determining a mirror image of the data block requested to be read by the read data request;
当所述请求读取的数据块属于基础镜像时, 从所述内存中读取 所述数据块, 并将所述数据块发送给所述克隆虚拟机;  When the data block requested to be read belongs to the base image, the data block is read from the memory, and the data block is sent to the clone virtual machine;
当所述请求读取的数据块属于更新镜像时, 从所述磁盘中读取 所述数据块, 并将所述数据块写入所述内存中, 再从所述内存中读 取所述数据块, 并发送给所述克隆虚拟机。  Reading the data block from the disk when the data block requested to be read belongs to the update image, and writing the data block into the memory, and reading the data from the memory Block, and sent to the cloned virtual machine.
结合第一方面, 在第一方面的第一种实现方式中, 所述基础镜 像进行压缩后保存在所述内存的虚拟设备中,  With reference to the first aspect, in a first implementation manner of the first aspect, the basic image is compressed and saved in a virtual device in the memory,
所述当所述请求读取的数据块属于基础镜像时, 从所述内存中 读取所述数据块, 并将所述数据块发送给所述克隆虚拟机包括: 当 所述请求读取的数据块属于基础镜像时, 从所述内存的虚拟设备中 读取并解压缩所述数据块, 将解压缩后的数据块发送给所述克隆虚 拟机。  When the data block requested to be read belongs to the base image, reading the data block from the memory, and sending the data block to the clone virtual machine includes: when the request is read When the data block belongs to the base image, the data block is read and decompressed from the virtual device of the memory, and the decompressed data block is sent to the clone virtual machine.
结合第一方面或第一方面的第一种实现方式, 在第一方面的第 二种实现方式中, 还包括:  In conjunction with the first aspect or the first implementation of the first aspect, in a second implementation of the first aspect, the method further includes:
接收所述克隆虚拟机发送的写数据请求;  Receiving a write data request sent by the clone virtual machine;
判断所述写数据请求所请求写入的数据是否构成完整的数据块; 如果构成完整的数据块, 则写入所述更新镜像中, 如果没有构 成完整的数据块, 则从所述基础镜像中取出所述数据对应的数据块, 将所述数据更新至所述数据对应的数据块中, 并将更新后的数据块 写入所述更新镜像中。 结合第一方面或者第一方面的以上任一种实现方式, 在第一方 面的第三种实现方式中, 所述内存中的数据块保存在所述内存的各 个页面中,  Determining whether the data requested by the write data request constitutes a complete data block; if the complete data block is formed, writing to the update image, if not forming a complete data block, from the base image And extracting a data block corresponding to the data, updating the data into a data block corresponding to the data, and writing the updated data block into the update image. With reference to the first aspect, or any one of the foregoing implementation manners of the first aspect, in a third implementation manner of the first aspect, the data block in the memory is saved in each page of the memory,
所述方法还包括:  The method further includes:
定期扫描所述内存中的各个页面;  Regularly scanning each page in the memory;
分别利用各个页面中的数据进行哈希运算, 得到各个页面的哈 希值; 如果哈希值相同的页面大于两个, 则保留所述哈希值相同的页 面中的一个页面, 删除其余的页面。 The hash operation is performed by using the data in each page to obtain the hash value of each page; If the page with the same hash value is greater than two, one of the pages with the same hash value is retained, and the remaining pages are deleted.
第二方面, 提供一种数据控制系统, 基础镜像保存在内存中, 更新镜像保存在磁盘中, 所述系统包括:  In a second aspect, a data control system is provided. The base image is saved in the memory, and the update image is saved in the disk. The system includes:
接收模块, 用于接收克隆虚拟机发送的读数据请求;  a receiving module, configured to receive a read data request sent by the clone virtual machine;
控制模块, 用于确定所述读数据请求所请求读取的数据块所属 镜像;  a control module, configured to determine a mirror image to which the data block requested to be read by the read data request belongs;
读取模块, 用于当所述控制模块确定所述请求读取的数据块属 于基础镜像时, 从所述内存中读取所述数据块; 发送模块, 用于将 所述数据块发送给所述克隆虚拟机;  a reading module, configured to: when the control module determines that the data block requested to be read belongs to a basic image, read the data block from the memory; and send a module, configured to send the data block to the Cloning a virtual machine;
所述读取模块, 还用于当所述控制模块确定所述请求读取的数 据块属于更新镜像时, 从所述磁盘中读取所述数据块; 写入模块, 用于将所述数据块写入所述内存中; 所述读取模块, 还用于从所述 内存中读取所述数据块, 并由所述发送模块发送给所述克隆虚拟机。  The reading module is further configured to: when the control module determines that the data block requested to be read belongs to an update image, read the data block from the disk; and write a module, where the data is used to The block is written into the memory; the reading module is further configured to read the data block from the memory, and send the data block to the clone virtual machine by the sending module.
结合第二方面, 在第二方面的第一种实现方式中, 所述基础镜 像进行压缩后保存在所述内存的虚拟设备中,  With reference to the second aspect, in a first implementation manner of the second aspect, the basic image is compressed and saved in a virtual device in the memory,
所述读取模块, 具体用于当所述控制模块确定所述请求读取的 数据块属于基础镜像时, 从所述内存的虚拟设备中读取并解压缩所 述数据块;  The reading module is specifically configured to: when the control module determines that the data block requested to be read belongs to a basic image, read and decompress the data block from the virtual device in the memory;
所述发送模块, 具体用于将解压缩后的数据块发送给所述克隆 虚拟机。  The sending module is specifically configured to send the decompressed data block to the clone virtual machine.
结合第二方面或第二方面的第一种实现方式, 在第二方面的第 二种实现方式中,  In conjunction with the second aspect or the first implementation of the second aspect, in a second implementation of the second aspect,
所述接收模块,还用于接收所述克隆虚拟机发送的写数据请求; 所述控制模块, 还用于判断所述写数据请求所请求写入的数据 是否构成完整的数据块;  The receiving module is further configured to receive a write data request sent by the cloned virtual machine; the control module is further configured to determine whether the data requested by the write data request constitutes a complete data block;
所述写入模块, 还用于如果所述控制模块判断出所述写数据请 求所请求写入的数据构成完整的数据块, 则写入所述更新镜像中; 所述读取模块, 还用于如果所述控制模块判断出所述写数据请 求所请求写入的数据没有构成完整的数据块, 则从所述基础镜像中 取出所述数据对应的数据块, 将所述数据更新至所述数据对应的数 据块中, 所述写入模块, 还用于将更新后的数据块写入所述更新镜 像中。 The writing module is further configured to: if the control module determines that the data requested to be written by the write data request constitutes a complete data block, write the update image; the reading module further uses If the control module determines the write data, please If the data requested to be written does not constitute a complete data block, the data block corresponding to the data is taken out from the base image, and the data is updated into a data block corresponding to the data, the writing module Also used to write the updated data block to the update image.
结合第二方面或者第二方面的以上任一种实现方式, 在第二方 面的第三种实现方式中, 所述内存中的数据块保存在所述内存的各 个页面中,  With the second aspect or the foregoing implementation manner of the second aspect, in a third implementation manner of the second aspect, the data block in the memory is saved in each page of the memory,
所述系统还包括:  The system also includes:
扫描模块, 用于定期扫描所述内存中的各个页面;  a scanning module, configured to periodically scan each page in the memory;
运算模块, 用于分别利用各个页面中的数据进行哈希运算, 得 到各个页面的哈希值;  An operation module, configured to perform hash operation by using data in each page, respectively, to obtain a hash value of each page;
处理模块, 用于如果哈希值相同的页面大于两个, 则保留所述 哈希值相同的页面中的一个页面, 删除其余的页面。  The processing module is configured to reserve one of the pages with the same hash value and delete the remaining pages if the pages with the same hash value are greater than two.
第三方面, 提供一种数据控制系统, 基础镜像保存在内存中, 更新镜像保存在磁盘中, 所述系统包括:  In a third aspect, a data control system is provided. The base image is saved in the memory, and the update image is saved in the disk. The system includes:
接收器, 用于接收克隆虚拟机发送的读数据请求;  a receiver, configured to receive a read data request sent by the clone virtual machine;
处理器, 用于确定所述读数据请求所请求读取的数据块所属镜 像;  a processor, configured to determine a mirror image of the data block requested to be read by the read data request;
所述处理器, 还用于当确定所述请求读取的数据块属于基础镜 像时, 从所述内存中读取所述数据块; 发射器, 用于将所述数据块 发送给所述克隆虚拟机;  The processor is further configured to: when determining that the data block requested to be read belongs to a base image, read the data block from the memory; and send, by the transmitter, the data block to the clone virtual machine;
所述处理器,还用于当所述请求读取的数据块属于更新镜像时, 从所述磁盘中读取所述数据块, 并将所述数据块写入所述内存中, 从所述内存中读取所述数据块, 并由所述发射器发送给所述克隆虚 拟机。  The processor is further configured to: when the data block requested to be read belongs to an update image, read the data block from the disk, and write the data block into the memory, from the The data block is read in memory and sent by the transmitter to the cloned virtual machine.
结合第三方面, 在第三方面的第一种实现方式中, 所述基础镜 像进行压缩后保存在所述内存的虚拟设备中,  With reference to the third aspect, in a first implementation manner of the third aspect, the basic image is compressed and saved in a virtual device in the memory,
所述处理器, 具体用于当确定所述请求读取的数据块属于基础 镜像时, 从所述内存的虚拟设备中读取并解压缩所述数据块; 所述发射器, 具体用于将解压缩后的数据块发送给所述克隆虚 拟机。 The processor is specifically configured to: when determining that the data block requested to be read belongs to the basic image, reading and decompressing the data block from the virtual device of the memory; The transmitter is specifically configured to send the decompressed data block to the clone virtual machine.
结合第三方面或第三方面的第一种实现方式, 在第三方面的第 二种实现方式中,  In conjunction with the third aspect or the first implementation of the third aspect, in a second implementation of the third aspect,
所述接收器, 还用于接收所述克隆虚拟机发送的写数据请求; 所述处理器, 还用于判断所述写数据请求所请求写入的数据是 否构成完整的数据块;  The receiver is further configured to receive a write data request sent by the clone virtual machine; the processor is further configured to determine whether the data requested by the write data request is a complete data block;
所述处理器, 还用于如果判断出所述写数据请求所请求写入的 数据构成完整的数据块, 则写入所述更新镜像中;  The processor is further configured to write into the update image if it is determined that the data requested to be written by the write data request constitutes a complete data block;
所述处理器, 还用于如果判断出所述写数据请求所请求写入的 数据没有构成完整的数据块, 从基础镜像中取出所述数据对应的数 据块, 将所述数据更新至所述数据对应的数据块中, 将更新后的数 据块写入所述更新镜像中。  The processor is further configured to: if it is determined that the data requested to be written by the write data request does not constitute a complete data block, extract a data block corresponding to the data from the base image, and update the data to the In the data block corresponding to the data, the updated data block is written into the update image.
结合第三方面或者第三方面的以上任一种实现方式, 在第三方 面的第三种实现方式中, 所述内存中的数据块保存在所述内存的页 面中,  With reference to the third aspect, or any one of the foregoing implementation manners of the third aspect, in a third implementation manner of the third aspect, the data block in the memory is saved in a page of the memory,
所述处理器, 还用于定期扫描所述内存中的各个页面; 分别利 用各个页面中的数据进行哈希运算, 得到各个页面的哈希值; 如果 哈希值相同的页面大于两个, 则保留所述哈希值相同的页面中的一 个页面, 删除其余的页面。  The processor is further configured to periodically scan each page in the memory; respectively perform hash operation by using data in each page to obtain a hash value of each page; if the page with the same hash value is greater than two, Keep one of the pages with the same hash value and delete the remaining pages.
本发明实施例中, 由于各个克隆虚拟机共用的基础镜像存放在 内存中, 因而, 克隆虚拟机请求读取的数据块属于基础镜像时, 可 以直接从内存中读取所述请求读取的数据块。 本发明实施例中由于 各个克隆虚拟机共用的基础镜像存放在内存中, 亦即内存中保存了 一份基础镜像, 与现有现有技术中每个克隆虚拟机均需要在内存中 占用一定空间来写入相同的基础镜像, 导致内存保存了多份相同的 基础镜像相比, 本发明实施例可以提高内存资源的利用率。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下 面将对实施例或现有技术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 根据这些附图获得其他的附图。 In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, the data read by the request may be directly read from the memory. Piece. In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art. The embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory. DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description It is merely some embodiments of the present invention, and those skilled in the art can obtain other drawings according to the drawings without any creative work.
图 1 为本发明实施例提供的克隆虚拟机读写数据流程的一种示 意图;  FIG. 1 is a schematic diagram of a flow of reading and writing data of a cloned virtual machine according to an embodiment of the present invention;
图 2a为本发明实施例提供的数据控制方法的第一种流程图; 图 2b为本发明实施例提供的数据控制方法的第二种流程图; 图 2c为本发明实施例提供的页面共享示意图;  2a is a first flowchart of a data control method according to an embodiment of the present invention; FIG. 2b is a second flowchart of a data control method according to an embodiment of the present invention; ;
图 3a为本发明实施例提供的数据控制系统的第一种结构图; 图 3b为本发明实施例提供的数据控制系统的第二种结构图; 图 4为本发明实施例提供的数据控制系统的第三种结构图。 具体实施方式  Figure 3a is a first structural diagram of a data control system according to an embodiment of the present invention; Figure 3b is a second structural diagram of a data control system according to an embodiment of the present invention; Figure 4 is a data control system according to an embodiment of the present invention; The third structural diagram. detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明 一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本 领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他 实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供一种数据控制方法, 应用于克隆虚拟机从基 础镜像和更新镜像中读写数据时。 其中, 所述克隆虚拟机是利用源 虚拟机进行克隆得出的, 基础镜像为所述克隆虚拟机和源虚拟机相 同的数据部分, 更新镜像为所述克隆虚拟机和源虚拟机不同的数据 部分。  Embodiments of the present invention provide a data control method, which is applied to a clone virtual machine when reading and writing data from a base image and an update image. The clone virtual machine is obtained by using a source virtual machine for cloning, and the base image is the same data part of the clone virtual machine and the source virtual machine, and the update image is different data of the clone virtual machine and the source virtual machine. section.
如图 1 所示的克隆虚拟机读写数据流程的示意图, 所述基础镜 像保存在内存中, 所述更新镜像保存在磁盘中。  The schematic diagram of the process of reading and writing data of the cloned virtual machine shown in FIG. 1 is saved in the memory, and the updated image is saved in the disk.
其中, 内存与磁盘的区别如下:  Among them, the difference between memory and disk is as follows:
内存 ( memory ) 为一种利用半导体技术做成的电子设备, 用来 存储数据。 内存的容量通常比较小 (例如, 16M、 1 G 等), 但是读 取速度比较快。 内存在加电时, 可以保存数据, 但在断电后, 所保 存的数据将被清除, 因而也被称为一种高速临时存储信息的硬件。 Memory An electronic device made up of semiconductor technology used to store data. The memory capacity is usually small (for example, 16M, 1 G, etc.), but read The speed is faster. When the memory is powered up, the data can be saved, but after the power is turned off, the saved data will be cleared, so it is also called a high-speed temporary storage of information hardware.
磁盘可以包括硬盘 ( Hard Disk ) , 为一种采用磁性材料制作的 电子设备, 通过在平整的磁性表面存储和检索数据。 信息通过离磁 性表面很近的写头, 由电磁流来改变极性方式被电磁流写到磁盘上, 信息可以通过相反的方式回读。磁盘的容量通常比较大(例如 40G , 100G 等), 但是读取速度比较慢。 磁盘是一种非易失性存储设备, 在断电时, 所保存的数据也不会丟失, 因而也被称为一种低速长期 存储信息的硬件。  A disk can include a hard disk, an electronic device made of magnetic material that stores and retrieves data on a flat magnetic surface. The information is written by the electromagnetic flow to the disk by the write head that is close to the magnetic surface, and the polarity is changed by the electromagnetic flow. The information can be read back in the opposite way. The capacity of a disk is usually large (for example, 40G, 100G, etc.), but the reading speed is slow. A disk is a kind of non-volatile storage device. When the power is turned off, the saved data is not lost. Therefore, it is also called a low-speed hardware that stores information for a long time.
所述基础镜像中保存的数据包括: 从源虚拟机克隆得到的操作 系统、 应用程序及数据文档, 所述更新镜像中保存的数据包括: 克 隆虚拟机自行增加的新数据或者将基础镜像中的数据进行更新后得 出的数据。 各个克隆虚拟机均有各自的更新镜像, 但是会共用同一 个基础镜像。 当各个克隆虚拟机在启动运行时, 均需要从基础镜像 中读取数据, 并根据各自的需求, 对各自的更新镜像进行数据的读 写操作。  The data saved in the base image includes: an operating system, an application, and a data file cloned from the source virtual machine, where the data saved in the update image includes: a new data added by the clone virtual machine or a base image The data obtained after the data is updated. Each cloned virtual machine has its own update image, but shares the same base image. When each cloned virtual machine starts up, it needs to read data from the base image and read and write data to the respective update image according to their respective requirements.
下面, 以一个克隆虚拟机为例, 详细介绍一种数据控制方法, 本方法的执行主体是一种数据控制系统, 可以对来自克隆虚拟机的 读写数据请求进行处理。  In the following, a clone virtual machine is taken as an example to describe a data control method. The execution body of the method is a data control system, which can process read and write data requests from the cloned virtual machine.
如图 2a所示, 所述方法包括:  As shown in FIG. 2a, the method includes:
201、 接收克隆虚拟机发送的读数据请求。  201. Receive a read data request sent by the clone virtual machine.
202、 确定所述读数据请求所请求读取的数据块所属镜像。  202. Determine, by the read data request, a mirror to which the data block requested to be read belongs.
其中, 所述数据块为进行数据读写操作的最小单位, 通常, 一 个数据块包括 512字节。  The data block is a minimum unit for performing data read and write operations. Generally, one data block includes 512 bytes.
其中, 可以根据所述请求读取的数据块是否被修改来确定该请 求读取的数据块是属于基础镜像还是更新镜像。  The data block read by the request may be modified to determine whether the data block read by the request belongs to a basic image or an updated image.
由于基础镜像中数据块是各个克隆虚拟机共用的, 通常不会被 修改, 因而, 在将基础镜像保存在内存中时, 数据控制系统可以将 基础镜像中各个数据块的修改标记设置为未修改。 而更新镜像中保存的数据块为克隆虚拟机自行增加的新数据块 或者将基础镜像中的数据块进行更新后得出的数据块, 克隆虚拟机 在将这些数据块写入更新镜像时, 数据控制系统可以将这些数据块 的修改标记设置为已修改。 Since the data block in the base image is shared by each clone virtual machine, it is usually not modified. Therefore, when the base image is saved in the memory, the data control system can set the modification flag of each data block in the base image to be unmodified. . The data block saved in the update image is a new data block added by the clone virtual machine or a data block obtained by updating the data block in the base image, and the cloned virtual machine writes the data block to the update image when the data is written. The control system can set the modification flags for these data blocks to have been modified.
需要说明的是, 本文中, 数据块的修改标记所表示的未修改和 已修改是相对的概念, 主要为了区分数据块是属于基础镜像还是更 新镜像, 亦即标记为未修改的数据块属于基础镜像, 而标记为已修 改的数据块属于更新镜像。  It should be noted that, in this paper, the unmodified and modified representation of the modified mark of the data block is a relative concept, mainly to distinguish whether the data block belongs to the basic image or the updated image, that is, the data block marked as unmodified belongs to the basic Mirrored, and the data block marked as modified belongs to the update image.
203、 当所述请求读取的数据块属于基础镜像时, 从所述内存中 读取所述数据块, 并将所述数据块发送给所述克隆虚拟机。  203. When the data block requested to be read belongs to a base image, read the data block from the memory, and send the data block to the clone virtual machine.
204、 当所述请求读取的数据块属于更新镜像时, 从所述磁盘中 读取所述数据块, 并将所述数据块写入所述内存中, 再从所述内存 中读取所述数据块, 并发送给所述克隆虚拟机。  204. When the data block requested to be read belongs to an update image, read the data block from the disk, write the data block into the memory, and read the memory from the memory. The data block is described and sent to the clone virtual machine.
本发明实施例中, 由于各个克隆虚拟机共用的基础镜像存放在 内存中, 因而, 克隆虚拟机请求读取的数据块属于基础镜像时, 可 以直接从内存中读取所述请求读取的数据块。 本发明实施例中由于 各个克隆虚拟机共用的基础镜像存放在内存中, 亦即内存中保存了 一份基础镜像, 与现有现有技术中每个克隆虚拟机均需要在内存中 占用一定空间来写入相同的基础镜像, 导致内存保存了多份相同的 基础镜像相比, 本发明实施例可以提高内存资源的利用率。  In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, the data read by the request may be directly read from the memory. Piece. In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art. The embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory.
另外, 现有技术中, 由于每个克隆虚拟机都需要从磁盘上读取 一次基础镜像中的数据, 而磁盘的读写能力 (单位时间读写的输入 / 输出 ( I/O ) 次数) 通常是固定的, 因而限制了同时运行的克隆虚拟 机的数量。 而本发明实施例中的克隆虚拟机在读取基础镜像时无需 对磁盘进行读写操作, 只有在读取更新镜像时对磁盘进行读写操作, 因而, 可以减少对磁盘的读写次数, 进而支持更多克隆虚拟机的运 行。  In addition, in the prior art, since each cloned virtual machine needs to read the data in the base image from the disk, the read/write capability of the disk (the number of input/output (I/O) read/write per unit time) is usually It is fixed, thus limiting the number of cloned virtual machines running simultaneously. The cloning virtual machine in the embodiment of the present invention does not need to read and write the disk when reading the basic image, and only reads and writes the disk when the updated image is read, thereby reducing the number of reading and writing to the disk, and further Support for more cloned virtual machine operations.
此外, 采用现有技术还需要人工预先设置克隆虚拟机所需緩存 的大小, 对技术人员的技术和经验要求较高, 采用本发明实施例提 供的方法不需要预先设置克隆虚拟机所需緩存的大小, 可以进一步 提高本发明实施例的实用范围。 In addition, the prior art also needs to manually set the size of the cache required for cloning a virtual machine, which requires high technical and experience of the technician, and adopts an embodiment of the present invention. The method for providing does not need to preset the size of the buffer required for cloning the virtual machine, and can further improve the practical scope of the embodiment of the present invention.
本发明实施例提供的方法, 还可以对来自克隆虚拟机的写数据 请求进行处理。 具体如下:  The method provided by the embodiment of the present invention can also process the write data request from the clone virtual machine. details as follows:
接收所述克隆虚拟机发送的写数据请求; 判断所述写数据请求 所请求写入的数据是否构成完整的数据块。 如果构成完整的数据块, 则写入所述更新镜像中; 如果没有构成完整的数据块, 则从所述基 础镜像中取出所述数据对应的数据块, 将所述数据更新至所述数据 对应的数据块中, 并将更新后的数据块写入所述更新镜像中。  Receiving a write data request sent by the clone virtual machine; determining whether the data requested by the write data request constitutes a complete data block. If the complete data block is formed, it is written into the update image; if the complete data block is not formed, the data block corresponding to the data is taken out from the base image, and the data is updated to the data corresponding In the data block, the updated data block is written into the update image.
由于数据块为进行读写数据操作时的最小单位, 而克隆虚拟机 每次写入的数据不一定构成完整的数据块, 例如, 克隆虚拟机需要 写入的数据是对某个数据块中的部分字节进行更新的, 因而, 再将 这部分字节写入更新镜像时, 需要先从基础镜像中将所述部分字节 对应的数据块读出, 并所述部分字节更新至所述数据块中的相应字 节的位置处, 例如, 克隆虚拟机需要写入 20 个字节, 并使用该 20 个字节对某个数据块的第 100- 120 字节进行更新, 则从基础镜像中 将该数据块读出后, 将所述数据块的第 100- 120字节更新为所述 20 个字节, 并将更新后的数据块写入所述更新镜像中, 具体地需要写 入所述克隆虚拟机的更新镜像中。  Since the data block is the smallest unit for reading and writing data operations, the data written by the cloned virtual machine does not necessarily constitute a complete data block. For example, the data that the cloned virtual machine needs to write is in a certain data block. Part of the byte is updated. Therefore, when the part of the byte is written to the update image, the data block corresponding to the partial byte needs to be read from the base image, and the partial byte is updated to the At the location of the corresponding byte in the data block, for example, the clone virtual machine needs to write 20 bytes and use the 20 bytes to update the 100-120 bytes of a data block, then from the base image After reading the data block, updating the 100-120 bytes of the data block to the 20 bytes, and writing the updated data block into the update image, specifically requiring writing The cloned virtual machine is in the update image.
进一步地, 本发明实施例提供的方法中, 所述基础镜像可以进 行压缩后保存在所述内存的虚拟设备中, 以便于节省内存资源。  Further, in the method provided by the embodiment of the present invention, the basic image may be compressed and saved in the virtual device of the memory, so as to save memory resources.
所述步骤 203 中, 当所述请求读取的数据块属于基础镜像时, 从所述内存中读取所述数据块, 并将所述数据块发送给所述克隆虚 拟机具体替换为如下步骤执行: 当所述请求读取的数据块属于基础 镜像时, 从所述内存的虚拟设备中读取并解压缩所述数据块, 将解 压缩后的数据块发送给所述克隆虚拟机。  In the step 203, when the data block requested to be read belongs to the basic image, the data block is read from the memory, and the data block is sent to the clone virtual machine, and the following steps are specifically replaced. Execution: When the data block read by the request belongs to the basic image, the data block is read and decompressed from the virtual device of the memory, and the decompressed data block is sent to the clone virtual machine.
其中, 可以使用 ZRAM工具将基础镜像压缩后保存在内存的虚 拟设备中。 该 ZRAM工具可以在内存中创建一个虚拟设备, 该虚拟 设备的格式可以采用 ext4、 ext2或者 XFS等。 在将基础镜像保存在 该虚拟设备中时, 所述 ZRAM工具将自动采用压缩算法对基础镜像 进行压缩后, 保存在该虚拟设备中。 所采用的压缩算法例如 LZO算 法。 在从该虚拟设备读取基础镜像时, 所述 ZRAM工具也将自动采 用同样的压缩算法对基础镜像进行解压缩, 并将解压缩后的数据读 取出来。 Among them, you can use the ZRAM tool to compress the base image and save it in the virtual device of the memory. The ZRAM tool can create a virtual device in memory. The format of the virtual device can be ext4, ext2 or XFS. Save the base image in In the virtual device, the ZRAM tool will automatically compress the base image by using a compression algorithm and save it in the virtual device. The compression algorithm employed is for example the LZO algorithm. When the base image is read from the virtual device, the ZRAM tool will automatically decompress the base image using the same compression algorithm and read the decompressed data.
需要说明的是,所述基础镜像是保存在内存的一个虚拟设备中, 由于内存在断电时会清除所保存的所有数据, 因而, 当内存重新上 电时, 需要重新采用 ZRAM工具将基础镜像保存在内存的一个虚拟 设备中。  It should be noted that the base image is stored in a virtual device in the memory, and all the saved data is cleared when the memory is powered off. Therefore, when the memory is powered on again, the ZRAM tool needs to be used again to perform the base image. Saved in a virtual device in memory.
可以理解的是, 在采用 ZRAM工具将基础镜像保存在内存的一 个虚拟设备中之后, 如果内存没有断电, 各个虚拟机的启动和关闭 不会影响到内存中所保存的基础镜像。 当内存断电后, 重新上电时 需要采用 ZRAM工具将基础镜像保存在内存的一个虚拟设备中。  Understandably, after the ZRAM tool is used to save the base image in a virtual device in the memory, if the memory is not powered off, the startup and shutdown of each virtual machine will not affect the base image saved in the memory. When the memory is powered off, you need to use the ZRAM tool to save the base image in a virtual device in memory when the power is turned back on.
进一步地,所述内存中的数据块保存在所述内存的各个页面中, 亦即, 无论预先保存在内存中的基础镜像中的数据块, 还是将从磁 盘中读取出来的更新镜像中的数据块写入内存中时, 在内存中均采 用内存的页面进行保存。  Further, the data block in the memory is stored in each page of the memory, that is, in the data block in the base image stored in advance in the memory, or in the update image read from the disk. When a data block is written to the internal memory, the memory is used to save the page in memory.
其中, 内存管理单元是以页面的形式, 分割内存的虚拟地址空 间。 内存的页面的大小可以是 2的 n次方。  The memory management unit divides the virtual address space of the memory in the form of a page. The size of the page in memory can be 2 to the power of n.
由于克隆虚拟机的更新镜像中的数据和基础镜像中的数据有可 能存在相同的情况, 例如, 克隆虚拟机的基础镜像中某个应用程序 和更新镜像中的某个应用程序使用相同的链接库, 因而, 在内存中 保存有该链接库的页面将会出现重复; 或者, 由于各个克隆虚拟机 各自的更新镜像中的数据也可能存在相同的情况, 在将从各个克隆 虚拟机各自更新镜像中的数据写入内存中时, 也会导致多个页面保 存有相同数据的问题。  Since the data in the update image of the cloned virtual machine and the data in the base image may be the same, for example, an application in the base image of the cloned virtual machine and an application in the update image use the same link library. Therefore, the page in which the link library is stored in the memory will be duplicated; or, since the data in the updated image of each cloned virtual machine may also have the same situation, the image will be updated in each of the cloned virtual machines. When data is written to memory, it also causes problems with multiple pages holding the same data.
为了进一步提高内存资源的利用率, 有效节省内存资源, 如图 2b所示, 所述方法还包括如下步骤:  To further improve the utilization of memory resources, and effectively save memory resources, as shown in FIG. 2b, the method further includes the following steps:
205、 定期扫描所述内存中的各个页面; 206、 分别利用各个页面中的数据进行哈希运算, 得到各个页面 的哈希值; 205. Regularly scan each page in the memory; 206, respectively, using the data in each page to perform a hash operation, and obtaining a hash value of each page;
207、 如果哈希值相同的页面大于两个, 则保留所述哈希值相同 的页面中的一个页面, 删除其余的页面。  207. If the pages with the same hash value are greater than two, one page of the page with the same hash value is reserved, and the remaining pages are deleted.
需要说明的是, 所述数据控制系统记录有各个页面的调用端, 该调用端为需要调用页面中数据的应用程序等, 当数据控制系统接 收到虚拟机发送的删除某个页面中数据的请求时, 例如, 克隆虚拟 机中使用某个页面的应用程序退出时, 需要从内存删除该页面, 此 时会向所述数据控制系统发送删除某个页面中数据的请求, 所述数 据控制系统判断该页面是否还存在其他调用端, 如果存在, 则不执 行删除该页面的操作, 否则, 从内存中删除该页面。  It should be noted that, the data control system records the calling end of each page, and the calling end is an application that needs to invoke data in the page, etc., when the data control system receives the request sent by the virtual machine to delete data in a certain page. For example, when an application that uses a certain page in a cloned virtual machine exits, the page needs to be deleted from the memory, and a request to delete data in a certain page is sent to the data control system, and the data control system determines Whether there are other callers on the page. If it exists, the operation of deleting the page is not performed. Otherwise, the page is deleted from the memory.
如图 2c 所示的页面共享示意图, 基础镜像、 克隆虚拟机 VM1 的更新镜像和克隆虚拟机 VM2的更新镜像中存在相同的数据块(斜 线部分表示相同的数据块), 在内存中仅保留了 1份存储有所述相同 数据块的页面, 克隆虚拟机 VM 1 的更新镜像、 克隆虚拟机 VM2 的 更新镜像和基础镜像均通过页面指针指向所述 1 份页面。 当克隆虚 拟机需要使用 自身更新镜像中的数据块时, 通过该页面指针可以确 定所需数据块存放的页面。 通过页面共享, 本发明实施例可以进一 步提高内存资源的利用率。  As shown in Figure 2c, the page share diagram, the base image, the update image of the clone VM VM1, and the update mirror of the clone VM VM2 have the same data block (the slashes represent the same data block), and are only retained in memory. For each page in which the same data block is stored, the update image of the clone virtual machine VM1, the update image of the clone virtual machine VM2, and the base image all point to the one page through the page pointer. When the cloned virtual machine needs to update the data block in the image by itself, the page pointer can be used to determine the page where the required data block is stored. Through page sharing, the embodiment of the present invention can further improve the utilization of memory resources.
本发明实施例还提供一种数据控制系统, 基础镜像保存在内存 中, 更新镜像保存在磁盘中, 所述基础镜像和更新镜像可参见图 1 所示虚拟机读写数据流程的相关描述。  The embodiment of the present invention further provides a data control system. The base image is saved in the memory, and the update image is saved in the disk. For the basic image and the update image, refer to the description of the virtual machine read/write data flow shown in FIG.
如图 3a所示, 所述系统包括:  As shown in Figure 3a, the system includes:
接收模块 31 , 用于接收克隆虚拟机发送的读数据请求; 控制模块 32 , 用于确定所述读数据请求所请求读取的数据块所 属镜像; 其中, 所述数据块为进行数据读写操作的最小单位, 通常, 一个数据块包括 512字节。  The receiving module 31 is configured to receive a read data request sent by the clone virtual machine, where the control module 32 is configured to determine a mirror image of the data block requested by the read data request, where the data block is for reading and writing data. The smallest unit, usually, a block of data consists of 512 bytes.
所述控制模块可以根据所述请求读取的数据块是否被修改来确 定该请求读取的数据块是属于基础镜像还是更新镜像。 具体可以参 见上述方法实施例中步骤 202 中的相关描述。 The control module may determine whether the data block read by the request belongs to a base image or an update image according to whether the data block read by the request is modified. Specific can be See the related description in step 202 of the above method embodiment.
读取模块 33 , 用于当所述控制模块确定所述请求读取的数据块 属于所述基础镜像时,从所述内存中读取所述数据块;发送模块 34 , 用于将所述数据块发送给所述克隆虚拟机;  a reading module 33, configured to: when the control module determines that the data block requested to be read belongs to the basic image, read the data block from the memory; and send a module 34, configured to: a block is sent to the clone virtual machine;
所述读取模块 33 , 还用于当所述控制模块确定所述请求读取的 数据块属于所述更新镜像时, 从所述磁盘中读取所述数据块; 写入 模块 35 , 用于将所述数据块写入所述内存中; 所述读取模块 33 , 还 用于从所述内存中读取所述数据块, 并由所述发送模块发送给所述 克隆虚拟机。  The reading module 33 is further configured to: when the control module determines that the data block requested to be read belongs to the update image, read the data block from the disk; and write a module 35, configured to: Writing the data block into the memory; the reading module 33 is further configured to read the data block from the memory, and send the data block to the clone virtual machine by the sending module.
本发明实施例中, 由于各个克隆虚拟机共用的基础镜像存放在 内存中, 因而, 克隆虚拟机请求读取的数据块属于基础镜像时, 可 以直接从内存中读取所述请求读取的数据块。 本发明实施例中由于 各个克隆虚拟机共用的基础镜像存放在内存中, 亦即内存中保存了 一份基础镜像, 与现有现有技术中每个克隆虚拟机均需要在内存中 占用一定空间来写入相同的基础镜像, 导致内存保存了多份相同的 基础镜像相比, 本发明实施例可以提高内存资源的利用率。  In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, the data read by the request may be directly read from the memory. Piece. In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art. The embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory.
另外, 现有技术中, 由于每个克隆虚拟机都需要从磁盘上读取 一次基础镜像中的数据, 而磁盘的读写能力 (单位时间读写的输入 / 输出 ( I/O ) 次数) 通常是固定的, 因而限制了同时运行的克隆虚拟 机的数量。 而本发明实施例提供的系统中, 克隆虚拟机在读取基础 镜像时无需对磁盘进行读写操作, 只有在读取更新镜像时对磁盘进 行读写操作, 因而, 可以减少对磁盘的读写次数, 进而支持更多克 隆虚拟机的运行。  In addition, in the prior art, since each cloned virtual machine needs to read the data in the base image from the disk, the read/write capability of the disk (the number of input/output (I/O) read/write per unit time) is usually It is fixed, thus limiting the number of cloned virtual machines running simultaneously. In the system provided by the embodiment of the present invention, the cloned virtual machine does not need to read and write the disk when reading the base image, and only reads and writes the disk when the update image is read, thereby reducing read and write of the disk. The number of times, which in turn supports the operation of more cloned virtual machines.
此外, 采用现有技术还需要人工预先设置克隆虚拟机所需緩存 的大小, 对技术人员的技术和经验要求较高, 采用本发明实施例提 供的系统不需要预先设置克隆虚拟机所需緩存的大小, 可以进一步 提高本发明实施例的实用范围。 进一步地, 当所述系统还可以对来自克隆虚拟机的写数据请求 进行处理, 具体为: In addition, the prior art also needs to manually set the size of the cache required for cloning the virtual machine. The technical and experience of the technician is high. The system provided by the embodiment of the present invention does not need to preset the cache required for the cloned virtual machine. The size can further improve the practical range of the embodiments of the present invention. Further, when the system can also request write data from the cloned virtual machine Processing, specifically:
所述接收模块 31 , 还用于接收所述克隆虚拟机发送的写数据请 求;  The receiving module 31 is further configured to receive a write data request sent by the cloned virtual machine.
所述控制模块 32 , 还用于判断所述写数据请求所请求写入的数 据是否构成完整的数据块;  The control module 32 is further configured to determine whether the data requested by the write data request forms a complete data block;
所述写入模块 35 , 还用于如果所述控制模块判断出所述写数据 请求所请求写入的数据构成完整的数据块, 则写入所述更新镜像中; 所述读取模块 33 , 还用于如果所述控制模块判断出所述写数据 请求所请求写入的数据没有构成完整的数据块, 则从所述基础镜像 中取出所述数据对应的数据块, 将所述数据更新至所述数据对应的 数据块中, 所述写入模块 35 , 还用于将更新后的数据块写入所述更 新镜像中。  The writing module 35 is further configured to: if the control module determines that the data requested to be written by the write data request constitutes a complete data block, write the update image; the reading module 33, And if the control module determines that the data requested to be written by the write data request does not constitute a complete data block, extracting a data block corresponding to the data from the base image, and updating the data to In the data block corresponding to the data, the writing module 35 is further configured to write the updated data block into the update image.
由于数据块为进行读写数据操作时的最小单位, 而克隆虚拟机 每次写入的数据不一定构成完整的数据块, 例如, 克隆虚拟机需要 写入的数据是对某个数据块中的部分字节进行更新的, 因而, 再将 这部分字节写入更新镜像时, 需要先从基础镜像中将所述部分字节 对应的数据块读出, 并所述部分字节更新至所述数据块中的相应字 节的位置处, 例如, 克隆虚拟机需要写入 20 个字节, 并使用该 20 个字节对某个数据块的第 100- 120 字节进行更新, 则将该数据块读 出后, 则将所述数据块的第 100- 120字节更新为所述 20个字节, 并 将更新后的数据块写入所述更新镜像中, 具体地写入所述克隆虚拟 机的更新镜像中。  Since the data block is the smallest unit for reading and writing data operations, the data written by the cloned virtual machine does not necessarily constitute a complete data block. For example, the data that the cloned virtual machine needs to write is in a certain data block. Part of the byte is updated. Therefore, when the part of the byte is written to the update image, the data block corresponding to the partial byte needs to be read from the base image, and the partial byte is updated to the At the location of the corresponding byte in the data block, for example, the clone virtual machine needs to write 20 bytes and use the 20 bytes to update the 100-120 bytes of a data block, then the data is After the block is read, the 100-120 bytes of the data block are updated to the 20 bytes, and the updated data block is written into the update image, specifically written into the clone virtual The machine is updated in the image.
进一步地,所述基础镜像进行压缩后保存在所述内存中,其中, 可以使用 ZRAM工具将基础镜像压缩后保存在内存的虚拟设备中。  Further, the base image is compressed and stored in the memory, wherein the base image can be compressed and saved in a virtual device in the memory by using a ZRAM tool.
所述读取模块 33 , 具体用于当所述控制模块确定所述请求读取 的数据块属于基础镜像时, 从所述内存的虚拟设备中读取并解压缩 所述数据块;  The reading module 33 is specifically configured to: when the control module determines that the data block requested to be read belongs to the basic image, read and decompress the data block from the virtual device in the memory;
所述发送模块 34 , 具体用于将解压缩后的数据块发送给所述克 隆虚拟机。 进一步地,所述内存中的数据块保存在所述内存的各个页面中, 为了进一步提高内存资源的利用率, 有效节省内存资源, 如图The sending module 34 is specifically configured to send the decompressed data block to the clone virtual machine. Further, the data blocks in the memory are saved in each page of the memory, so as to further improve the utilization of memory resources, effectively saving memory resources, as shown in the figure.
3b所示, 所述系统还包括: As shown in 3b, the system further includes:
扫描模块 36 , 用于定期扫描所述内存中的各个页面;  The scanning module 36 is configured to periodically scan each page in the memory;
运算模块 37 , 用于分别利用各个页面中的数据进行哈希运算, 得到各个页面的哈希值;  The operation module 37 is configured to perform hash operation by using data in each page to obtain a hash value of each page;
处理模块 38 , 用于如果哈希值相同的页面大于两个, 则保留所 述哈希值相同的页面中的一个页面, 删除其余的页面。  The processing module 38 is configured to reserve one page of the page with the same hash value if the number of pages with the same hash value is greater than two, and delete the remaining pages.
需要说明的是, 所述数据控制系统还可以记录有各个页面的调 用端, 该调用端为需要调用页面中数据的应用程序等, 当数据控制 系统接收到虚拟机发送的删除某个页面中数据的请求时, 例如, 克 隆虚拟机中使用某个页面的应用程序退出时, 需要从内存删除该页 面, 此时会向所述数据控制系统发送删除某个页面中数据的请求, 所述数据控制系统判断该页面是否还存在其他调用端, 如果存在, 则不执行删除该页面的操作, 否则, 从内存中删除该页面。  It should be noted that the data control system may also record the calling end of each page, where the calling end is an application that needs to invoke data in the page, etc., when the data control system receives the data sent by the virtual machine and deletes a certain page. When requesting, for example, when an application that uses a page in a cloned virtual machine exits, the page needs to be deleted from the memory, and a request to delete data in a page is sent to the data control system, the data control The system determines whether there are other callers on the page. If it exists, the operation of deleting the page is not performed. Otherwise, the page is deleted from the memory.
图 3b所示的系统还可以参见图 2b和图 2c所述方法中的相关描 述。  The system shown in Figure 3b can also be referred to the relevant description in the method described in Figures 2b and 2c.
本发明实施例还提供一种数据控制系统, 其中, 基础镜像保存 在内存中, 更新镜像保存在磁盘中, 所述基础镜像和更新镜像可参 见图 1所示虚拟机读写数据流程的相关描述。  The embodiment of the present invention further provides a data control system, wherein the base image is saved in the memory, and the update image is saved in the disk. For the basic image and the update image, refer to the description of the virtual machine read/write data flow shown in FIG. .
如图 4所示, 所述数据控制系统包括: 处理器 41、 接收器 42、 发射器 43、 存储器 44、 总线 4000和驱动电路 4001。  As shown in FIG. 4, the data control system includes: a processor 41, a receiver 42, a transmitter 43, a memory 44, a bus 4000, and a driving circuit 4001.
其中, 接收器 42 , 用于接收克隆虚拟机发送的读数据请求; 处理器 41 , 用于确定所述读数据请求所请求读取的数据块所属 镜像;  The receiver 42 is configured to receive a read data request sent by the clone virtual machine, and the processor 41 is configured to determine a mirror image to which the read data request is requested to be read;
所述处理器 41 , 还用于当确定所述请求读取的数据块属于基础 镜像时, 从所述内存中读取所述数据块; 发射器 43 , 用于将所述数 据块发送给所述克隆虚拟机;  The processor 41 is further configured to: when determining that the data block requested to be read belongs to the basic image, read the data block from the memory; and the transmitter 43 is configured to send the data block to the Cloning a virtual machine;
所述处理器 41 , 还用于当所述请求读取的数据块属于更新镜像 时, 从所述磁盘中读取所述数据块, 并将所述数据块写入所述内存 中, 从所述内存中读取所述数据块, 并由所述发射器 43发送给所述 克隆虚拟机。 The processor 41 is further configured to: when the data block requested to be read belongs to an update image Reading the data block from the disk and writing the data block into the memory, reading the data block from the memory, and transmitting by the transmitter 43 to the Clone a virtual machine.
其中, 驱动电路 4001 , 用于为数据控制系统中的各个硬件提供 驱动使得各个硬件能够正常工作。  The driving circuit 4001 is configured to provide drivers for each hardware in the data control system so that each hardware can work normally.
本实施例在具体实现中, 存储器至少包括如下一个或者多个内 存设备, 一个只读存储器、 一个随机存取存储器或者一个非易失行 随机存取存储器, 存储器为处理器提供指令和数据。  In a specific implementation of the present embodiment, the memory includes at least one or more of the following memory devices, a read only memory, a random access memory or a nonvolatile random access memory, the memory providing instructions and data to the processor.
其中, 所述处理器可能是一种集成电路芯片, 具有信号的处理 能力。 在实现过程中, 上述方法的各步骤可以通过处理器中的硬件 的集成逻辑电路或者软件形式的指令完成。 这些指令可以通过其中 的处理器以配合实现及控制, 用于执行本发明实施例揭示的方法。 上述处理器还可以是通用处理器、 数字信号处理器 ( Digital Signal Processing , DSP )、 专用集成电路 ( application specific integrated circuit )、现成可编程门阵列 ( Field Programmable Gate Array , FPGA ) 或者其他可编程逻辑器件、 分立门或者晶体管逻辑器件、 分立硬件 组件。  Wherein, the processor may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor or an instruction in a form of software. These instructions may be implemented and controlled by a processor therein for performing the methods disclosed in the embodiments of the present invention. The processor may also be a general purpose processor, a digital signal processing (DSP), an application specific integrated circuit, a Field Programmable Gate Array (FPGA) or other programmable logic. Devices, discrete gates or transistor logic devices, discrete hardware components.
其中, 上述通用处理器可以是微处理器或者该处理器也可以是 任何常规的处理器, 解码器等。 结合本发明实施例所公开的方法的 步骤可以直接体现为硬件处理器执行完成, 或者用处理器中的硬件 及软件模块组合执行完成。 软件模块可以位于随机存储器, 闪存、 只读存储器, 可编程只读存储器或者电可擦写可编程存储器、 寄存 器等本领域成熟的存储介质中。  The above general purpose processor may be a microprocessor or the processor may be any conventional processor, decoder or the like. The steps of the method disclosed in the embodiment of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
另外,数据控制系统的各个硬件组件通过总线系统 4000耦合在 一起, 其中总线系统 4000 除包括数据总线之外, 还包括电源总线、 控制总线和状态信号总线。 但是为了清楚说明起 , 在图 4 中将各种 总线都标为总线系统 4000。  Additionally, the various hardware components of the data control system are coupled together by a bus system 4000, which in addition to the data bus includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are labeled as bus system 4000 in FIG.
本发明实施例中, 由于各个克隆虚拟机共用的基础镜像存放在 内存中, 因而, 克隆虚拟机请求读取的数据块属于基础镜像时, 可 以直接从内存中读取所述请求读取的数据块。 本发明实施例中由于 各个克隆虚拟机共用的基础镜像存放在内存中, 亦即内存中保存了 一份基础镜像, 与现有现有技术中每个克隆虚拟机均需要在内存中 占用一定空间来写入相同的基础镜像, 导致内存保存了多份相同的 基础镜像相比, 本发明实施例可以提高内存资源的利用率。 In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory. Therefore, when the data block requested by the cloned virtual machine belongs to the basic image, Reading the data block read by the request directly from memory. In the embodiment of the present invention, the basic image shared by each cloned virtual machine is stored in the memory, that is, a basic image is saved in the memory, and each cloned virtual machine needs to occupy a certain space in the memory in the prior art. The embodiment of the present invention can improve the utilization of memory resources, as compared with the case where the same basic image is saved in the memory.
另外, 现有技术中, 由于每个克隆虚拟机都需要从磁盘上读取 一次基础镜像中的数据, 而磁盘的读写能力 (单位时间读写的输入 / 输出 ( I/O ) 次数) 通常是固定的, 因而限制了同时运行的克隆虚拟 机的数量。 而本发明提供的系统中, 克隆虚拟机在读取基础镜像时 无需对磁盘进行读写操作, 只有在读取更新镜像时对磁盘进行读写 操作, 因而, 可以减少对磁盘的读写次数, 进而支持更多克隆虚拟 机的运行。  In addition, in the prior art, since each cloned virtual machine needs to read the data in the base image from the disk, the read/write capability of the disk (the number of input/output (I/O) read/write per unit time) is usually It is fixed, thus limiting the number of cloned virtual machines running simultaneously. In the system provided by the present invention, the cloned virtual machine does not need to read and write the disk when reading the base image, and only reads and writes the disk when the update image is read, thereby reducing the number of reads and writes to the disk. In turn, it supports the operation of more cloned virtual machines.
此外, 采用现有技术还需要人工预先设置克隆虚拟机所需緩存 的大小, 对技术人员的技术和经验要求较高, 采用本发明实施例提 供的系统不需要预先设置克隆虚拟机所需緩存的大小, 可以进一步 提高本发明实施例的实用范围。 本发明实施例提供的系统, 还可以对来自克隆虚拟机的写数据 请求进行处理。 具体如下:  In addition, the prior art also needs to manually set the size of the cache required for cloning the virtual machine. The technical and experience of the technician is high. The system provided by the embodiment of the present invention does not need to preset the cache required for the cloned virtual machine. The size can further improve the practical range of the embodiments of the present invention. The system provided by the embodiment of the present invention can also process the write data request from the cloned virtual machine. details as follows:
所述接收器 42 , 还用于接收克隆虚拟机发送的写数据请求; 所述处理器 41 , 还用于判断所述写数据请求所请求写入的数据 是否构成完整的数据块;  The receiver 42 is further configured to receive a write data request sent by the clone virtual machine, where the processor 41 is further configured to determine whether the data requested by the write data request constitutes a complete data block;
所述处理器 41 , 还用于如果判断出所述写数据请求所请求写入 的数据构成完整的数据块, 则写入所述更新镜像中;  The processor 41 is further configured to write into the update image if it is determined that the data requested to be written by the write data request constitutes a complete data block;
所述处理器 41 , 还用于如果判断出所述写数据请求所请求写入 的数据没有构成完整的数据块, 从基础镜像中取出所述数据对应的 数据块, 将所述数据更新至所述数据块中, 将更新后的数据块写入 所述更新镜像中。 进一步地, 所述基础镜像进行压缩后保存在所述 存储器 44中。 其中, 可以使用 ZRAM工具将基础镜像压缩后保存在内存的虚 拟设备中。 The processor 41 is further configured to: if it is determined that the data requested to be written by the write data request does not constitute a complete data block, extract a data block corresponding to the data from the base image, and update the data to the In the data block, the updated data block is written into the update image. Further, the base image is compressed and stored in the memory 44. Among them, you can use the ZRAM tool to compress the base image and save it in the virtual device of the memory.
所述处理器 41 , 具体用于当确定所述请求读取的数据块属于基 础镜像时, 从所述内存的虚拟设备中读取并解压缩所述数据块; 所述发射器 43 , 具体用于将解压缩后的数据块发送给所述克隆 虚拟机。  The processor 41 is specifically configured to: when determining that the data block requested to be read belongs to the basic image, reading and decompressing the data block from the virtual device in the memory; The decompressed data block is sent to the clone virtual machine.
进一步地, 所述内存中的数据块保存在所述内存的页面中, 为 了进一步提高内存资源的利用率, 有效节省内存资源, 所述处理器 41 , 还用于定期扫描所述内存中的各个页面; 分别利用各个页面中 的数据进行哈希运算, 得到各个页面的哈希值; 如果哈希值相同的 页面大于两个, 则保留所述哈希值相同的页面中的一个页面, 删除 其余的页面。 通过以上的实施方式的描述, 所属领域的技术人员可以清楚地 了解到本发明可借助软件加必需的通用硬件的方式来实现, 当然也 可以通过硬件, 但很多情况下前者是更佳的实施方式。 基于这样的 理解, 本发明的技术方案本质上或者说对现有技术做出贡献的部分 可以以软件产品的形式体现出来, 该计算机软件产品存储在可读取 的存储介质中, 如计算机的软盘, 硬盘或光盘等, 包括若干指令用 以使得一台计算机设备 (可以是个人计算机, 服务器, 或者网络设 备等) 执行本发明各个实施例所述的方法。  Further, the data block in the memory is saved in the page of the memory, in order to further improve the utilization of the memory resource, and effectively save the memory resource, the processor 41 is further configured to periodically scan each of the memory. a page; respectively, using the data in each page to perform a hash operation to obtain a hash value of each page; if the number of pages having the same hash value is greater than two, one page of the same hash value is retained, and the rest is deleted. Page. Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. . Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer. A hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围 并不局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技 术范围内, 可轻易想到变化或替换, 都应涵盖在本发明的保护范围 之内。 因此,本发明的保护范围应以所述权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims

权 利 要 求 书 claims
1、 一种数据控制方法, 其特征在于, 基础镜像保存在内存中, 更新镜像保存在磁盘中, 所述方法包括: 1. A data control method, characterized in that the basic image is stored in the memory, and the updated image is stored in the disk. The method includes:
接收克隆虚拟机发送的读数据请求; Receive data read requests sent by cloned virtual machines;
确定所述读数据请求所请求读取的数据块所属镜像; Determine the image to which the data block requested to be read by the read data request belongs;
当所述请求读取的数据块属于所述基础镜像时,从所述内存中读 取所述数据块, 并将所述数据块发送给所述克隆虚拟机; When the data block requested to be read belongs to the base image, read the data block from the memory and send the data block to the clone virtual machine;
当所述请求读取的数据块属于所述更新镜像时,从所述磁盘中读 取所述数据块, 并将所述数据块写入所述内存中, 再从所述内存中读 取所述数据块, 并发送给所述克隆虚拟机。 When the data block requested to be read belongs to the update image, the data block is read from the disk, written into the memory, and then read from the memory. The data block is then sent to the cloned virtual machine.
2、 根据权利要求 1 所述的方法, 其特征在于, 所述基础镜像进 行压缩后保存在所述内存的虚拟设备中, 2. The method according to claim 1, characterized in that the basic image is compressed and stored in the virtual device of the memory,
所述当所述请求读取的数据块属于所述基础镜像时,从所述内存 中读取所述数据块, 并将所述数据块发送给所述克隆虚拟机包括: 当 所述请求读取的数据块属于所述基础镜像时, 从所述内存的虚拟设备 中读取并解压缩所述数据块, 将解压缩后的数据块发送给所述克隆虚 拟机。 When the data block requested to be read belongs to the base image, reading the data block from the memory and sending the data block to the clone virtual machine includes: When the fetched data block belongs to the base image, the data block is read from the virtual device in the memory and decompressed, and the decompressed data block is sent to the clone virtual machine.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 还包括: 接收所述克隆虚拟机发送的写数据请求; 3. The method according to claim 1 or 2, further comprising: receiving a data write request sent by the cloned virtual machine;
判断所述写数据请求所请求写入的数据是否构成完整的数据块; 如果构成完整的数据块, 则写入所述更新镜像中; 如果没有构成 完整的数据块, 则从所述基础镜像中取出所述数据对应的数据块, 将 所述数据更新至所述数据对应的数据块中, 并将更新后的数据块写入 所述更新镜像中。 Determine whether the data requested by the write data request constitutes a complete data block; if it constitutes a complete data block, write it into the update image; if it does not constitute a complete data block, then retrieve it from the base image The data block corresponding to the data is taken out, the data is updated into the data block corresponding to the data, and the updated data block is written into the update mirror.
4、 根据权利要求 1 -3 任一项所述的方法, 其特征在于, 所述内 存中的数据块保存在所述内存的各个页面中, 4. The method according to any one of claims 1 to 3, characterized in that the data blocks in the memory are stored in each page of the memory,
所述方法还包括: The method also includes:
定期扫描所述内存中的各个页面; Periodically scan various pages in said memory;
分别利用各个页面中的数据进行哈希运算,得到各个页面的哈希 值; Use the data in each page to perform hash operations to obtain the hash of each page. value;
如果哈希值相同的页面大于两个,则保留所述哈希值相同的页面 中的一个页面, 删除其余的页面。 If there are more than two pages with the same hash value, keep one of the pages with the same hash value and delete the remaining pages.
5、 一种数据控制系统, 其特征在于, 基础镜像保存在内存中, 更新镜像保存在磁盘中, 所述系统包括: 5. A data control system, characterized in that the basic image is stored in the memory and the update image is stored in the disk. The system includes:
接收模块, 用于接收克隆虚拟机发送的读数据请求; The receiving module is used to receive the read data request sent by the cloned virtual machine;
控制模块,用于确定所述读数据请求所请求读取的数据块所属镜 像; A control module, used to determine the mirror to which the data block requested to be read by the read data request belongs;
读取模块,用于当所述控制模块确定所述请求读取的数据块属于 所述基础镜像时, 从所述内存中读取所述数据块; 发送模块, 用于将 所述数据块发送给所述克隆虚拟机; A reading module, configured to read the data block from the memory when the control module determines that the data block requested to be read belongs to the basic image; a sending module, used to send the data block Give the cloned virtual machine;
所述读取模块,还用于当所述控制模块确定所述请求读取的数据 块属于所述更新镜像时, 从所述磁盘中读取所述数据块; 写入模块, 用于将所述数据块写入所述内存中; 所述读取模块, 还用于从所述内 存中读取所述数据块, 并由所述发送模块发送给所述克隆虚拟机。 The reading module is also configured to read the data block from the disk when the control module determines that the data block requested to be read belongs to the update image; the writing module is used to write the data block to the disk. The data block is written into the memory; the reading module is also configured to read the data block from the memory, and send the data block to the clone virtual machine by the sending module.
6、 根据权利要求 5所述的系统, 其特征在于, 所述基础镜像进 行压缩后保存在所述内存的虚拟设备中, 6. The system according to claim 5, wherein the basic image is compressed and stored in the virtual device of the memory,
所述读取模块,具体用于当所述控制模块确定所述请求读取的数 据块属于所述基础镜像时, 从所述内存的虚拟设备中读取并解压缩所 述数据块; The reading module is specifically configured to read and decompress the data block from the virtual device of the memory when the control module determines that the data block requested to be read belongs to the basic image;
所述发送模块,具体用于将解压缩后的数据块发送给所述克隆虚 拟机。 The sending module is specifically configured to send the decompressed data block to the clone virtual machine.
7、 根据权利要求 5或 6所述的系统, 其特征在于, 7. The system according to claim 5 or 6, characterized in that,
所述接收模块, 还用于接收所述克隆虚拟机发送的写数据请求; 所述控制模块,还用于判断所述写数据请求所请求写入的数据是 否构成完整的数据块; The receiving module is also used to receive the write data request sent by the clone virtual machine; the control module is also used to determine whether the data requested by the write data request constitutes a complete data block;
所述写入模块,还用于如果所述控制模块判断出所述写数据请求 所请求写入的数据构成完整的数据块, 则写入所述更新镜像中; The writing module is also configured to write into the update image if the control module determines that the data requested by the write data request constitutes a complete data block;
所述读取模块,还用于如果所述控制模块判断出所述写数据请求 所请求写入的数据没有构成完整的数据块, 则从所述基础镜像中取出 所述数据对应的数据块, 将所述数据更新至所述数据对应的数据块中, 所述写入模块, 还用于将更新后的数据块写入所述更新镜像中。 The reading module is also used to determine if the control module determines that the write data request If the data requested to be written does not constitute a complete data block, the data block corresponding to the data is taken out from the basic image, and the data is updated to the data block corresponding to the data. The writing module, It is also used to write updated data blocks into the updated image.
8、 根据权利要求 5-7 任一项所述的系统, 其特征在于, 所述内 存中的数据块保存在所述内存的各个页面中, 8. The system according to any one of claims 5-7, characterized in that the data blocks in the memory are stored in each page of the memory,
所述系统还包括: The system also includes:
扫描模块, 用于定期扫描所述内存中的各个页面; A scanning module for regularly scanning each page in the memory;
运算模块, 用于分别利用各个页面中的数据进行哈希运算, 得到 各个页面的哈希值; The operation module is used to perform hash operations using the data in each page to obtain the hash value of each page;
处理模块, 用于如果哈希值相同的页面大于两个, 则保留所述哈 希值相同的页面中的一个页面, 删除其余的页面。 A processing module configured to retain one of the pages with the same hash value and delete the remaining pages if there are more than two pages with the same hash value.
9、 一种数据控制系统, 其特征在于, 基础镜像保存在内存中, 更新镜像保存在磁盘中, 所述系统包括: 9. A data control system, characterized in that the basic image is stored in the memory and the updated image is stored in the disk. The system includes:
接收器, 用于接收克隆虚拟机发送的读数据请求; Receiver, used to receive read data requests sent by the cloned virtual machine;
处理器,用于确定所述读数据请求所请求读取的数据块所属镜像; 所述处理器,还用于当确定所述请求读取的数据块属于基础镜像 时, 从所述内存中读取所述数据块; 发射器, 用于将所述数据块发送 给所述克隆虚拟机; The processor is configured to determine the mirror to which the data block requested to be read by the read data request belongs; the processor is also configured to read from the memory when it is determined that the data block requested to be read belongs to the basic mirror. Get the data block; Transmitter, used to send the data block to the clone virtual machine;
所述处理器, 还用于当所述请求读取的数据块属于更新镜像时, 从所述磁盘中读取所述数据块, 并将所述数据块写入所述内存中, 从 所述内存中读取所述数据块, 并由所述发射器发送给所述克隆虚拟机。 The processor is also configured to read the data block from the disk and write the data block into the memory when the data block requested to be read belongs to the update image. The data block is read from the memory and sent to the clone virtual machine by the transmitter.
10、 根据权利要求 9所述的系统, 其特征在于, 所述基础镜像进 行压缩后保存在所述内存的虚拟设备中, 10. The system according to claim 9, characterized in that the basic image is compressed and stored in the virtual device of the memory,
所述处理器,具体用于当确定所述请求读取的数据块属于基础镜 像时, 从所述内存的虚拟设备中读取并解压缩所述数据块; The processor is specifically configured to read and decompress the data block from the virtual device of the memory when it is determined that the data block requested to be read belongs to the basic image;
所述发射器,具体用于将解压缩后的数据块发送给所述克隆虚拟 机。 The transmitter is specifically used to send decompressed data blocks to the clone virtual machine.
11、 根据权利要求 9或 10所述的系统, 其特征在于, 11. The system according to claim 9 or 10, characterized in that,
所述接收器, 还用于接收所述克隆虚拟机发送的写数据请求; 所述处理器,还用于判断所述写数据请求所请求写入的数据是否 构成完整的数据块; The receiver is also used to receive a write data request sent by the clone virtual machine; The processor is also used to determine whether the data requested to be written by the write data request constitutes a complete data block;
所述处理器,还用于如果判断出所述写数据请求所请求写入的数 据构成完整的数据块, 则写入所述更新镜像中; The processor is also configured to write into the update image if it is determined that the data requested by the write data request constitutes a complete data block;
所述处理器,还用于如果判断出所述写数据请求所请求写入的数 据没有构成完整的数据块, 则从所述基础镜像中取出所述数据对应的 数据块, 将所述数据更新至所述数据对应的数据块中, 将更新后的数 据块写入所述更新镜像中。 The processor is also configured to, if it is determined that the data requested by the write data request does not constitute a complete data block, retrieve the data block corresponding to the data from the base image, and update the data. to the data block corresponding to the data, and write the updated data block into the update mirror.
12、 根据权利要求 9- 11 任一项所述的系统, 其特征在于, 所述 内存中的数据块保存在所述内存的各个页面中, 12. The system according to any one of claims 9-11, characterized in that the data blocks in the memory are stored in each page of the memory,
所述处理器, 还用于定期扫描所述内存中的各个页面; 分别利用 各个页面中的数据进行哈希运算, 得到各个页面的哈希值; 如果哈希 值相同的页面大于两个, 则保留所述哈希值相同的页面中的一个页面, 删除其余的页面。 The processor is also used to regularly scan each page in the memory; perform a hash operation using the data in each page to obtain the hash value of each page; if there are more than two pages with the same hash value, then Keep one of the pages with the same hash value and delete the rest.
PCT/CN2012/087338 2012-12-24 2012-12-24 Method and system for data controlling WO2014100954A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/087338 WO2014100954A1 (en) 2012-12-24 2012-12-24 Method and system for data controlling
CN201280002917.4A CN103229150B (en) 2012-12-24 2012-12-24 data control method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/087338 WO2014100954A1 (en) 2012-12-24 2012-12-24 Method and system for data controlling

Publications (1)

Publication Number Publication Date
WO2014100954A1 true WO2014100954A1 (en) 2014-07-03

Family

ID=48838329

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/087338 WO2014100954A1 (en) 2012-12-24 2012-12-24 Method and system for data controlling

Country Status (2)

Country Link
CN (1) CN103229150B (en)
WO (1) WO2014100954A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113703927A (en) * 2021-10-29 2021-11-26 杭州链城数字科技有限公司 Data processing method, privacy computing system, electronic device, and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103229150B (en) * 2012-12-24 2016-01-13 华为技术有限公司 data control method and system
CN105589704B (en) * 2014-10-22 2018-08-21 北京云巢动脉科技有限公司 A kind of method and system for accelerating virtual machine to start
CN104461775A (en) * 2014-11-26 2015-03-25 英业达科技有限公司 Remote backup system and backup method
CN104699569B (en) * 2015-03-24 2017-12-08 积成电子股份有限公司 A kind of MQX operation system images structure, MQX operating systems, power information acquisition terminal and image update method
CN111488195B (en) * 2020-04-10 2023-05-12 深信服科技股份有限公司 Virtual machine cloning method, device, equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011221597A (en) * 2010-04-05 2011-11-04 Hitachi Solutions Ltd Clone disk creation method and program
CN102708060A (en) * 2012-05-14 2012-10-03 华为技术有限公司 Method, device and system for accessing image files
CN103229150A (en) * 2012-12-24 2013-07-31 华为技术有限公司 Data control method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060184937A1 (en) * 2005-02-11 2006-08-17 Timothy Abels System and method for centralized software management in virtual machines
US8151263B1 (en) * 2006-03-31 2012-04-03 Vmware, Inc. Real time cloning of a virtual machine
US8677355B2 (en) * 2010-12-17 2014-03-18 Microsoft Corporation Virtual machine branching and parallel execution

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011221597A (en) * 2010-04-05 2011-11-04 Hitachi Solutions Ltd Clone disk creation method and program
CN102708060A (en) * 2012-05-14 2012-10-03 华为技术有限公司 Method, device and system for accessing image files
CN103229150A (en) * 2012-12-24 2013-07-31 华为技术有限公司 Data control method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113703927A (en) * 2021-10-29 2021-11-26 杭州链城数字科技有限公司 Data processing method, privacy computing system, electronic device, and storage medium

Also Published As

Publication number Publication date
CN103229150A (en) 2013-07-31
CN103229150B (en) 2016-01-13

Similar Documents

Publication Publication Date Title
US20220164104A1 (en) Virtualizing non-volatile storage at a peripheral device
JP6046216B2 (en) Host system and host controller
US20170017663A1 (en) Heuristic interface for enabling a computer device to utilize data property-based data placement inside a nonvolatile memory device
US9092426B1 (en) Zero-copy direct memory access (DMA) network-attached storage (NAS) file system block writing
TW201729107A (en) Compressed caching of a logical-to-physical address table for NAND-type flash memory
WO2014100954A1 (en) Method and system for data controlling
US10754785B2 (en) Checkpointing for DRAM-less SSD
WO2017132872A1 (en) Virtual machine backup method, backup device and host
KR20090028518A (en) High speed nonvolatile memory device
JP6069031B2 (en) Computer and memory management method
TW201220197A (en) for improving the safety and reliability of data storage in a virtual machine based on cloud calculation and distributed storage environment
WO2016101165A1 (en) Transaction processing method, device and computer system
WO2019090493A1 (en) Memory block recovery method and device
JP7227907B2 (en) Method and apparatus for accessing non-volatile memory as byte-addressable memory
US11132145B2 (en) Techniques for reducing write amplification on solid state storage devices (SSDs)
US20220253252A1 (en) Data processing method and apparatus
US9678689B2 (en) Storage systems and aliased memory
WO2015196378A1 (en) Method, device and user equipment for reading/writing data in nand flash
TW202201230A (en) Storage device and method for live virtual machine migration
CN107423425B (en) Method for quickly storing and inquiring data in K/V format
CN112486870A (en) Computer system and computer system control method
US20240086113A1 (en) Synchronous write method and device, storage system and electronic device
WO2012113206A1 (en) Demand paging method for mobile terminal, controller and mobile terminal
CN105260264A (en) Snapshot implementation method and snapshot system
JP2016062406A (en) Memory system, control method for memory system, and program

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: 12890835

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12890835

Country of ref document: EP

Kind code of ref document: A1