CN114579520A - Mirror image data processing method, mirror image data loading method and device - Google Patents

Mirror image data processing method, mirror image data loading method and device Download PDF

Info

Publication number
CN114579520A
CN114579520A CN202210214021.8A CN202210214021A CN114579520A CN 114579520 A CN114579520 A CN 114579520A CN 202210214021 A CN202210214021 A CN 202210214021A CN 114579520 A CN114579520 A CN 114579520A
Authority
CN
China
Prior art keywords
image data
mirror image
index information
file
layer
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.)
Granted
Application number
CN202210214021.8A
Other languages
Chinese (zh)
Other versions
CN114579520B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210214021.8A priority Critical patent/CN114579520B/en
Publication of CN114579520A publication Critical patent/CN114579520A/en
Application granted granted Critical
Publication of CN114579520B publication Critical patent/CN114579520B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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/45562Creating, deleting, cloning 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)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a mirror image data processing method, a mirror image data loading device, equipment, a storage medium and a program product, and relates to the technical field of cloud computing. The specific implementation scheme is as follows: acquiring a plurality of layer files in original mirror image data; storing the plurality of layer files to a file memory to obtain layer file index information corresponding to the plurality of layer files; generating configuration mirror image data according to the layer file index information; adding mirror image data index information corresponding to the configured mirror image data in the original mirror image data to obtain target mirror image data; and storing the configuration image data and the target image data.

Description

