CN115509624B - Stream loading-oriented mirror image fusion method and system - Google Patents

Stream loading-oriented mirror image fusion method and system Download PDF

Info

Publication number
CN115509624B
CN115509624B CN202211311844.9A CN202211311844A CN115509624B CN 115509624 B CN115509624 B CN 115509624B CN 202211311844 A CN202211311844 A CN 202211311844A CN 115509624 B CN115509624 B CN 115509624B
Authority
CN
China
Prior art keywords
block
load
load block
sector
mirror image
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202211311844.9A
Other languages
Chinese (zh)
Other versions
CN115509624A (en
Inventor
张德宇
谢禹
任炬
何榜文
李云皓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central South University
Original Assignee
Central South University
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 Central South University filed Critical Central South University
Priority to CN202211311844.9A priority Critical patent/CN115509624B/en
Publication of CN115509624A publication Critical patent/CN115509624A/en
Application granted granted Critical
Publication of CN115509624B publication Critical patent/CN115509624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • 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/45575Starting, stopping, suspending or resuming virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention provides a mirror image fusion method and a mirror image fusion system for stream loading, wherein the method comprises the following steps: acquiring a data packet loaded by a stream until a complete sub-mirror image is obtained, and analyzing the sub-mirror image to obtain a block allocation table and system metadata of the sub-mirror image; obtaining the state of a corresponding load block in the system metadata according to the table entry of the block allocation table, and determining the state of a corresponding sector bit block in the system metadata according to the state of the load block; determining a first target load block according to the state of the load block, and determining a sector to be fused in a corresponding second target load block according to the state of the sector bit block; correspondingly fusing the data block and the father mirror image: and fusing the first target load block of the child image to a corresponding area in the corresponding load block of the parent image, and fusing the sector to be fused in the second target load block of the child image to a corresponding sector in the corresponding load block of the parent image. The invention provides a mirror image fusion technology which has good compatibility and no virtualization overhead for updating the stream loading system as a bottom layer for realizing.

Description

Stream loading-oriented mirror image fusion method and system
Technical Field
The invention relates to the field of virtualization, in particular to a stream-oriented loading mirror fusion method and system.
Background
Multi-terminal service deployment is a popular application scenario. The traditional virtual desktop architecture (Virtual Desktop Infrastructure, VDI) concentrates both computing and storage on the server/host, which has the advantage that users do not have to worry about data loss caused by failure of cloud terminal hardware devices. However, because of its almost no computing and data processing capabilities, problems such as network jamming often occur in practical applications, which is inconvenient for the customer. The virtual operating system architecture (Virtual Operating System Infrastructure, VOI) delivers computational load to the terminal, reducing the burden of server computation, but still being affected by transmission delays. A hardware virtualization layer is arranged in a terminal in the intelligent desktop virtualization (Intelligent Desktop Virtualization, IDV) architecture, a system image issued by a cloud runs in the hardware virtualization layer, and data is still stored in the cloud. The system resources of the terminal equipment are limited, the resources of the virtualization layer based on the virtualization scheme are consumed more in a large amount, the experience of the user is seriously influenced, and the user wants to better use the experience and needs to configure hardware with better performance.
The server of the virtual desktop architecture has large calculation load, large network transmission load and large network delay, and is easily influenced by network fluctuation. The virtual operating system architecture delivers a computational load to the terminal, but does not solve the network load problem, and the terminal has compatibility problems. Intelligent desktop virtualization introduces virtualization overhead, leads to additional consumption of system resources, and affects user experience. And the system update of the virtualized architecture needs to make a system image, and the old version of the method for making the system image is not applicable after being replaced by a different BIOS, and the system image cannot be made. The new version of CPU model and Windows system version can make the produced mirror image not normally used.
Therefore, there is a need in the market for a mirror image fusion technology without virtualization overhead to realize multi-terminal streaming loading, so as to reduce service deployment overhead.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: current streaming loading system updates require a mirror fusion technique with good compatibility and no virtualization overhead to be implemented as a bottom layer.
Aiming at the technical problems in the prior art, the invention provides a stream loading-oriented mirror image fusion method and a stream loading-oriented mirror image fusion system, which finish system updating by stream loading new increment mirror images and system mirror images of terminals.
In order to solve the technical problems, the technical scheme provided by the invention is as follows:
a mirror image fusion method facing stream loading includes the following steps:
s1) acquiring a data packet loaded in a streaming mode until a complete sub-mirror image is obtained, and analyzing the sub-mirror image to obtain a block allocation table and system metadata of the sub-mirror image;
s2) obtaining the state of a corresponding load block in the system metadata according to the table entry of the block allocation table, and determining the state of a corresponding sector bit block in the system metadata according to the state of the load block;
s3) determining a first target load block according to the state of the load block, and determining a sector to be fused in a corresponding second target load block according to the state of the sector bit block;
s4) fusing the first target load block of the child image to the corresponding area in the corresponding load block of the parent image, and fusing the sector to be fused in the second target load block of the child image to the corresponding sector in the corresponding load block of the parent image.
Further, the child mirror is a VHDX mirror, and the parsing the child mirror in step S1 includes:
loading a header of the VHDX mirror image file, verifying the correctness of the header, and reading an area table in the header after the verification is passed;
analyzing the file offset and the length of the block allocation table region through the block allocation table entries in the region table small region;
analyzing the file offset and the length of the metadata area through the metadata area entry of the small area of the area table;
and loading according to the file offset and the length of the block allocation table area to obtain a block allocation table, and loading according to the file offset and the length of the metadata area to obtain system metadata.
Further, step S2 further includes: and analyzing the file parameter entries of the system metadata to obtain the sizes of the load blocks and the sector bitmap blocks of the system metadata, and analyzing the entries of the logical sector sizes of the system metadata to obtain the sector sizes in each load block.
Further, the sector bitmap block manages at least two load blocks, and determining the state of the corresponding sector bitmap block in the system metadata according to the state of the load block in step S2 specifically includes: if the load block with the status of 'load block part exists' does not exist in the load blocks managed by the current sector bitmap block, the status of the current sector bitmap block is 'sector bitmap block does not exist'; if the load block with the status of "load block part exists" exists in the load blocks managed by the current sector bitmap block, the status of the current sector bitmap block is "sector bitmap block exists".
Further, the step S3 specifically includes:
if the current load block is in the state of 'the load block is completely existing', the current load block is a first target load block;
if the current load block is in the state of 'load block part exists', the current load block is a second target load block;
if the state of the current sector bit block is "sector bit block exists", traversing the current sector bit block, finding the position with the target value, and taking the sector corresponding to the position in the corresponding second target load block as the sector to be fused.
Further, the load block size of the parent image is an integer multiple of the load block size of the child image, and step S4 specifically includes:
according to the size relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, establishing the corresponding relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, wherein each load block of the parent mirror image corresponds to at least two load blocks of the child mirror image;
traversing each load block of the child mirror image, if the current load block is a first target load block, writing data of the current load block into a corresponding area in a load block corresponding to the parent mirror image, and if the current load block is a second target load block, writing data of a sector to be fused in the current load block into a corresponding sector in the load block corresponding to the parent mirror image.
The invention also provides a mirror image fusion system facing the stream loading, which comprises:
the metadata analysis unit is used for acquiring the data packet loaded in the streaming mode until a complete sub-mirror image is obtained, and analyzing the sub-mirror image to obtain system metadata of the block allocation table and the sub-mirror image;
the data block analysis unit is used for obtaining the state of the corresponding load block in the system metadata according to the table entry of the block allocation table, and determining the state of the corresponding sector bit block in the system metadata according to the state of the load block; the method is also used for determining a first target load block according to the state of the load block, and determining a sector to be fused in a corresponding second target load block according to the state of the sector bit block;
the data block fusion unit is used for fusing the first target load block of the child image to the corresponding area in the corresponding load block of the parent image, and fusing the sector to be fused in the second target load block of the child image to the corresponding sector in the corresponding load block of the parent image.
Further, the child mirror is a VHDX mirror, and when the metadata parsing unit parses the child mirror, the metadata parsing unit is configured to perform:
loading a header of the VHDX mirror image file, verifying the correctness of the header, and reading an area table in the header after the verification is passed;
analyzing the file offset and the length of the block allocation table region through the block allocation table entries in the region table small region;
analyzing the file offset and the length of the metadata area through the metadata area entry of the small area of the area table;
and loading according to the file offset and the length of the block allocation table area to obtain a block allocation table, and loading according to the file offset and the length of the metadata area to obtain system metadata.
Further, the data block analysis unit determines a first target load block according to the state of the load block, and determines a corresponding second target load block when the sectors to be fused are to be fused according to the state of the sector bit block, and is configured to execute:
if the current load block is in the state of 'the load block is completely existing', the current load block is a first target load block;
if the current load block is in the state of 'load block part exists', the current load block is a second target load block;
if the state of the current sector bit block is "sector bit block exists", traversing the current sector bit block, finding the position with the target value, and taking the sector corresponding to the position in the corresponding second target load block as the sector to be fused.
Further, the size of the load block of the parent image is an integer multiple of the size of the load block of the child image, and the data block fusing unit is configured to execute:
according to the size relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, establishing the corresponding relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, wherein each load block of the parent mirror image corresponds to at least two load blocks of the child mirror image;
traversing each load block of the child mirror image, if the current load block is a first target load block, writing data of the current load block into a corresponding area in a load block corresponding to the parent mirror image, and if the current load block is a second target load block, writing data of a sector to be fused in the current load block into a corresponding sector in the load block corresponding to the parent mirror image.
Compared with the prior art, the invention has the advantages that:
the VHDX mirror image file is used as the child mirror image and analyzed, so that the positioning and content analysis of all data blocks are realized, the data blocks of the child mirror image which need to be copied during fusion are positioned and transferred to the father mirror image, and fusion of the child mirror image and the father mirror image is realized, thereby providing a mirror image fusion technology with good compatibility for updating the stream loading system. The invention does not depend on a virtualization layer on the terminal, and the CPU, the memory and other computing and storage resources are directly used in the running process, thereby realizing no virtualization overhead.
Drawings
FIG. 1 is a flow chart of an embodiment of the present invention.
FIG. 2 is a block allocation table of load blocks and sector bit blocks according to an embodiment of the present invention.
FIG. 3 is a flow chart of analyzing and determining blocks that need to be fused in accordance with an embodiment of the present invention.
FIG. 4 is a mirror fusion flow chart of an embodiment of the present invention.
FIG. 5 is a schematic diagram of a correspondence relationship between a child image and a parent image load block according to an embodiment of the present invention.
Detailed Description
The invention is further described below in connection with the drawings and the specific preferred embodiments, but the scope of protection of the invention is not limited thereby.
As shown in fig. 1, this embodiment proposes a stream-oriented loading image fusion method, in which differential images are created and parsed for the first time under an open source system, and fusion of differential images and basic images is implemented for the first time under the open source system, including the following steps:
s1) loading and analyzing sub-mirror metadata: acquiring a data packet loaded by a stream until a complete sub-mirror image is obtained, and analyzing the sub-mirror image to obtain a block allocation table and system metadata of the sub-mirror image;
s2) positioning the data block according to the block allocation table and analyzing the block state: obtaining the state of a corresponding load block in the system metadata according to the table entry of the block allocation table, and determining the state of a corresponding sector bit block in the system metadata according to the state of the load block;
s3) loading the data blocks and determining the data blocks to be fused: determining a first target load block according to the state of the load block, and determining a sector to be fused in a corresponding second target load block according to the state of the sector bit block;
s4) correspondingly fusing the data block and the father mirror image: and fusing the first target load block of the child image to a corresponding area in the corresponding load block of the parent image, and fusing the sector to be fused in the second target load block of the child image to a corresponding sector in the corresponding load block of the parent image.
For step S1 of this embodiment, the child mirror is a VHDX mirror, because in the scenario of unified deployment and update of the terminal system, the current solution lacks a suitable bottom implementation and has a compatibility problem, so a virtual disk technology supported by a system developer is used to support unified deployment of the terminal system. For the virtual disk format VHDX proposed by Microsoft, the Windows system image can be loaded in the VHDX and normally run on different hardware, so that the system image is generated, the hardware virtualization overhead is not introduced, and meanwhile, the child image can be created for the same system image.
Since the current implementation of VHDX format is a black box, and only the format of VHDX file is parsed to implement mirror fusion based on file metadata, it is necessary to parse the VHDX file, and we find that the VHDX file includes a header, a log, a Block Allocation Table (BAT), a metadata area, and so on, and each area includes one or more small areas, such as a header including a file identifier, a header, and an area table, and each small area includes a plurality of data entries, and different data entries represent different information, except that the header area is located at a fixed position of the beginning of the file, and other metadata areas need to be directly or indirectly located by metadata information in the header. For the mirror fusion method, it is necessary to locate the system metadata area in the block allocation table area in which the offset and status of each data block are recorded and the metadata area in which the necessary operation units such as the block size and sector size are recorded, which is control information necessary for fusion. The resolving the child mirror in step S1 therefore comprises:
loading a header of the VHDX mirror image file, verifying the correctness of the header, and reading an area table in the header after the verification is passed;
analyzing the file offset and the length of the block allocation table region through the block allocation table entries in the region table small region;
analyzing the file offset and the length of the metadata area through the metadata area entry of the small area of the area table;
and loading according to the file offset and the length of the block allocation table area to obtain a block allocation table, and loading according to the file offset and the length of the metadata area to obtain system metadata.
In step S2 of this embodiment, the size of the load block and the sector bitmap block in the data block of the system metadata is obtained by parsing the file parameter entry of the system metadata, and the offset of the metadata is obtained by parsing the entry of the logical sector size of the system metadata, so that the logical sector size is obtained by loading, where the size is the sector size in the load block, and the sector is the minimum unit of data operation in the data block.
In step S2 of this embodiment, after obtaining the size of the data block and the size of the sector, the block allocation table entries are read to obtain the corresponding data block state, where the block allocation table entries in this embodiment correspond to the data blocks one by one, and each entry records the file offset and the block state of the data block. As shown in fig. 2, the entries are divided into 2 types, corresponding to two different data blocks: load blocks and sector bitmap blocks. The load block stores system image data, the sector bit block is used for indicating whether the load block stores needed system image data, and if not, the load block needs to be obtained from the data block corresponding to the father image when being read and loaded. For a load block, there are 6 possible states recorded in a block allocation table entry corresponding to the data block, where the two states of "load block is completely present" and "load block is partially present" indicate that the load block has valid mirrored data and needs to be merged. For a sector bit map block, the table entry of a plurality of load blocks is followed by the table entry of a sector bit map block, which indicates that the load blocks corresponding to the table entries of the plurality of load blocks are managed by the sector bit map block corresponding to the table entry of the sector bit map block, as shown in fig. 2, in this embodiment, the sector bit map block manages four load blocks. The sector bitmap block has two states of "the sector bitmap block does not exist" and "the sector bitmap block exists", and the determining the state of the corresponding sector bitmap block in the system metadata according to the state of the load block in step S2 specifically includes: if the load block with the status of 'load block part exists' does not exist in the load blocks managed by the current sector bitmap block, the status of the current sector bitmap block is 'sector bitmap block does not exist'; if the load block with the status of "load block part exists" exists in the load blocks managed by the current sector bitmap block, the status of the current sector bitmap block is "sector bitmap block exists".
As shown in fig. 3, in step S3 of the present embodiment, entries of the block allocation table shown in fig. 2 are scanned one by one, and block information in the entries is resolved. For the load block of the sub-mirror image, if the load block is in a state of 'completely existing' or 'partially existing' of the load block, merging is needed, and the load block is cached in the memory, and meanwhile, if the sector bitmap block for managing the load block is in a state of 'partially existing' of the sector bitmap block, and the sector bitmap block is not cached, the sector bitmap block is cached in the memory; if the sector bit map block status is "sector bit map block not present," or the sector bit map block is already cached, no further caching is required. For a load block in the state "load block is completely present", each sector of the entire load block contains system image data, so the entire data block is fused as the first target load block. For a data block in the state "load block part exists", whether or not the load block is fused is detected in units of sectors, and the data block is used as a second target load block. Therefore, if the current load block is in the state of "the load block is completely present", the current load block is the first target load block, and if the current load block is in the state of "the load block is partially present", the current load block is the second target load block; if the state of the current sector bit block is "sector bit block exists", traversing the current sector bit block, and finding the position where the target value exists, in this embodiment, the size of each sector bit block is fixed to be 1MB, and includes 23 bits of 2, each bit is 0 or 1, and a value of 0 indicates that the sector corresponding to the bit does not exist in the load block, so that fusion is not required; a 1 indicates that the corresponding sector exists in the load block and needs to be fused. Therefore, in this embodiment, the target value is 1, and in all the second target load blocks corresponding to the current sector bitmap block, the sector corresponding to the bit of 1 in the current sector bitmap block is used as the sector to be fused. So that it is possible to locate which load blocks of the sub-images and which sectors in the load blocks need to be fused.
As shown in fig. 4, step S4 of the present embodiment specifically includes:
according to the size relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, establishing a corresponding relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, wherein the load blocks of the parent mirror image and the load blocks of the child mirror image have a sequential corresponding relation, and the sizes of the load blocks of the parent mirror image and the load blocks of the child mirror image are often inconsistent, as shown in fig. 5, the size of the load block of the parent mirror image is an integral multiple of the size of the load block of the child mirror image, and each load block of the parent mirror image corresponds to at least two load blocks of the child mirror image;
traversing each load block of the child mirror image, if the current load block is a first target load block, writing data of the current load block into a corresponding area in a load block corresponding to the parent mirror image, and if the current load block is a second target load block, writing data of a sector to be fused in the current load block into a corresponding sector in the load block corresponding to the parent mirror image.
As shown in fig. 5, for a child image with a load block size of 4MB and a parent image with a load block size of 16MB, the child image and the load block of the parent image form a 4-to-1 correspondence. In this case, the 4-block load blocks corresponding to the 0 to 3-block allocation table entries of the child mirror image correspond to the load blocks corresponding to the 0-block allocation table entries of the parent mirror image, and correspond in order: the child image No. 0 payload block corresponds to 0 to 4MB of the parent image No. 0 payload block, the child image No. 1 payload block corresponds to 4 to 8MB of the parent image No. 0 payload block, and so on. If the load block of the child image No. 0 is the first target load block of the "load block is completely present", the load block of the child image No. 1 is the second target load block of the "load block is partially present" and the a-th sector is the sector to be fused, in the fusing process, the data in the load block of the child image No. 0 is written in the area of 0 to 4MB of the load block of the parent image No. 0, and the data in the a-th sector of the load block of the child image No. 1 is written in the a-th sector of 4 to 8MB of the load block of the parent image No. 0. When fusion is executed, for each load block or sector in the load block which needs to be fused of the child mirror image, executing the fusion logic, and fusing to the corresponding position of the load block corresponding to the parent mirror image, thereby realizing fusion of the child mirror image and the parent mirror image.
The invention also provides a mirror image fusion system facing the stream loading, which comprises:
the metadata analysis unit is used for acquiring the data packet loaded in the streaming mode until a complete sub-mirror image is obtained, and analyzing the sub-mirror image to obtain system metadata of the block allocation table and the sub-mirror image;
the data block analysis unit is used for obtaining the state of the corresponding load block in the system metadata according to the table entry of the block allocation table, and determining the state of the corresponding sector bit block in the system metadata according to the state of the load block; the method is also used for determining a first target load block according to the state of the load block, and determining a sector to be fused in a corresponding second target load block according to the state of the sector bit block;
the data block fusion unit is used for fusing the first target load block of the child image to the corresponding area in the corresponding load block of the parent image, and fusing the sector to be fused in the second target load block of the child image to the corresponding sector in the corresponding load block of the parent image.
The data block analysis unit can realize the positioning and content analysis of all data blocks by analyzing the file metadata by the metadata analysis unit, locate the data blocks of the child mirror image which needs to be copied by the fusion method, and the data block fusion unit transfers the data blocks to the father mirror image to realize mirror image fusion.
Since the child image is a VHDX image, when the metadata parsing unit of the present embodiment parses the child image, the metadata parsing unit is configured to perform:
loading a header of the VHDX mirror image file, verifying the correctness of the header, and reading an area table in the header after the verification is passed;
analyzing the file offset and the length of the block allocation table region through the block allocation table entries in the region table small region;
analyzing the file offset and the length of the metadata area through the metadata area entry of the small area of the area table;
and loading according to the file offset and the length of the block allocation table area to obtain a block allocation table, and loading according to the file offset and the length of the metadata area to obtain system metadata.
The data block analysis unit of the present embodiment determines a first target load block according to the state of the load block, and determines a sector to be fused in a corresponding second target load block according to the state of the sector bit block, and is configured to perform:
if the current load block is in the state of 'the load block is completely existing', the current load block is a first target load block;
if the current load block is in the state of 'load block part exists', the current load block is a second target load block;
if the state of the current sector bit block is "sector bit block exists", traversing the current sector bit block, finding the position with the target value, and taking the sector corresponding to the position in the corresponding second target load block as the sector to be fused.
Since the load block size of the parent image is an integer multiple of the load block size of the child image, the data block fusing unit of this embodiment fuses the first target load block of the child image to the corresponding area in the load block corresponding to the parent image, and fuses the sector to be fused in the second target load block of the child image to the corresponding sector in the load block corresponding to the parent image, when configured to execute:
according to the size relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, establishing the corresponding relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, wherein each load block of the parent mirror image corresponds to at least two load blocks of the child mirror image;
traversing each load block of the child mirror image, if the current load block is a first target load block, writing data of the current load block into a corresponding area in a load block corresponding to the parent mirror image, and if the current load block is a second target load block, writing data of a sector to be fused in the current load block into a corresponding sector in the load block corresponding to the parent mirror image.
The foregoing is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. While the invention has been described with reference to preferred embodiments, it is not intended to be limiting. Therefore, any simple modification, equivalent variation and modification of the above embodiments according to the technical substance of the present invention shall fall within the scope of the technical solution of the present invention.

