Mirror image data sharing system

By designing the mirror layer storage management module in a single airport scenario, the sharing of mirror storage resources between multiple container engines is achieved, and the problem of mirror storage redundancy is solved, and the efficiency of storage space usage and the process of mirror management is improved.

CN119883408APending Publication Date: 2025-04-25KYLAND TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411954563.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In a single airport scenario, multiple container engines store the same image independently, resulting in redundant image storage and wasted storage space.

Method used

A mirror data sharing system is designed, and a mirror layer storage management module is set up, which communicates and connects with the mirror layer storage module and each container engine respectively to realize unified management and sharing of mirror layer files.

Benefits of technology

It realizes the sharing of mirror storage resources between multiple container engines, improves the efficiency of storage space, and optimizes the process of mirror management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883408A_ABST
    Figure CN119883408A_ABST
Patent Text Reader

Abstract

The invention discloses a mirror image data sharing system, and belongs to the technical field of containers. The mirror image data sharing system comprises at least one container engine arranged in a user space; the mirror image layer storage management module is arranged in the user space or the kernel space and is in communication connection with each container engine; the mirror image layer storage module is arranged in the kernel space and is in communication connection with the mirror image layer storage management module; a target container engine in the at least one container engine is used for sending a first request to the mirror layer storage management module; the mirror image layer storage management module is used for accessing the mirror image layer storage module in response to the first request, and acquiring and sending a first guide corresponding to the first mirror image layer file to the target container engine based on the first request; the target container engine is further used for obtaining the first mirror image layer file based on the first guidance. According to the mirror image data sharing system, mirror image storage resource sharing and management of a multi-container engine in a stand-alone scene can be realized, so that the use efficiency of a storage space is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of container technology, and in particular, relates to a mirror data sharing system. Background Art

[0002] A container engine is a software system that provides all the functions and tools required to run containers, allowing developers and system administrators to efficiently use container technology to deploy, run, and maintain applications. In related technologies, container engines include Docker Engine, Containerd, CRI-O, and isula. Each container engine manages image storage differently. When there are multiple container engines in a single-machine scenario, each container engine stores a separate copy of the same image, resulting in image storage redundancy and wasted storage space. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes an image data sharing system that can realize the image storage resource sharing of multiple container engines in a single machine scenario, thereby improving the efficiency of storage space utilization and optimizing the image management process.

[0004] In a first aspect, the present application provides a mirror data sharing system, including:

[0005] At least one container engine, disposed in the user space;

[0006] An image layer storage management module is arranged in the user space or the kernel space and is respectively connected to each of the container engines for communication;

[0007] An image layer storage module is arranged in the kernel space and is communicatively connected with the image layer storage management module;

[0008] The target container engine in the at least one container engine is used to send a first request to the image layer storage management module, where the first request includes a request for obtaining a first image layer file;

[0009] The image layer storage management module is used to access the image layer storage module in response to the first request, and obtain and send a first instruction corresponding to the first image layer file to the target container engine based on the first request;

[0010] The target container engine is further configured to obtain the first image layer file based on the first guideline.

[0011] According to the image data sharing system of the present application, by setting an image layer storage management module that is respectively connected to the image layer storage module and each container engine in communication, when the target container engine is used to send a request for obtaining a first image layer file to the image layer storage management module, the image layer storage management module can be used to respond to the first request, access the image layer storage module, and based on the first request, obtain and send a first instruction corresponding to the first image layer file to the target container engine, and the target container engine can also be used to obtain the first image layer file based on the first instruction, which can realize the functional flow of each container engine for its own image layer file storage processing process in a single-machine multi-container engine scenario, thereby realizing unified processing of the image layer storage of multiple container engines based on the image layer storage management module, realizing image storage optimization in a single-machine multi-container engine scenario, thereby improving the utilization efficiency of storage space and optimizing the image management process.

[0012] According to one embodiment of the present application, the target container engine is further used to obtain a manifest file and a configuration file of the image to which the first image layer file belongs, obtain an index value of the first image layer file based on the manifest file and the configuration file, and send the first request to the image layer storage management module based on the index value.

[0013] According to an embodiment of the present application, the image layer storage management module is further used to query whether the first image layer file is stored in the image layer storage module, and based on the query situation, obtain and send the first instruction to the target container engine.

[0014] According to an embodiment of the present application, acquiring and sending the first directive to the target container engine based on the query situation includes:

[0015] When the image layer storage management module obtains the first image layer file by querying from the image layer storage module, sending a first instruction corresponding to the first image layer file to the target container engine;