Mirror image data processing method, mirror image data loading method and device
Technical Field
The present disclosure relates to the field of cloud computing technology.
Background
With the large-scale popularization of the cloud native technology, the application range of the container in the enterprise is wider and wider. In an actual business scenario, a user may want to quickly start a container to provide a corresponding service using the container. When the container is started, the container needs to be created, and mirror data is loaded into the container. When the size of the mirror image data is large, for example, reaches a GB (gigabyte) level, the process of downloading and decompressing the mirror image data is time consuming, which may result in the starting time of the container failing to meet the requirements of the service.
Disclosure of Invention
The present disclosure provides a mirror image data processing method, a mirror image data loading method, an apparatus, a device, a storage medium, and a program product.
According to an aspect of the present disclosure, there is provided a mirror image data processing method, including: acquiring a plurality of layer files in original mirror image data; storing the layer files to a file memory to obtain layer file index information corresponding to the layer files; generating configuration mirror image data according to the layer file index information; adding mirror image data index information corresponding to the configured mirror image data in the original mirror image data to obtain target mirror image data; and storing the configuration image data and the target image data.
According to another aspect of the present disclosure, there is provided a mirror data loading method, including: creating an original container; determining whether the target mirror image data corresponding to the original container is configured with mirror image data index information; under the condition that mirror image data index information is determined to be configured in the target mirror image data, acquiring configuration mirror image data corresponding to the target mirror image data according to the mirror image data index information, wherein the configuration mirror image data comprises layer file index information; acquiring a layer file corresponding to the target mirror image data from a file storage according to the layer file index information; and loading the layer file into the origin container.
According to an aspect of the present disclosure, there is provided a mirrored data processing apparatus including: the extraction module is used for acquiring a plurality of layer files in the original mirror image data; the first storage module is used for storing a plurality of layer files in original mirror image data to a file storage to obtain layer file index information corresponding to the layer files; the generating module is used for generating configuration mirror image data according to the layer file index information; the adding module is used for adding mirror image data index information corresponding to the configured mirror image data in the original mirror image data to obtain target mirror image data; and the second storage module is used for storing the configuration mirror image data and the target mirror image data.
According to another aspect of the present disclosure, there is provided an image data loading apparatus including: a creation module for creating an original container; the determining module is used for determining whether the target mirror image data corresponding to the original container is configured with mirror image data index information or not; the first acquisition module is used for acquiring configuration mirror image data corresponding to the target mirror image data according to mirror image data index information under the condition that the target mirror image data is determined to be configured with mirror image data index information, wherein the configuration mirror image data comprises layer file index information; the second acquisition module is used for acquiring the layer file corresponding to the target mirror image data from a file storage according to the layer file index information; and the loading module is used for loading the layer file into the original container.
Another aspect of the present disclosure provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the embodiments of the present disclosure.
According to another aspect of the disclosed embodiments, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method shown in the disclosed embodiments.
According to another aspect of the embodiments of the present disclosure, there is provided a computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the steps of the method shown in the embodiments of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic view of an application scenario of a mirror image data processing method, a mirror image data loading method, an apparatus, an electronic device, and a storage medium according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a mirrored data processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a mirrored data loading method according to an embodiment of the disclosure;
FIG. 4 schematically illustrates a method of storing a plurality of layer files in original mirrored data to a file storage according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a method of generating configuration mirror data according to an embodiment of the disclosure;
FIG. 6 schematically shows a schematic diagram of mirrored data processing according to another embodiment of the present disclosure;
FIG. 7 schematically illustrates a diagram of mirrored data loading according to another embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of a mirrored data processing apparatus in accordance with an embodiment of the present disclosure;
FIG. 9 schematically illustrates a block diagram of a mirrored data loading apparatus according to an embodiment of the present disclosure; and
FIG. 10 schematically shows a block diagram of an example electronic device that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Application scenarios of the mirror image data processing method, the mirror image data loading method and the mirror image data loading device provided by the present disclosure will be described below with reference to fig. 1.
Fig. 1 is a schematic view of an application scenario of a mirror image data processing method, a mirror image data loading method, an apparatus, an electronic device, and a storage medium according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the application scenario 100 includes a container management platform 110, an image repository 120, and a file store 130.
According to embodiments of the present disclosure, the container management platform 110 may be used to manage containerized applications deployed on hosts. The container management platform 110 may include, for example, an EKS (Elastic Kubernets Service) platform.
Mirror repository 120 is a repository or collection of repositories that may be used to store mirrored data needed by a containerized application. Mirror store 120 may comprise, for example, a hardor mirror store.
The file storage 130 may be used to store various file data, such as may be used to store layer files in a container. The file storage 130 may include, for example, an Elastic Block Storage (EBS) system.
According to embodiments of the present disclosure, file store 130 and mirror store 120 may be located remotely from container management platform 110. Container management platform 110 may interact with file store 130 and mirror store 120 over a network.
According to an embodiment of the present disclosure, a user may upload or create primary mirror data through the container management platform 110 and then store the primary mirror data. Wherein the original image comprises a plurality of layer files. When storing the original image, the plurality of layer files in the original image data may be stored in the file memory 130, and layer file index information corresponding to the plurality of layer files may be obtained. Configuration mirror data is then generated based on indexing information according to the layer file. And adding mirror image data index information corresponding to the configured mirror image data in the original mirror image data to obtain target mirror image data. The configuration image data and the target image data are stored to image repository 120.
According to an embodiment of the present disclosure, a user may create an original container through the container management platform 110. The container management platform 110 may determine whether the target mirrored data corresponding to the primary container is configured with mirrored data index information. And under the condition that the target mirror image data is determined to be configured with the mirror image data index information, acquiring configuration mirror image data corresponding to the target mirror image data according to the mirror image data index information, wherein the configuration mirror image data comprises layer file index information. And then, according to the layer file index information, acquiring a layer file corresponding to the target mirror image data from the file storage. The layer file is then loaded into the origin container.
In the related art, when mirror image data is loaded into a container, the mirror image data needs to be decompressed to obtain a layer file in the mirror image data, and then the layer file is loaded into the container, so that the decompression time is long, and the loading time of the mirror image data is long.
According to the embodiment of the disclosure, the layer file in the mirror image data is stored in the file memory, and when the mirror image is loaded, the layer file can be directly obtained from the file memory without decompression, so that the loading time of the mirror image data can be shortened.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the related data such as the mirror image data and the like all accord with the regulations of related laws and regulations, and do not violate the good custom of the public order.
Fig. 2 schematically shows a flow chart of a mirrored data processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the mirror data processing method includes acquiring a plurality of layer files in original mirror data in operation S210.
According to the embodiment of the disclosure, for example, the original mirror image data may be decompressed to obtain a plurality of layer files in the original mirror image data.
In operation S220, a plurality of layer files in the original mirror image data are stored in the file storage, and layer file index information corresponding to the plurality of layer files is obtained.
According to an embodiment of the present disclosure, the layer file index information may include unique identifications of the plurality of layer files in the file storage. The layer file index information may point to the plurality of layer files, and the plurality of layer files may be found in the file storage according to the layer file index information.
For example, in the present embodiment, hash values corresponding to a plurality of layer files may be generated as layer file index information by the file storage, for example.
Then, in operation S230, configuration image data is generated according to the layer file index information.
According to the embodiment of the present disclosure, for example, mirror image data including index information of a layer file may be generated as configuration mirror image data.
In operation S240, mirror image data index information corresponding to the configured mirror image data is added to the original mirror image data to obtain target mirror image data.
According to the embodiment of the disclosure, mirror data index information can be set for configuration mirror data, and the mirror data index information points to the configuration mirror data. For example, in this embodiment, the mirror data index information may include, for example, a mirror identifier configuring the mirror data.
In operation S250, the configuration image data and the target image data are stored.
According to embodiments of the present disclosure, for example, configuration mirror data and target mirror data may be stored to a mirror repository. It is understood that, in an actual application scenario, the configuration image data and the target image data may also be stored in other devices besides the image repository, and this disclosure does not specifically limit this.
According to the embodiment of the disclosure, the layer files in the mirror data are extracted and stored in the file storage. Therefore, when the mirror image is loaded, the layer file can be directly obtained from the file memory without decompression, and the loading time of the mirror image can be shortened.
Fig. 3 schematically illustrates a mirrored data loading method according to an embodiment of the present disclosure.
As shown in fig. 3, the mirrored data loading method includes creating a raw container in operation S310.
According to an embodiment of the present disclosure, a container corresponding to a container creation request, i.e., an original container, may be created in response to the container creation request of a user.
In operation S320, it is determined whether the target mirror data corresponding to the primary container is configured with mirror data index information. In the case where it is determined that the target mirror data is configured with the mirror data index information, operations S330 to S350 are performed. In the case where it is determined that the target mirror data is not configured with the mirror data index information, operations S360 to S370 are performed.
According to an embodiment of the present disclosure, the target mirrored data may be mirrored data to be loaded into the primary container. The mirror data index information may be used to point to configuration mirror data corresponding to the target mirror data. And if the target mirror image data is configured with the mirror image data index information, indicating that the configured mirror image data corresponding to the target mirror image data exists.
In operation S330, configuration mirror data corresponding to the target mirror data is acquired according to the mirror data index information.
According to an embodiment of the present disclosure, the configuration image data includes layer file index information. The layer file index information may be used to point to a layer file in the file store that corresponds to the target image data.
In operation S340, a layer file corresponding to the target mirror data is acquired from the file storage according to the layer file index information.
In operation S350, the layer file is loaded into the origin container.
Operation S350, for example, includes adding the target layer file and the merge layer file to a root directory location of the original container, according to an embodiment of the present disclosure.
According to the embodiment of the disclosure, according to the layer file index information in the configuration mirror image data, the corresponding layer file can be directly obtained from the file storage, and the layer file is loaded into the original container without decompressing the data, so that the loading time of the mirror image can be shortened.
In operation S360, the target image data is downloaded.
In operation S370, the target image data is loaded into the primary container.
According to an embodiment of the present disclosure, if the target image data is not configured with the image data index information, the target image data may be downloaded. And decompressing the target mirror image data to obtain layer files in the target mirror image data, and loading the layer files into the original container to finish the loading of the mirror image data.
According to another embodiment of the present disclosure, since the target mirror image data also retains the layer file in the original mirror image data, the target mirror image data can be downloaded and then loaded into the original container under the condition that the layer file in the file memory cannot be obtained, so that the loading success rate of the mirror image data can be improved.
According to an embodiment of the present disclosure, in the mirror data processing, for example, a comment field (annotation) may be added to the original mirror data, and then mirror data index information may be added to the comment field.
Correspondingly, according to an embodiment of the present disclosure, at the time of loading the mirror data, for example, a comment field in the target mirror data may be read. And then searching whether mirror data index information exists in the comment field. And determining that the mirror image data is configured with the mirror image data index information under the condition that the mirror image data index information exists in the comment field.
According to another embodiment of the present disclosure, in the case that there are many layer files included in the mirror data, a large storage pressure is applied to the file storage in the process of storing the layer files in the file storage. Therefore, the layer files in the mirror image data can be merged, so that the data volume is reduced, and the storage pressure of the file memory is reduced.
Based on this, fig. 4 schematically shows a method for storing a plurality of layer files in original image data to a file storage according to an embodiment of the present disclosure.
As shown in fig. 4, the method 410 of storing a plurality of layer files in original image data to a file storage includes determining a target layer file of the plurality of layer files in operation S411.
According to the embodiment of the disclosure, the target layer file can be determined according to actual needs. For example, a layer file storing predetermined data among the plurality of layer files may be determined as a target layer file. Wherein the predetermined data can be determined according to actual needs. For another example, a layer file having a data size greater than a predetermined threshold value among the plurality of layer files may be determined as the target layer file. Wherein, the predetermined threshold value can be determined according to actual needs.
In operation S412, the layer files other than the target layer file are merged to obtain a merged layer file.
According to the embodiment of the disclosure, for example, the objects with the same name in other layer files can be merged, and the files with the same name in other layer files are covered to obtain the merged layer file.
For example, in this embodiment, for example, the operation of merging other layer files may be performed by using the OverlayFS service, so as to obtain a merged layer file.
In operation S413, the target layer file and the merge layer file are stored to the file memory, and the index information of the target layer file and the index information of the merge layer file are obtained as layer file index information.
According to an embodiment of the present disclosure, the layer file index information includes index information of the target layer file and index information of the merge layer file. The index information of the target layer file is used for pointing to the target layer file in the file memory, and the index information of the merging layer file is used for pointing to the merging layer file in the file memory.
According to the embodiment of the disclosure, for example, a unique file identifier may be generated for the target layer file as the index information of the target layer file. In addition, a unique file identifier can be generated for the merge layer file as the index information of the merge layer file. The file identifier may be obtained by hash calculation, for example.
Correspondingly, according to the embodiment of the present disclosure, when the mirror image data is loaded, for example, the index information of the target layer file and the index information of the merge layer file included in the configuration mirror image data may be obtained by acquiring the configuration mirror image data corresponding to the target mirror image data. And then, acquiring the target layer file in the file memory according to the index information of the target layer file. And acquiring the merging layer file in the file storage according to the index information of the merging layer file.
FIG. 5 schematically shows a method of generating configuration mirror data according to an embodiment of the disclosure.
As shown in fig. 5, the method 520 of generating configuration image data includes creating configuration image data in operation S521.
According to an embodiment of the present disclosure, the configuration mirror data may include a first blank layer file and a second blank layer file. The contents of the first and second blank layer files are blank, i.e. do not contain actual data contents.
In operation S522, index information of the target layer file is written to the first blank layer file in the configuration image data.
According to an embodiment of the present disclosure, for example, a comment field may be added in the first blank layer file, and then index information of the target layer file is added to the comment field.
In operation S523, the index information of the merge layer file is written to the second blank layer file configuring the mirror data.
According to an embodiment of the present disclosure, for example, a comment field may be added in the second blank layer file, and then index information of the merge layer file is added to the comment field.
Correspondingly, according to the embodiment of the present disclosure, when the mirror image data is loaded, for example, the index information of the target layer file may be acquired from a first blank layer file configured with the mirror image data, and the index information of the merge layer file may be acquired from a second blank layer file configured with the mirror image data.
The mirror data processing method and the mirror data loading method shown above are further described with reference to fig. 6 to fig. 7 in combination with specific embodiments. Those skilled in the art will appreciate that the following example embodiments are only for the understanding of the present disclosure, and the present disclosure is not limited thereto.
For example, in this embodiment, the original image data, the configuration image data, and the target image data may include image data conforming to an Open Container Initiative (OCI) specification. The container may comprise, for example, a docker container.
FIG. 6 schematically shows a schematic diagram of mirrored data processing according to another embodiment of the present disclosure.
In FIG. 6, it is shown that a user can send a storage request for the original mirrored data. The image mark of the original image data is a, the original image data comprises layer files layer 1-layer n, and n is a positive integer greater than 2.
In response to receiving the storage request, the n-tier files in the original image may be obtained. A target tier file of the n tier files is then determined. For example, in this embodiment, a layer file layer n including base data in the n layer files may be determined as a target layer file. Then, other layer files except layer n in the multiple layer files can be merged to obtain a merged layer file layer'. And storing the target layer file layer n and the merging layer file layer' into a file memory to obtain index information flag of the target layer file and index information flag2 of the merging layer file as layer file index information.
Then, configuration mirror data is created. And configuring a mirror image identifier of mirror image data as b, wherein the configured mirror image data comprises a first blank layer file and a second blank layer file. The first blank layer file corresponds to layer n, and the index information flag of layer n may be written into the first blank layer file. The second blank layer file corresponds to layer 'and index information flag2 of layer' may be written in the second blank layer file.
Next, determining that the mirror identifier b of the configured mirror data is mirror data index information corresponding to the configured mirror data. Based on this, the mirror image identifier b can be added to the original mirror image data to obtain the target mirror image data, and the identifier of the target mirror image data is still a.
Next, the configuration mirror data and the target mirror data are stored to a mirror repository.
FIG. 7 schematically illustrates a diagram of mirrored data loading according to another embodiment of the present disclosure.
In fig. 7, it is shown that the user can send a container creation request for requesting creation of a container and loading the target mirrored data into the container. Wherein, the mirror image identification of the target mirror image data is a.
In response to receiving the container creation request, a container, i.e., an original container, may be created. Then, whether the target image data a to be downloaded is configured with the image data index information can be detected through a CRI (Container Runtime Interface) plugin. For example, in this embodiment, the comment field in the target image data a may be read, and whether the image data index information exists in the comment field may be found. If the mirror data index information exists in the comment field, the mirror data index information is configured on the target mirror data a. If the mirror data index information does not exist in the comment field, it indicates that the target mirror data a is not configured with the mirror data index information.
In addition, under the condition that the target mirror image data is determined to be configured with the mirror image data index information, whether the acquisition condition is met can be further checked. The obtaining condition may include, for example, whether a obtaining interface provided by the file storage is available, whether a snapshot module corresponding to the file storage is used, or the like. And under the condition that the acquisition bar is met, sending an image downloading request to the original container according to the image data index information.
And after receiving the mirror image downloading request with the mirror image data index information, the original container acquires mirror image data a 'according to the mirror image data index information and respectively processes each layer file of the mirror image data a'. For example, the layer file index information in the layer file layer 'of the acquired image data a' may include a download request of the layer file index information, and the download request is sent to the snapshot module.
The snapshot module detects that the downloading request carries layer file index information, acquires the unique identifier of the layer 'corresponding to the layer file according to the layer file index information, calls an acquisition interface of the file storage, mounts the layer' of the file storage to a local position corresponding to the original container, such as a root directory position, and returns that data already exists.
Likewise, layer n in the file store may also be mounted to a local location corresponding to the original container.
When the original container detects that the layer files layer' and layer n in the local position exist, the downloading process of the layer files in the target mirror image data is skipped, so that the loading time is saved.
FIG. 8 schematically shows a block diagram of a mirrored data processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 8, the mirrored data processing apparatus 800 includes an extracting module 810, a first storing module 820, a generating module 830, an adding module 840, and a second storing module 850.
And the extracting module 810 is configured to obtain a plurality of layer files in the original mirror image data.
The first storage module 820 is configured to store a plurality of layer files in the original mirror image data in a file storage, so as to obtain layer file index information corresponding to the plurality of layer files.
A generating module 830, configured to generate configuration mirror image data according to the layer file index information;
the adding module 840 is configured to add mirror image data index information corresponding to the configured mirror image data to the original mirror image data to obtain target mirror image data.
And a second storage module 850 for storing the configuration image data and the target image data.
Fig. 9 schematically shows a block diagram of a mirrored data loading apparatus according to an embodiment of the present disclosure.
As shown in fig. 9, the mirrored data loading apparatus 900 includes a creating module 910, a determining module 920, a first obtaining module 930, a second obtaining module 940, and a loading module 950.
A creating module 910 for creating an origin container.
The determining module 920 is configured to determine whether mirror data index information is configured in target mirror data corresponding to the primary container.
A first obtaining module 930, configured to, under a condition that it is determined that the target mirror image data is configured with the mirror image data index information, obtain, according to the mirror image data index information, configured mirror image data corresponding to the target mirror image data, where the configured mirror image data includes layer file index information.
The second obtaining module 940 is configured to obtain, according to the layer file index information, a layer file corresponding to the target mirror image data from the file storage.
A loading module 950 for loading the layer file into the origin container.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 10 schematically illustrates a block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the device 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 1001 executes the respective methods and processes described above, such as the mirror data processing method and the mirror data loading method. For example, in some embodiments, the mirrored data processing method and the mirrored data loading method may be implemented as computer software programs tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the mirrored data processing method and the mirrored data loading method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the mirrored data processing method and the mirrored data loading method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in a traditional physical host and a VPS service (Virtual Private Server, or VPS for short). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (14)