Claims (8)

1. The stream loading-oriented mirror image fusion method is characterized by comprising the following steps of:
s1) acquiring a data packet loaded in a streaming mode until a complete sub-mirror image is obtained, and analyzing the sub-mirror image to obtain a block allocation table and system metadata of the sub-mirror image;
s2) obtaining the state of a corresponding load block in the system metadata according to the table entry of the block allocation table, and determining the state of a corresponding sector bit block in the system metadata according to the state of the load block;
s3) determining a first target load block according to the state of the load block, and determining a sector to be fused in a corresponding second target load block according to the state of a sector bit block, wherein the method specifically comprises the following steps:
if the current load block is in the state of 'the load block is completely existing', the current load block is a first target load block;
if the current load block is in the state of 'load block part exists', the current load block is a second target load block;
if the state of the current sector bit block is that the sector bit block exists, traversing the current sector bit block, finding the position with a target value, and taking the sector corresponding to the position in the corresponding second target load block as a sector to be fused;
s4) fusing the first target load block of the child image to the corresponding area in the corresponding load block of the parent image, and fusing the sector to be fused in the second target load block of the child image to the corresponding sector in the corresponding load block of the parent image.
2. The streaming load-oriented mirror fusion method according to claim 1, wherein the child mirror is a VHDX mirror, and the parsing the child mirror in step S1 includes:
loading a header of the VHDX mirror image file, verifying the correctness of the header, and reading an area table in the header after the verification is passed;
analyzing the file offset and the length of the block allocation table region through the block allocation table entries in the region table small region;
analyzing the file offset and the length of the metadata area through the metadata area entry of the small area of the area table;
and loading according to the file offset and the length of the block allocation table area to obtain a block allocation table, and loading according to the file offset and the length of the metadata area to obtain system metadata.
3. The stream-oriented loading mirror fusion method according to claim 1, wherein step S2 further comprises: and analyzing the file parameter entries of the system metadata to obtain the sizes of the load blocks and the sector bitmap blocks of the system metadata, and analyzing the entries of the logical sector sizes of the system metadata to obtain the sector sizes in each load block.
4. The stream-oriented loading mirror image fusion method according to claim 1, wherein the sector bitmap block manages at least two load blocks, and determining the state of the corresponding sector bitmap block in the system metadata according to the state of the load block in step S2 specifically comprises: if the load block with the status of 'load block part exists' does not exist in the load blocks managed by the current sector bitmap block, the status of the current sector bitmap block is 'sector bitmap block does not exist'; if the load block with the status of "load block part exists" exists in the load blocks managed by the current sector bitmap block, the status of the current sector bitmap block is "sector bitmap block exists".
5. The stream-oriented loading image fusion method according to claim 1, wherein the load block size of the parent image is an integer multiple of the load block size of the child image, and step S4 specifically includes:
according to the size relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, establishing the corresponding relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, wherein each load block of the parent mirror image corresponds to at least two load blocks of the child mirror image;
traversing each load block of the child mirror image, if the current load block is a first target load block, writing data of the current load block into a corresponding area in a load block corresponding to the parent mirror image, and if the current load block is a second target load block, writing data of a sector to be fused in the current load block into a corresponding sector in the load block corresponding to the parent mirror image.
6. A stream-oriented loading mirror fusion system, comprising:
the metadata analysis unit is used for acquiring the data packet loaded in the streaming mode until a complete sub-mirror image is obtained, and analyzing the sub-mirror image to obtain system metadata of the block allocation table and the sub-mirror image;
the data block analysis unit is used for obtaining the state of the corresponding load block in the system metadata according to the table entry of the block allocation table, and determining the state of the corresponding sector bit block in the system metadata according to the state of the load block; the method is also used for determining a first target load block according to the state of the load block, and determining the sector to be fused in the corresponding second target load block according to the state of the sector bit block, and specifically comprises the following steps:
if the current load block is in the state of 'the load block is completely existing', the current load block is a first target load block;
if the current load block is in the state of 'load block part exists', the current load block is a second target load block;
if the state of the current sector bit block is that the sector bit block exists, traversing the current sector bit block, finding the position with a target value, and taking the sector corresponding to the position in the corresponding second target load block as a sector to be fused;
the data block fusion unit is used for fusing the first target load block of the child image to the corresponding area in the corresponding load block of the parent image, and fusing the sector to be fused in the second target load block of the child image to the corresponding sector in the corresponding load block of the parent image.
7. The stream-oriented loading mirror fusion system of claim 6, wherein the child mirror is a VHDX mirror, and wherein the metadata parsing unit, when parsing the child mirror, is configured to perform:
loading a header of the VHDX mirror image file, verifying the correctness of the header, and reading an area table in the header after the verification is passed;
analyzing the file offset and the length of the block allocation table region through the block allocation table entries in the region table small region;
analyzing the file offset and the length of the metadata area through the metadata area entry of the small area of the area table;
and loading according to the file offset and the length of the block allocation table area to obtain a block allocation table, and loading according to the file offset and the length of the metadata area to obtain system metadata.
8. The stream-oriented loading mirror image fusing system of claim 6, wherein the load block size of the parent mirror image is an integer multiple of the load block size of the child mirror image, the data block fusing unit fusing a first target load block of the child mirror image to a corresponding region in a corresponding load block of the parent mirror image, and fusing a sector to be fused in a second target load block of the child mirror image to a corresponding sector in a corresponding load block of the parent mirror image, is configured to perform:
according to the size relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, establishing the corresponding relation between the load blocks of the parent mirror image and the load blocks of the child mirror image, wherein each load block of the parent mirror image corresponds to at least two load blocks of the child mirror image;
traversing each load block of the child mirror image, if the current load block is a first target load block, writing data of the current load block into a corresponding area in a load block corresponding to the parent mirror image, and if the current load block is a second target load block, writing data of a sector to be fused in the current load block into a corresponding sector in the load block corresponding to the parent mirror image.
CN202211311844.9A 2022-10-25 2022-10-25 Stream loading-oriented mirror image fusion method and system Active CN115509624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211311844.9A CN115509624B (en) 2022-10-25 2022-10-25 Stream loading-oriented mirror image fusion method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211311844.9A CN115509624B (en) 2022-10-25 2022-10-25 Stream loading-oriented mirror image fusion method and system