[0016] If the image layer storage management module fails to obtain the first image layer file from the image layer storage module, the first image layer file is pulled from the remote warehouse, the first image layer file is stored in the image layer storage module, the reference information of the first image layer file is updated, and the first instruction corresponding to the first image layer file is sent to the target container engine.

[0017] According to an embodiment of the present application, the image layer storage management module is further used to update the reference information of the first image layer file based on the following steps:

[0018] When the image layer storage management module receives the first request sent by the target container engine, the reference count of the first image layer file is increased by one.

[0019] According to an embodiment of the present application, after acquiring the first image layer file based on the first guidance, the target container engine is further used to send a second request to the image layer storage management module, where the second request includes a request for deleting the second image layer file;

[0020] The image layer storage management module is further used to update the current reference information of the second image layer file in response to the second request, and perform a deletion response based on the current reference information of the second image layer file.

[0021] According to an embodiment of the present application, performing a deletion response based on the current reference information of the second image layer file includes:

[0022] When it is determined based on the current reference information of the second image layer file that none of the container engines references the second image layer file, the second image layer file is deleted from the image layer storage module.

[0023] According to an embodiment of the present application, performing a deletion response based on the current reference information of the second image layer file includes:

[0024] When it is determined based on the current reference information of the second image layer file that at least one other container engine references the second image layer file, the state in which the second image layer file is stored in the image layer storage module is maintained unchanged.

[0025] According to an embodiment of the present application, in response to the second request, updating the current reference information of the second image layer file includes:

[0026] When the image layer storage management module receives the second request sent by the target container engine, the reference count of the second image layer file is reduced by one, and the updated reference count is determined as the current reference information of the second image layer file.

[0027] According to one embodiment of the present application, it also includes:

[0028] A file system technology module is arranged in the kernel space, and the file system technology module is respectively communicated with each of the container engines and the image layer storage management module;

[0029] The target container engine is further used to send the first request to the file system technology module;

[0030] The file system technology module is used to receive and forward the first request to the image layer storage management module.

[0031] In a second aspect, the present application provides a computing device, on which the mirror data sharing system as described in the first aspect is deployed, and when the computing device is running, the operating logic involved in the mirror data sharing system is executed.

[0032] According to the computing device of the present application, by deploying an image data sharing system, the image data sharing system is provided with an image layer storage management module that is respectively connected to the image layer storage module and each container engine in communication. When the target container engine is used to send a request for obtaining a first image layer file to the image layer storage management module, the image layer storage management module can be used to respond to the first request, access the image layer storage module, and based on the first request, obtain and send a first instruction corresponding to the first image layer file to the target container engine, and the target container engine can also be used to obtain the first image layer file based on the first instruction. In a single-machine multi-container engine scenario, the functional flow of each container engine for the storage processing process of its own image layer file can be realized, so that unified processing of the image layer storage of multiple container engines can be realized based on the image layer storage management module, and image storage optimization in a single-machine multi-container engine scenario can be realized, thereby improving the efficiency of storage space utilization and optimizing the image management process.

[0033] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0034] By setting an image layer storage management module that is respectively connected to the image layer storage module and each container engine in communication, when the target container engine is used to send a request for obtaining a first image layer file to the image layer storage management module, the image layer storage management module can be used to respond to the first request, access the image layer storage module, and obtain and send a first instruction corresponding to the first image layer file to the target container engine based on the first request. The target container engine can also be used to obtain the first image layer file based on the first instruction. In a single-machine multi-container engine scenario, the functional flow of each container engine for its own image layer file storage processing process can be realized, so that unified processing of the image layer storage of multiple container engines can be achieved based on the image layer storage management module, and image storage optimization in a single-machine multi-container engine scenario can be achieved, thereby improving the efficiency of storage space utilization and optimizing the image management process.

[0035] Furthermore, by determining whether to pull the first image layer file from the remote warehouse to the image layer storage module based on querying whether the first image layer file exists in the image layer storage module, data duplication in the image layer storage module can be reduced, thereby saving storage space.

[0036] Furthermore, by increasing the reference count of the first image layer file by one when the image layer storage management module receives the first request sent by the target container engine, it is possible to monitor whether the first image layer file is referenced or not referenced by any container engine, thereby facilitating subsequent management of the image layer storage module.

[0037] Furthermore, when at least one container engine reference is determined by the current reference information of the second image layer file, retaining the second image layer file in the image layer storage module can reduce potential access conflicts and ensure the normal operation of other container engines that reference the second image layer file.