1. A mirror image data processing method comprises the following steps:
acquiring a plurality of layer files in original mirror image data;
storing the layer files to a file memory to obtain layer file index information corresponding to the layer files;
generating configuration mirror image data according to the layer file index information;
adding mirror image data index information corresponding to the configured mirror image data in the original mirror image data to obtain target mirror image data; and
and storing the configuration mirror image data and the target mirror image data.
2. The method of claim 1, wherein the storing the plurality of layer files in the original image data to a file storage comprises:
determining a target layer file of the plurality of layer files;
merging other layer files except the target layer file in the plurality of layer files to obtain a merged layer file; and
and storing the target layer file and the merging layer file into the file memory to obtain index information of the target layer file and index information of the merging layer file as the layer file index information.
3. The method of claim 2, wherein the generating configuration image data according to the layer file index information comprises:
creating configuration mirror image data, wherein the configuration mirror image data comprises a first blank layer file and a second blank layer file;
writing the index information of the target layer file into a first blank layer file in the configuration mirror image data; and
and writing the index information of the merging layer file into a second blank layer file in the configuration mirror image data.
4. The method of claim 1, wherein the adding of mirror data index information corresponding to the configuration mirror data to the original mirror data comprises:
adding a comment field in the original mirror image data; and
adding the mirrored data index information to the comment field.
5. A mirror image data loading method comprises the following steps:
creating an original container;
determining whether the target mirror image data corresponding to the original container is configured with mirror image data index information;
under the condition that mirror image data index information is determined to be configured in the target mirror image data, acquiring configuration mirror image data corresponding to the target mirror image data according to the mirror image data index information, wherein the configuration mirror image data comprises layer file index information;
according to the layer file index information, acquiring a layer file corresponding to the target mirror image data from a file storage; and
loading the layer file into the origin container.
6. The method of claim 5, wherein the determining whether target mirror data corresponding to the primary container is configured with mirror data index information comprises:
reading a comment field in the target mirror data;
searching whether the mirror image data index information exists in the comment field; and
and determining that the mirror data index information is configured for the target mirror data under the condition that the mirror data index information exists in the comment field.
7. The method of claim 5 or 6, wherein the layer file index information includes index information of a target layer file and index information of a merge layer file; the acquiring, from a file storage, a layer file corresponding to the target mirror image data according to the layer file index information includes:
acquiring the target layer file in a file memory according to the index information of the target layer file; and
and acquiring the merging layer file in the file memory according to the index information of the merging layer file.
8. The method of claim 7, wherein the loading the layer file into the origin container comprises:
adding the target layer file and the merge layer file to a root directory location of the original container.
9. The method of claim 5, further comprising:
downloading the target mirror image data under the condition that the layer file cannot be acquired from a file memory; and
and loading the target mirror image data into the primary container.
10. A mirrored data processing apparatus comprising:
the extraction module is used for acquiring a plurality of layer files in the original mirror image data;
the first storage module is used for storing a plurality of layer files in original mirror image data to a file storage to obtain layer file index information corresponding to the layer files;
the generating module is used for generating configuration mirror image data according to the layer file index information;
the adding module is used for adding mirror image data index information corresponding to the configured mirror image data in the original mirror image data to obtain target mirror image data; and
and the second storage module is used for storing the configuration mirror image data and the target mirror image data.
11. An mirrored data loading apparatus comprising:
a creation module for creating an original container;
the determining module is used for determining whether the target mirror image data corresponding to the original container is configured with mirror image data index information or not;
the first acquisition module is used for acquiring configuration mirror image data corresponding to the target mirror image data according to mirror image data index information under the condition that the target mirror image data is determined to be configured with mirror image data index information, wherein the configuration mirror image data comprises layer file index information;
the second acquisition module is used for acquiring the layer file corresponding to the target mirror image data from a file storage according to the layer file index information; and
and the loading module is used for loading the layer file into the original container.
12. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
13. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
14. A computer program product comprising computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the method of any of claims 1-9.
CN202210214021.8A 2022-03-04 2022-03-04 Mirror image data processing method, mirror image data loading method and device Active CN114579520B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210214021.8A CN114579520B (en) 2022-03-04 2022-03-04 Mirror image data processing method, mirror image data loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210214021.8A CN114579520B (en) 2022-03-04 2022-03-04 Mirror image data processing method, mirror image data loading method and device

Publications (2)

Publication Number Publication Date
CN114579520A true CN114579520A (en) 2022-06-03
CN114579520B CN114579520B (en) 2023-05-05

Family

ID=81779387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210214021.8A Active CN114579520B (en) 2022-03-04 2022-03-04 Mirror image data processing method, mirror image data loading method and device

Country Status (1)

Country Link
CN (1) CN114579520B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110659100A (en) * 2018-06-29 2020-01-07 华为技术有限公司 Container management method, device and equipment
CN112671892A (en) * 2020-12-22 2021-04-16 北京百度网讯科技有限公司 Data transmission method, data transmission device, electronic equipment, medium and computer program product
US20210216583A1 (en) * 2020-01-09 2021-07-15 Huazhong University Of Science And Technology Edge-computing-oriented construction method for container mirror image
CN113934510A (en) * 2021-10-18 2022-01-14 重庆紫光华山智安科技有限公司 Mirror image processing method and device, electronic equipment and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110659100A (en) * 2018-06-29 2020-01-07 华为技术有限公司 Container management method, device and equipment
US20210216583A1 (en) * 2020-01-09 2021-07-15 Huazhong University Of Science And Technology Edge-computing-oriented construction method for container mirror image
CN112671892A (en) * 2020-12-22 2021-04-16 北京百度网讯科技有限公司 Data transmission method, data transmission device, electronic equipment, medium and computer program product
CN113934510A (en) * 2021-10-18 2022-01-14 重庆紫光华山智安科技有限公司 Mirror image processing method and device, electronic equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ARKING: "Docker存储驱动-Overlay/Overlay2", 《HTTPS://ARKINGC.GITHUB.IO/2017/05/05/2017-05-05-DOCKER-FILESYSTEM-OVERLAY/》 *

Also Published As

Publication number Publication date
CN114579520B (en) 2023-05-05

Similar Documents

Publication Publication Date Title
CN108846753B (en) Method and apparatus for processing data
CN115237436A (en) Application deployment method and device, electronic equipment and readable storage medium
CN112671892B (en) Data transmission method, device, electronic equipment and medium
CN117289956B (en) Mirror image manufacturing method, apparatus, electronic device and storage medium
CN112433757A (en) Method and device for determining interface calling relationship
CN113495870A (en) Mirror image construction method and device, electronic equipment and storage medium
CN114579520B (en) Mirror image data processing method, mirror image data loading method and device
CN115904240A (en) Data processing method and device, electronic equipment and storage medium
CN113868254B (en) Method, device and storage medium for removing duplication of entity node in graph database
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN115617800A (en) Data reading method and device, electronic equipment and storage medium
CN115639966A (en) Data writing method and device, terminal equipment and storage medium
CN112714163B (en) Data transmission method, device, electronic equipment and medium
CN113326038A (en) Method, apparatus, device, storage medium and program product for providing service
CN113051504A (en) Document preview method, apparatus, device, storage medium and program product
CN112784596A (en) Method and device for identifying sensitive words
CN112925573B (en) Method, device, equipment and computer readable medium for loading web page
CN114327271B (en) Lifecycle management method, apparatus, device and storage medium
CN117931195A (en) Data dictionary processing method and device, electronic equipment and storage medium
CN116303258A (en) Method and device for constructing hash index of distributed storage system
CN115098444A (en) Directory data processing method and device, electronic equipment and storage medium
CN114218281A (en) Method and device for generating unique identification number
CN112947846A (en) Batch processing task execution method and device of object storage system and electronic equipment
CN116382787A (en) Method and device for loading animation in page, electronic equipment and readable storage medium

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