Publications (2)

Publication Number Publication Date
CN115509624A CN115509624A (en) 2022-12-23
CN115509624B true CN115509624B (en) 2023-04-28

Family

ID=84512540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211311844.9A Active CN115509624B (en) 2022-10-25 2022-10-25 Stream loading-oriented mirror image fusion method and system

Country Status (1)

Country Link
CN (1) CN115509624B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197022A (en) * 2017-06-02 2017-09-22 华南理工大学 OpenStack storage optimization methods and system
CN112597102A (en) * 2020-12-29 2021-04-02 武汉噢易云计算股份有限公司 High-efficiency mirror image file system implementation method
CN114003569A (en) * 2021-10-25 2022-02-01 武汉噢易云计算股份有限公司 Method and device for updating qcow2 mirror image file increment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929884B (en) * 2011-08-10 2016-05-04 阿里巴巴集团控股有限公司 A kind of method and device that shrinks virtual disk image file
CN102708060B (en) * 2012-05-14 2015-03-25 华为技术有限公司 Method, device and system for accessing image files
CN103631633B (en) * 2012-08-20 2017-04-12 中国电信股份有限公司 Virtual machine total-system online migration method, device and system
CN103885719B (en) * 2012-12-21 2017-02-08 中国电信股份有限公司 Device, system and method for online storage migration of virtual machine system
CN105760210A (en) * 2014-12-19 2016-07-13 中兴通讯股份有限公司 Fused use method and system of VOI system and VDI system
US9507673B1 (en) * 2014-12-19 2016-11-29 Emc Corporation Method and system for performing an incremental restore from block-based backup
CN106547641B (en) * 2015-09-17 2020-04-10 南京壹进制信息科技有限公司 CDP backup method based on volume
CN107273146B (en) * 2016-04-08 2021-11-19 中兴通讯股份有限公司 Virtual machine upgrading method and device
CN109614200A (en) * 2018-11-30 2019-04-12 四川巧夺天工信息安全智能设备有限公司 A method of extracting the hds mirror image data of Parallels Desktop virtual machine
CN112433810B (en) * 2020-11-05 2023-12-26 北京浪潮数据技术有限公司 Method and device for mirror image storage and pulling of docker container and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197022A (en) * 2017-06-02 2017-09-22 华南理工大学 OpenStack storage optimization methods and system
CN112597102A (en) * 2020-12-29 2021-04-02 武汉噢易云计算股份有限公司 High-efficiency mirror image file system implementation method
CN114003569A (en) * 2021-10-25 2022-02-01 武汉噢易云计算股份有限公司 Method and device for updating qcow2 mirror image file increment