[0038] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0040] Figure 1 It is a structural diagram of a mirror data sharing system provided in an embodiment of the present application;

[0041] Figure 2 It is a flowchart of the mirror data processing method provided in an embodiment of the present application;

[0042] Figure 3 It is a structural diagram of a mirror data sharing system provided in an embodiment of the present application;

[0043] Figure 4 This is one of the flowcharts of the mirror data processing method provided in the embodiment of the present application;

[0044] Figure 5 This is the second flowchart of the mirror data processing method provided in the embodiment of the present application;

[0045] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0047] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0048] The mirror data sharing system provided by the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0049] like Figure 1 As shown, the image data sharing system includes: at least one container engine, an image layer storage management module and an image layer storage module.

[0050] Among them, at least one container engine can be set in the user space.

[0051] The image layer storage management module can be set in the user space or the kernel space, and is respectively communicated with each container engine.

[0052] The image layer storage module can be set in the kernel space and communicated with the image layer storage management module.

[0053] Among them, the user space is the space where user program codes run.

[0054] Kernel space is the space where kernel code runs.

[0055] During the actual execution process, when a process runs in kernel space, it is in kernel state, and when a process runs in user space, it is in user state. For program security, kernel space and user space are isolated so that when the user program crashes, it will not affect the kernel code running in kernel space.

[0056] It is understandable that the image layer storage management module is set in the user space, compared with the kernel space, which does not require the entire kernel to be recompiled, making it easier to implement and transplant. At the same time, virtual memory can also be used to save physical memory space.

[0057] It should be noted that a container can be understood as an independent, lightweight, and portable operating environment.

[0058] The container engine is a software system that manages the entire life cycle of containers and image storage, including creating, starting, stopping, moving or deleting containers, as well as image storage management operations such as pulling or deleting.

[0059] There are many types of container engines, for example, the container engine may include Docker Engine, Containerd, CRI-O or isula.

[0060] A container image is a static file and a template that must be prepared before starting a container.

[0061] A container image includes all the components required to run an application, which may include programs, libraries, resources, configurations, and configuration parameters required when the container is running.

[0062] Among them, the image of each container engine complies with the OCI standard specification, which defines the structure and format of container images and ensures interoperability and portability between different container engines.

[0063] The specification can include key parts such as the image's manifest file, configuration file, and image layer file.

[0064] The manifest file is used to provide the configuration and file system layer location information of the image. The file format is JSON, and each image stores a copy of the file.

[0065] The configuration file may include the execution parameters used by the image at runtime and ordered rootfs change information. The file type is JSON, and each image stores a copy of the file.

[0066] The image includes multiple image layers, wherein each image layer contains partial contents such as programs, libraries, resources, configurations or configuration parameters required for the container runtime of the image, and each image layer includes an image layer file for storing the above partial contents.

[0067] Each image can contain one or more image layer files.

[0068] Multiple containers created based on a container engine can share one image layer file.

[0069] During actual execution, the container engine can create, pull, or install an image when starting a container.

[0070] The container engine pulling the image may be a process of downloading the image from a remote repository to an image layer storage module of the container engine of the local host.

[0071] The image layer storage module is used to store image layer files.

[0072] It should be noted that before the image layer storage management module is set, different container engines do not interfere with each other in the management of their respective image layer storage modules.

[0073] It is understandable that before the image layer storage management module is set, the image layer files stored by the image layer storage modules of the multiple container engines in the same host scenario may be duplicated.

[0074] In the present application, the image layer storage management module can be used for management operations on the image layer storage module in a multi-container engine scenario.

[0075] It is understandable that if Figure 3 As shown, in the same host scenario, multiple container engines share one image layer storage module, and the image layer storage management module can be used for intelligent management between the multiple container engines and the image layer storage module.

[0076] The processing logic of at least one container engine, the image layer storage management module and the image layer storage module are described below respectively.

[0077] At least one container engine, an image layer storage management module, and an image layer storage module can be used to perform processing such as Figure 2 The mirror data processing method shown.

[0078] like Figure 2 As shown, the target container engine in at least one container engine is used to execute step 210, that is, to send a first request to the image layer storage management module; the image layer storage management module is used to execute step 220, that is, to respond to the first request, access the image layer storage module, and based on the first request, obtain and send a first instruction corresponding to the first image layer file to the target container engine; the target container engine is also used to execute step 230, that is, to obtain the first image layer file based on the first instruction.

[0079] Among them, the container engine may include one or more.

[0080] The target container engine may be any container engine among all container engines.

[0081] In step 210, each container engine may independently send a first request to the image layer storage management module.

[0082] The first request may be an index value of a first image layer file sent by the target container engine.

[0083] The index value may be a layer ID, a layer hash value, or other identifiers that can identify and distinguish the image layer files.

[0084] Different image layer files correspond to different index values.

[0085] The first request includes a request for obtaining a first image layer file.

[0086] The first image layer file may be an image layer file stored in an image layer storage module.

[0087] In some embodiments, the target container engine can also be used to obtain a manifest file and a configuration file of the image to which the first image layer file belongs, obtain an index value of the first image layer file based on the manifest file and the configuration file, and send a first request to the image layer storage management module based on the index value.

[0088] In this embodiment, it can be understood that the index value of the first image layer file can be obtained by the target container engine according to the manifest file and the configuration file of the image to which the first image layer file belongs.

[0089] During the actual execution process, the manifest file and the configuration file of the image to which the first image layer file belongs may be obtained by the target container engine from a remote warehouse, where the remote warehouse may include a private warehouse or a public warehouse.

[0090] According to the image data sharing system provided by the embodiment of the present application, the manifest file and the configuration file of the image to which the first image layer file belongs are obtained through the target container engine, and the index value of the first image layer file is obtained based on the manifest file and the configuration file, and a first request is sent to the image layer storage management module based on the index value, so that the first request corresponding to the first image layer file can be successfully obtained based on the manifest file and the configuration file of the image to which the first image layer file belongs, thereby improving the accuracy of the first image layer file obtained based on the subsequent query based on the first request.

[0091] In some embodiments, the mirror data sharing system may further include:

[0092] The file system technology module can be set in the kernel space and communicated with each container engine and the image layer storage management module respectively.

[0093] The target container engine may also be used to send a first request to the file system technology module;

[0094] The file system technology module can be used to receive and forward the first request to the image layer storage management module.

[0095] In this embodiment, the file system technology is a framework that allows user space programs to provide file system functionality.

[0096] The file system technology module may be a module built based on one or more file system technologies.

[0097] For example, the file system technology module may be a module built based on one of FUSE, OverlayFS or CephFS; or, it may be a module built based on a combination of FUSE, OverlayFS or CephFS, etc., and may be specifically set according to specific application scenarios and performance requirements.

[0098] In the actual implementation process, various customized file systems can be created based on the file system technology module, which can access remote file storage, encrypted files or network file systems.

[0099] like Figure 1 As shown, the file system technology module can be set in the kernel space and communicated with at least one container engine and the image layer storage management module.

[0100] During the actual execution process, the file system technology module can realize the mounting of each container engine to its own image layer file directory in a single-machine multi-container engine scenario, and can receive the first request sent by the target container engine, and then forward the first request to the image layer storage management module.

[0101] According to the image data sharing system provided by the embodiment of the present application, by setting a file system technology module in the kernel space that is communicatively connected to at least one container engine and the image layer storage management module, it is possible to mount the image layer file directories of multiple container engines, save storage space, and allow programs in the user space to present data in the form of a file system, thereby providing a high degree of flexibility and scalability.

[0102] In step 220, the first indicator is a storage address indicator corresponding to the first image layer file.

[0103] It can be understood that after the image layer storage management module receives the first request sent by the target container engine, it can respond to the first request, access the image layer storage module, and obtain and send the storage address guidance of the first image layer file to the target container engine based on the first request.

[0104] It should be noted that the image layer storage module can store image layer files and index values ​​(layer IDs or layer hash values, etc.) corresponding to the image layer files.

[0105] During the actual execution process, the image layer storage management module can query the image layer storage module for the image layer file that matches the index value corresponding to the first request based on the first request, thereby determining the matching image layer file as the first image layer file, and obtaining the storage address of the first image layer file, and then sending the instruction corresponding to the storage address, that is, the first instruction, to the target container engine, so that the target container engine can obtain the first image layer file.

[0106] In some embodiments, when a file system technology module is set in the kernel space to communicate with at least one container engine and the image layer storage management module, the first instruction can be sent by the image layer storage management module to the file system technology module, and then forwarded by the file system technology module to the target container engine.

[0107] In step 230, obtaining the first image layer file based on the first guideline can be understood as implementing a reference to the first image layer file based on the first guideline; wherein, the reference can be understood as using the first image layer file based on the first guideline when the target container engine creates an image. In the subsequent description, referencing the first guideline is considered to be referencing the first image layer file.

[0108] During the research and development process, the inventors discovered that each container engine manages image storage differently. When there are multiple container engines in a single-machine scenario, each container engine stores a separate copy of the same image, resulting in image storage redundancy. In the prior art, image storage optimization technologies for this problem mainly include image storage sharing optimization under multiple hosts between different hosts, or storage optimization between image layers in a single-machine single-container engine scenario, but do not consider the image storage sharing problem in a multi-container engine scenario in a single-machine environment.

[0109] In the present application, by setting an image layer storage management module that is respectively connected to the image layer storage module and each container engine in communication, when the target container engine is used to send a request for obtaining a first image layer file to the image layer storage management module, the image layer storage management module can be used to respond to the first request, access the image layer storage module, and based on the first request, obtain and send a first instruction corresponding to the first image layer file to the target container engine, and the target container engine can also be used to obtain the first image layer file based on the first instruction, which can break the barrier of image storage resource sharing of each container engine under a single-machine multi-container engine, and realize the functional flow of each container engine for its own image layer file storage processing process in a single-machine multi-container engine scenario, so that unified processing of the image layer storage of multiple container engines can be realized based on the image layer storage management module, and image storage optimization in a single-machine multi-container engine scenario can be realized, thereby improving the efficiency of storage space utilization and optimizing the image management process.

[0110] According to the image data sharing system provided by the embodiment of the present application, by setting an image layer storage management module that is respectively connected to the image layer storage module and each container engine in communication, when the target container engine is used to send a request for obtaining a first image layer file to the image layer storage management module, the image layer storage management module can be used to respond to the first request, access the image layer storage module, and based on the first request, obtain and send a first instruction corresponding to the first image layer file to the target container engine, and the target container engine can also be used to obtain the first image layer file based on the first instruction, which can realize the functional flow of each container engine for the storage processing process of its own image layer file in a single-machine multi-container engine scenario, thereby realizing unified processing of the image layer storage of multiple container engines based on the image layer storage management module, realizing image storage optimization in a single-machine multi-container engine scenario, thereby improving the utilization efficiency of storage space and optimizing the image management process.

[0111] In some embodiments, the image layer storage management module may also be used to query whether the first image layer file is stored in the image layer storage module, and based on the query situation, obtain and send a first instruction to the target container engine.

[0112] In this embodiment, it can be understood that when the target container engine needs to access the image layer storage module, the image layer storage management module can receive a first request from the target container engine, and based on the first request, query the index value corresponding to each image layer file stored in the image layer storage module, and then based on the query result, obtain and send the storage address guidance corresponding to the first image layer file to the target container engine.

[0113] like Figure 4 As shown, the query result may include: finding that the image list of the image layer storage module stores the first image layer file; or not finding that the image list of the image layer storage module stores the first image layer file.

[0114] In the actual execution process, the query results are different, and the image layer storage management module obtains the first guide in different ways.

[0115] According to the image data sharing system provided by the embodiment of the present application, the image layer storage management module queries whether the first image layer file is stored in the image layer storage module based on the first request, and then obtains and sends the first guidance corresponding to the first image layer file to the target container engine based on the query situation. It can realize multiple ways for the image layer storage management module to obtain the first guidance based on the query result, thereby improving the flexibility and adaptability of the image layer storage management module.

[0116] In some embodiments, based on the query situation, obtaining and sending the first instruction to the target container engine may include:

[0117] When the image layer storage management module obtains the first image layer file from the image layer storage module through query, the first instruction corresponding to the first image layer file is sent to the target container engine;

[0118] When the image layer storage management module fails to obtain the first image layer file from the image layer storage module, the first image layer file is pulled from the remote warehouse, the first image layer file is stored in the image layer storage module, the reference information of the first image layer file is updated, and the first instruction corresponding to the first image layer file is sent to the target container engine.

[0119] In this embodiment, the first image layer file is pulled from the remote warehouse, and the first image layer file is downloaded to the image storage module of the local container engine.

[0120] Reference information can be used to indicate that the image layer file is referenced by the container engine.

[0121] In the actual execution process, any achievable reference information can be used to indicate that the image layer file is referenced by the container engine.

[0122] For example, a text mark is provided for the referenced image layer file, and the content of the text mark may be the name or ID of the container engine that references the image layer file. Then, the method for updating the reference information may be to update the content of the text mark.

[0123] In some embodiments, the reference information may also be other forms of information, which will be specifically described in the following embodiments and will not be elaborated in this application.

[0124] During the actual execution process, after querying that the first image layer file is stored in the image list of the image layer storage module, the image layer storage management module can directly send the first instruction corresponding to the first image layer file to the target container engine without the need to repeatedly download it from the remote warehouse; if the first image layer file is not found, the first image layer file can be pulled from the remote warehouse, downloaded to the image layer storage module, and the reference information of the first image layer file is updated, and then the first instruction corresponding to the first image layer file is sent to the target container engine.

[0125] According to the image data sharing system provided in the embodiment of the present application, by deciding whether to pull the first image layer file from the remote warehouse to the image layer storage module based on querying whether the first image layer file exists in the image layer storage module, data duplication in the image layer storage module can be reduced, thereby saving storage space.

[0126] In some embodiments, the image layer storage management module may also be used to update the reference information of the first image layer file based on the following steps:

[0127] When the image layer storage management module receives the first request sent by the target container engine, the reference count of the first image layer file is increased by one.

[0128] In this embodiment, the reference information may include a reference object and a reference count, etc., and it can be determined based on the reference information whether the first image layer file is referenced or not referenced by any container engine.

[0129] The reference object is each container engine that references the image layer file.

[0130] The reference count may be the number of container engines that reference the image layer file.

[0131] For example, when the first image layer file is referenced by 2, 3, or 4 container engines, the reference count of the first image layer file is 2, 3, or 4, etc.

[0132] It can be understood that when the image layer storage management module receives the first request sent by the target container engine, the reference count corresponding to the first image layer file can be increased by one, which can be used to indicate that the first image layer file is being referenced, and the number of container engines that reference the first image layer file can also be obtained.

[0133] According to the image data sharing system provided by the embodiment of the present application, by adding one to the reference count of the first image layer file when the image layer storage management module receives the first request sent by the target container engine, it is possible to monitor whether the first image layer file is referenced or not referenced by any container engine, thereby facilitating subsequent management of the image layer storage module.

[0134] In some embodiments, after obtaining the first image layer file based on the first instruction, the target container engine may also be used to send a second request to the image layer storage management module;

[0135] The image layer storage management module may also be used to update the current reference information of the second image layer file in response to the second request, and perform a deletion response based on the current reference information of the second image layer file.

[0136] In this embodiment, the second request includes a request for deleting the second image layer file.

[0137] The second request may be an index value of the second image layer file obtained by the target container engine based on a manifest file and a configuration file of the image to which the second image layer file belongs obtained from a remote repository.

[0138] The index value may be a layer ID, a layer hash value, or other identifiers that can identify and distinguish the image layer files.

[0139] The second image layer file is any image layer file stored in the image layer storage module.

[0140] The current reference information of the second image layer file may include: a container engine currently referencing the second image layer file and the number of container engines.

[0141] The request to delete the second image layer file may be a request for the target container engine to unbind the second image layer file in the image layer storage module; or, it may be a request for the target container engine to delete the second image layer file in the image layer storage module.

[0142] It can be understood that the image layer storage management module can respond to the second request, based on the current reference information corresponding to the second image layer file, unbind or delete the image layer file in the image layer storage module, and update the reference information corresponding to the second image layer file, and can perform a deletion response, that is, return the processing result based on the second request to the target container engine.

[0143] In some embodiments, the method for updating the reference information corresponding to the second image layer file can be: based on the number of second requests received by the image layer storage management module, the second image layer file is marked, and each time the image layer receives a second request, the mark of the second image layer file is increased by one accordingly, so as to facilitate the image layer file to perform corresponding operations based on the mark.

[0144] In some embodiments, other update methods may be used to update the reference information corresponding to the second image layer file, which will be specifically described in the following embodiments and will not be described in detail in this application.

[0145] During the actual execution process, the image layer storage management module can query the image layer file that matches the index value corresponding to the second request in the image layer storage module based on the second request, thereby determining the matching image layer file as the second image layer file, and obtaining the current reference information corresponding to the second image layer file. The current reference information of the second image layer file is different, and the operation performed by the image layer storage management module is different.

[0146] According to the image data sharing system provided by the embodiment of the present application, after obtaining the first image layer file based on the first guide, the target container engine can also be used to send a second request to the image layer storage management module, and the image layer storage management module can also be used to respond to the second request, update the current reference information of the second image layer file, and perform a deletion response based on the current reference information of the second image layer file. This can realize multiple response methods of the image layer storage management module to the request to delete the image layer file based on the reference information, thereby improving the flexibility and reliability of the image layer storage management module.

[0147] In some embodiments, based on the current reference information of the second image layer file, performing a deletion response may include:

[0148] When it is determined based on the current reference information of the second image layer file that each container engine does not reference the second image layer file, the second image layer file is deleted from the image layer storage module.

[0149] In this embodiment, during the actual execution, Figure 5 As shown, the image layer storage management module responds to the second request when the target container engine deletes the second image layer file, first obtains the current reference information of the second image layer file, and deletes the second image layer file from the image layer storage module in response to the second request when it is determined that the second image layer file is not referenced by any container engine.

[0150] It should be noted that, from the moment the target container engine sends the second request to delete the second image layer file, it means that the target container engine no longer references the second image layer file.

[0151] According to the image data sharing system provided by the embodiment of the present application, when it is determined through the current reference information of the second image layer file that the second image layer file is not referenced by any container engine, the second image layer file is deleted from the image layer storage module, thereby deleting redundant image layer files that are not required by any container engine, increasing the storage space of the image layer storage module, and improving storage performance.

[0152] In some embodiments, based on the current reference information of the second image layer file, performing a deletion response may include:

[0153] When it is determined based on the current reference information of the second image layer file that at least one container engine references the second image layer file, the state in which the second image layer file is stored in the image layer storage module is maintained unchanged.

[0154] In the actual implementation process, Figure 5 As shown, when it is determined that the second image layer file is referenced by at least one container engine, the second image layer file in the image layer storage module can be retained so that other container engines can reference the second image layer file.

[0155] According to the image data sharing system provided by the embodiment of the present application, when at least one container engine reference is determined by the current reference information of the second image layer file, the second image layer file in the image layer storage module is retained, which can reduce potential access conflicts and ensure the normal operation of other container engines that reference the second image layer file.

[0156] In some embodiments, in response to the second request, updating the current reference information of the second image layer file may include:

[0157] When the image layer storage management module receives the second request sent by the target container engine, the reference count of the second image layer file is reduced by one, and the updated reference count is determined as the current reference information of the second image layer file.

[0158] In this embodiment, the reference count of the second image layer file is the number of container engines that reference the second image layer file.

[0159] Among them, a reference count of 0 may indicate that each container engine does not reference the second image layer file, and a reference count not being 0 may indicate that a container engine references the second image layer file.

[0160] In the actual implementation process, Figure 5 As shown, when the image layer storage management module receives the second request sent by the target container engine to delete the second image layer file, it first decrements the reference count of the second image layer file by one, and determines the updated reference count as the current reference information of the second image layer file. If the updated reference count is 0, the second image layer file is deleted from the image layer storage module; if the updated reference count is not 0, the second image layer file in the image layer storage module is retained so that other container engines can reference the second image layer file.

[0161] For example, a host includes three container engines, among which there are image layer file 1 and image layer file 2 in the image layer storage module, the reference count corresponding to image layer file 1 is 3, and the reference count corresponding to image layer file 2 is 1, that is, the three container engines all reference image layer file 1, and one container engine references image layer file 2. If the container engine that references image layer file 2 sends a request to delete image layer file 1 and image layer file 2, first, the reference counts corresponding to image layer file 1 and image layer file 2 are reduced by one and updated to 2 and 0, then image layer file 1 is retained in the image layer storage module, and image layer file 2 is deleted from the image layer storage module.

[0162] According to the image data sharing system provided by the embodiment of the present application, by using the updated reference count as the current reference information of the second image layer file, it is possible to clearly track how many container engines are currently referencing the second image layer file, thereby facilitating subsequent judgment based on the tracking results on whether to delete the second image layer file from the image layer storage module, thereby ensuring the normal operation of other container engines that reference the second image layer file and optimizing the process of deleting the image layer file.

[0163] An embodiment of the present application also provides a computing device.

[0164] In this embodiment, the computing device is deployed with the mirror data sharing system as described in any of the above embodiments. When the computing device is running, the operation logic involved in the mirror data sharing system as described in any of the above embodiments can be executed.

[0165] According to the computing device provided by the embodiment of the present application, an image data sharing system is deployed, and the image data sharing system is provided with an image layer storage management module that is respectively connected to the image layer storage module and each container engine in communication. When the target container engine is used to send a request for obtaining a first image layer file to the image layer storage management module, the image layer storage management module can be used to respond to the first request, access the image layer storage module, and obtain and send a first instruction corresponding to the first image layer file to the target container engine based on the first request. The target container engine can also be used to obtain the first image layer file based on the first instruction. In a single-machine multi-container engine scenario, the functional flow of each container engine for the storage processing process of its own image layer file can be realized, so that unified processing of the image layer storage of multiple container engines can be realized based on the image layer storage management module, and image storage optimization in a single-machine multi-container engine scenario can be realized, thereby improving the efficiency of storage space utilization and optimizing the image management process.

[0166] like Figure 6 As shown, the embodiment of the present application also provides an electronic device 600, including a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the program is executed by the processor 601, each process of the above-mentioned mirror data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0167] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0168] The embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned mirror data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0169] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0170] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned mirror data processing method when executed by a processor.

[0171] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0172] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned mirror data processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0173] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0174] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0175] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0176] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0177] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0178] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A mirror data sharing system, characterized in that: include: At least one container engine, disposed in the user space; An image layer storage management module is arranged in the user space or the kernel space and is respectively connected to each of the container engines for communication; An image layer storage module is arranged in the kernel space and is communicatively connected with the image layer storage management module; The target container engine in the at least one container engine is used to send a first request to the image layer storage management module, where the first request includes a request for obtaining a first image layer file; The image layer storage management module is used to access the image layer storage module in response to the first request, and obtain and send a first instruction corresponding to the first image layer file to the target container engine based on the first request; The target container engine is further configured to obtain the first image layer file based on the first guideline.

2. The mirror data sharing system according to claim 1, characterized in that: The target container engine is further used to obtain a manifest file and a configuration file of the image to which the first image layer file belongs, obtain an index value of the first image layer file based on the manifest file and the configuration file, and send the first request to the image layer storage management module based on the index value.

3. The mirror data sharing system according to claim 1, characterized in that: The image layer storage management module is further used to query whether the first image layer file is stored in the image layer storage module, and based on the query result, obtain and send the first instruction to the target container engine.

4. The mirror data sharing system according to claim 3, characterized in that: The acquiring and sending the first guidance to the target container engine based on the query situation includes: When the image layer storage management module obtains the first image layer file by querying from the image layer storage module, sending a first instruction corresponding to the first image layer file to the target container engine; If the image layer storage management module fails to obtain the first image layer file from the image layer storage module, the first image layer file is pulled from the remote warehouse, the first image layer file is stored in the image layer storage module, the reference information of the first image layer file is updated, and the first instruction corresponding to the first image layer file is sent to the target container engine.

5. The mirror data sharing system according to any one of claims 1 to 4, characterized in that: The image layer storage management module is further used to update the reference information of the first image layer file based on the following steps: When the image layer storage management module receives the first request sent by the target container engine, the reference count of the first image layer file is increased by one.

6. The mirror data sharing system according to any one of claims 1 to 4, characterized in that: After acquiring the first image layer file based on the first guideline, the target container engine is further used to send a second request to the image layer storage management module, where the second request includes a request for deleting the second image layer file; The image layer storage management module is further used to update the current reference information of the second image layer file in response to the second request, and perform a deletion response based on the current reference information of the second image layer file.

7. The mirror data sharing system according to claim 6, characterized in that: The performing a deletion response based on the current reference information of the second image layer file includes: When it is determined based on the current reference information of the second image layer file that none of the container engines references the second image layer file, the second image layer file is deleted from the image layer storage module.

8. The mirror data sharing system according to claim 6, characterized in that: The performing a deletion response based on the current reference information of the second image layer file includes: When it is determined based on the current reference information of the second image layer file that at least one other container engine references the second image layer file, the state in which the second image layer file is stored in the image layer storage module is maintained unchanged.

9. The mirror data sharing system according to claim 6, characterized in that: The updating, in response to the second request, current reference information of the second image layer file includes: When the image layer storage management module receives the second request sent by the target container engine, the reference count of the second image layer file is reduced by one, and the updated reference count is determined as the current reference information of the second image layer file.

10. The mirror data sharing system according to any one of claims 1 to 4, characterized in that: Also includes: A file system technology module is arranged in the kernel space, and the file system technology module is respectively communicated with each of the container engines and the image layer storage management module; The target container engine is further used to send the first request to the file system technology module; The file system technology module is used to receive and forward the first request to the image layer storage management module.

11. A computing device, characterized in that: The computing device is deployed with the mirror data sharing system as described in any one of claims 1 to 10, and when the computing device is running, the operating logic involved in the mirror data sharing system is executed.

Citation Information

Patent Citations

  • Docker container management system and mirror image updating method

    CN117608745A

  • Container mirror image processing method and device and readable medium

    CN118535275A