Also Published As

Publication number Publication date
CN115509624A (en) 2022-12-23

Similar Documents

Publication Publication Date Title
US11409705B2 (en) Log-structured storage device format
CN110531940B (en) Video file processing method and device
US20190050421A1 (en) Fast Recovery Using Self-Describing Replica Files In A Distributed Storage System
CN111212111B (en) Object storage service management method and electronic equipment
US9104511B2 (en) Method and computation node for processing application data
US8732427B2 (en) Systems and methods for collapsing a derivative version of a primary storage volume
CN111711801B (en) Video data transmission method, device, server and computer readable storage medium
CN111736945A (en) Virtual machine thermal migration method, device, equipment and medium based on intelligent network card
US11150981B2 (en) Fast recovery from failures in a chronologically ordered log-structured key-value storage system
US20190243807A1 (en) Replication of data in a distributed file system using an arbiter
CN112148206A (en) Data reading and writing method and device, electronic equipment and medium
CN115509624B (en) Stream loading-oriented mirror image fusion method and system
US9535713B2 (en) Manipulating rules for adding new devices
CN117608856A (en) Memory expansion method, system, terminal and storage medium for NVMe (network video Me) acceleration card
US20200034277A1 (en) Method for performance analysis in a continuous integration pipeline
CN111737223B (en) File copying method, device, equipment and storage medium
CN113986878A (en) Data writing method, data migration device and electronic equipment
CN117009308B (en) Executable file loading method and system based on compatible layer
CN113590309B (en) Data processing method, device, equipment and storage medium
US11983147B2 (en) Deduplicating data integrity checks across systems
CN115529332B (en) Cloud car machine system for car machine central control and remote access method
CN115454827B (en) Compatibility detection method, system, equipment and medium
US11385816B2 (en) Systems and methods for implementing improved links between paths of one or more file systems
EP4258122A1 (en) File access method, storage node, and network card
US20240045766A1 (en) Data acquisition apparatus, data acquisition method, and data acquisition program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant