Information providing method and device for servers applied to edge computing cluster

By obtaining container image layer files in the edge computing cluster and hot-plugging them into virtual machines using a block-granularity protocol, the problem of low read/write efficiency of the container root file system is solved, achieving more efficient data read/write and storage space utilization.

CN117931096BActive Publication Date: 2024-11-19BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410330019.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2024-11-19
Estimated Expiration
2044-03-21

AI Technical Summary

Technical Problem

In edge computing clusters, the root file system of containers has low read/write efficiency, which leads to a decrease in overall work efficiency.

Method used

By obtaining the image layer file of the target container image, the read/write layer file is hot-plugged into the target virtual machine using a block-granular protocol, and then mounted as the root file system of the target container, thus achieving block-granular data reading and writing.

Benefits of technology

It improves the container's read and write performance to the root file system and saves storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117931096B_ABST
    Figure CN117931096B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of Internet technology, and discloses an information providing method and device for a server of an edge computing cluster, the method comprising: obtaining a target container image, and for each image layer having a parent image layer in the target container image, obtaining an image layer file corresponding to the image layer according to an image layer file corresponding to the parent image layer of the image layer; obtaining a read-write layer file corresponding to the target container image according to an image layer file corresponding to a top image layer in the target container image; hot-plugging the read-write layer file into a target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices; mounting the read-write layer file in the target virtual machine as a root file system of a target container in the target virtual machine, wherein the target container reads and writes data for the root file system of the target container through a block-granularity-based protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and in particular to an information providing method, apparatus, computer equipment and storage medium applied to a server of an edge computing cluster. Background Art

[0002] Edge computing clusters, such as edge computing kubernetes (k8s for short), require containers in virtual machines, such as kata containers, to work. At present, the file system on the host in the edge computing cluster is usually stacked through overlayfs and then transparently transmitted to the container in the virtual machine. The virtual machines in the edge computing cluster and the host in the edge computing cluster can be deployed on the servers of the edge computing cluster respectively. Stacking the file system on the host in the edge computing cluster through overlayfs and then transparently transmitting it to the container in the virtual machine will result in a high CPU io wait in the container, and the read and write efficiency of the container for the container's root file system is low. This has an adverse impact on the overall work efficiency of the edge computing cluster. How to improve the read and write efficiency of the container for the container's root file system has become a problem that needs to be solved. Summary of the invention

[0003] In view of this, the embodiments of the present disclosure provide an information providing method, apparatus, computer device and storage medium applied to a server of an edge computing cluster to solve the problem of how to improve the reading and writing efficiency of a container for a root file system of the container.

[0004] In a first aspect, an embodiment of the present disclosure provides an information providing method applied to a server of an edge computing cluster, including:

[0005] Obtain a target container image, and for each image layer having a parent image layer in the target container image, obtain an image layer file corresponding to the image layer according to an image layer file corresponding to the parent image layer of the image layer, wherein the format of the image layer file corresponding to the image layer is related to the copy-on-write data writing method;

[0006] According to the image layer file corresponding to the top image layer in the target container image, obtain the read-write layer file corresponding to the target container image, wherein the top image layer is the image layer without a sub-image layer in the target container image, and the format of the read-write layer file is related to the copy-on-write data writing method;

[0007] hot-insert the read-write layer file into the target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices;

[0008] The read-write layer file is mounted in the target virtual machine as a root file system of a target container in the target virtual machine, wherein the target container reads and writes data for the root file system of the target container through the block-granularity-based protocol.

[0009] In a second aspect, an embodiment of the present disclosure provides an information providing device applied to a server of an edge computing cluster, including:

[0010] An image layer file generation unit is used to obtain a target container image, and for each image layer having a parent image layer in the target container image, obtain an image layer file corresponding to the image layer according to an image layer file corresponding to the parent image layer of the image layer, wherein the format of the image layer file corresponding to the image layer is related to the copy-on-write data writing method;

[0011] A read-write layer file generating unit, configured to obtain a read-write layer file corresponding to the target container image according to an image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer without a sub-image layer in the target container image, and the format of the read-write layer file is related to a copy-on-write data writing method;

[0012] A hot-plug unit, used for hot-plugging the read-write layer file into the target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices;

[0013] A mounting unit is used to mount the read-write layer file in the target virtual machine as a root file system of a target container in the target virtual machine, wherein the target container reads and writes data for the root file system of the target container through the block-granularity-based protocol.

[0014] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding implementation manner thereof.

[0016] The information providing method for the server of the edge computing cluster provided by the embodiment of the present disclosure is as follows: for each image layer with a parent image layer in the target container image, the image layer file corresponding to the image layer is obtained according to the image layer file corresponding to the parent image layer of the image layer; the read-write layer file corresponding to the target container image is obtained according to the image layer file corresponding to the top image layer in the target container image; the read-write layer file corresponding to the target container image is hot-plugged into the target virtual machine through a block-granularity-based protocol; the read-write layer file corresponding to the target container image is mounted in the target virtual machine as the root file system of the target container in the target virtual machine. The target container can read and write data for the root file system of the target container through a block-granularity-based protocol, so that the target container can read and write data for the root file system of the target container at a block granularity, thereby improving the read-write performance of the container for the root file system of the container. The image layer file and the read-write layer file corresponding to the image layer are both related to the copy-on-write data writing method, and storage space is allocated only when writing data, which can save storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 It is a schematic diagram of the principle of the information providing method applied to the server of the edge computing cluster provided by the embodiment of the present disclosure;

[0019] Figure 2 It is a flowchart of an information providing method applied to a server of an edge computing cluster provided by an embodiment of the present disclosure;

[0020] Figure 3 It is a flowchart of another information providing method applied to a server of an edge computing cluster provided by an embodiment of the present disclosure;

[0021] Figure 4 It is a structural block diagram of an information providing device applied to a server of an edge computing cluster provided by an embodiment of the present disclosure;

[0022] Figure 5 It is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present disclosure. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0024] refer to Figure 1 , which shows a schematic diagram of the principle of an information providing method for a server of an edge computing cluster provided in an embodiment of the present disclosure.

[0025] The method provided in the embodiment of the present disclosure can be applied to a kubernetes (k8s) cluster. A device for executing the information providing method for a server of an edge computing cluster provided in the embodiment of the present disclosure, such as the information providing device for a server of an edge computing cluster provided in the embodiment of the present disclosure, can be deployed on each node in the k8s cluster. A kubelet runs on each node in the k8s cluster. The kubelet is responsible for monitoring the containers on the node and managing the resources on the node. Figure 1 The target container is shown. As an example, the target container is a container provided by kata containers. Katacontainers is a container project managed by the OpenStack Foundation but independent of the OpenStack project. Kata containers is a runtime tool that can use container images to create containers in the form of ultra-lightweight virtual machines. The protocol based on block granularity is the virtioblk protocol. The virtioblk protocol is a protocol for block devices. The virtioblk protocol is used to transmit data between a virtual machine and a host machine, that is, a physical machine. The virtioblk protocol supports operations such as reading disk data, writing disk data, querying disk information, and disk management. As an example, the format of the corresponding image layer file corresponding to the image layer and the format of the read-write layer file corresponding to the target container image are both qcow2 (qemucopy-on-write 2). The qcow2 file is a block device file provided for qemu. According to the target container image, the read-write layer file corresponding to the target container image is obtained. Through the virtioblk protocol, the read-write layer file corresponding to the target container image is hot-plugged into the target virtual machine. After hot-plugging the read-write layer file corresponding to the target container image into the target virtual machine, the read-write layer file corresponding to the target container image appears as a block device in the target virtual machine. In the target virtual machine, the read-write layer file corresponding to the target container image is mounted as the root file system (rootfs) of the target container.

[0026] refer to Figure 2 , which shows a flow chart of an information providing method for a server of an edge computing cluster provided by an embodiment of the present disclosure, which method can be executed by a computer device such as a server.

[0027] In step S201, a target container image is obtained, and for each image layer having a parent image layer in the target container image, an image layer file corresponding to the image layer is obtained according to an image layer file corresponding to the parent image layer of the image layer.

[0028] In step S201, a target container image can be obtained from a container image library. The target container image can be any container image. The format of the image layer file corresponding to the image layer is related to the write-on-write copy data writing method. In other words, the format of the image layer file corresponding to the image layer is a format that supports write-on-copy.

[0029] The target container image includes multiple image layers and image layer contents of multiple image layers. As an example, the image layer file corresponding to the image layer is a qcow2 file corresponding to the image layer. For each image layer with a parent image layer in the target container image, before obtaining the image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer, first create the image layer file corresponding to the base image layer. For an image layer i with a parent image layer in the target container image, the image layer file corresponding to the image layer i may include the decompressed image layer content of the image layer i and information indicating the dependency relationship between the image layer file corresponding to the image layer i and the image layer file corresponding to the image layer below the image layer i. Among them, the image layer i is any image layer with a parent image layer in the target container image. The image layer below the image layer i includes at least one of the following: the parent image layer of the image layer i, the image layer between the parent image layer of the image layer i and the base image layer, and the base image layer. The decompressed image layer content of the image layer i is obtained by decompressing the image layer content of the image layer i. The image layer file corresponding to the image layer i can store data that is different from the data in the image layer file corresponding to the parent image layer of the image layer i.

[0030] As an example, the format of the image layer file corresponding to the image layer is qcow2 format. The image layer file corresponding to the image layer is the qcow2 file corresponding to the image layer. For image layer i with a parent image layer in the target container image, the image layer file corresponding to the parent image layer of image layer i is the qcow2 file corresponding to the parent image layer of image layer i. The image layer file corresponding to image layer i is the qcow2 file corresponding to image layer i. According to the qcow2 file corresponding to the parent image layer of image layer i, the qcow2 file corresponding to image layer i is obtained.

[0031] For an image layer i having a parent image layer in the target container image, obtaining the image layer file corresponding to the image layer i according to the image layer file corresponding to the parent image layer of image layer i can specifically refer to: using the image layer file corresponding to the parent image layer of image layer i as backingfile to obtain the image layer file corresponding to image layer i.

[0032] As an example, the target container image includes a base image layer, an image layer layer1, an image layer layer2, and an image layer layer3. The formats of the image layer files corresponding to the image layers and the read-write layer files corresponding to the target container image are both qcow2. Among them, the parent image layer of the image layer layer1 is the base image layer, and the child image layer of the base image layer is the image layer layer1. The parent image layer of the image layer layer2 is the image layer layer1, and the child image layer of the image layer layer1 is the image layer layer2. The parent image layer of the image layer layer3 is the image layer layer2, and the child image layer of the image layer layer2 is the image layer layer3. The image layer files corresponding to the image layers are qcow2 files corresponding to the image layers. The qcow2 file corresponding to the base image layer is used as the backingfile to obtain the qcow2 file corresponding to layer1. The qcow2 file corresponding to layer1 is used as the backingfile to obtain the qcow2 file corresponding to layer2. The qcow2 file corresponding to layer2 is used as the backingfile to obtain the qcow2 file corresponding to layer3.

[0033] Step S202, obtaining a read-write layer file corresponding to the target container image according to the image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer without a sub-image layer in the target container image.

[0034] The read-write layer file corresponding to the target container image may include information indicating the dependency relationship between the read-write layer and the image layer file corresponding to each image layer in the target container image. The read-write layer file corresponding to the target container image is writable, and the data of each image layer in the target container image is read-only. The read-write layer file corresponding to the target container image can record the data changes that occur in the image layer in the target container image. When modifying the data in the image layer in the target container image that needs to be modified in the target container, the data that needs to be modified can be searched in the image layer in the target container image, and the data that needs to be modified can be copied to the read-write layer file corresponding to the target container image for modification.

[0035] As an example, the target container image includes a base image layer, an image layer layer1, an image layer layer2, and an image layer layer3. The parent image layer of the image layer layer1 is the base image layer, the parent image layer of the image layer layer2 is layer1, the parent image layer of the image layer layer3 is image layer2, the image layer layer3 is the image layer without a sub-image layer in the target container image, and the image layer layer3 is the top image layer. The formats of the image layer files corresponding to the image layers and the read-write layer files corresponding to the target container image are both qcow2. The image layer file corresponding to the base image layer is the qcow2 file corresponding to the base image layer, and the read-write layer file corresponding to the target container image is a qcow2 file. The image layer file corresponding to the image layer layer3 is the qcow2 file corresponding to the image layer layer3. According to the qcow2 file corresponding to the image layer layer3, a qcow2 file as the read-write layer file corresponding to the target container image is obtained.

[0036] According to the image layer file corresponding to the top image layer in the target container image, obtaining the read-write layer file corresponding to the target container image can specifically refer to obtaining the read-write layer file corresponding to the target container image by using the image layer file corresponding to the top image layer in the target container image as backingfile. As an example, the target container image includes a base image layer, image layer layer1, image layer layer2, and image layer layer3. Image layer layer3 is the top image layer. Using the qcow2 file corresponding to layer3 as backingfile, a qcow2 file as the read-write layer file corresponding to the target container image is obtained.

[0037] Step S203: hot-insert the read-write layer file corresponding to the target container image into the target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices.

[0038] The block device may specifically refer to a virtual disk block device. The block granularity-based protocol supports reading and writing data to the block device at a block granularity.

[0039] As an example, the block-granularity-based protocol is the virtioblk protocol. Through the virtioblk protocol, the read-write layer file corresponding to the target container image is hotplugged into the target virtual machine.

[0040] After the read-write layer file corresponding to the target container image is hot-plugged into the target virtual machine, the read-write layer file corresponding to the target container image appears as a block device in the target virtual machine.

[0041] Step S204, mounting the read-write layer file corresponding to the target container image as the root file system of the target container in the target virtual machine, wherein the target container reads and writes data for the root file system of the target container through a block-granularity-based protocol.

[0042] For a virtual machine, if at least one container in the virtual machine needs to use the read-write layer file corresponding to the target container image as the root file system, then the virtual machine is the target virtual machine. The target container can be any container in the target virtual machine that needs to use the read-write layer file corresponding to the target container image as the root file system.

[0043] As an example, a bind mount may be used to mount the read-write layer file corresponding to the target container image in the target virtual machine as the root file system of the target container in the target virtual machine.

[0044] As an example, the read-write layer file corresponding to the target container image is a qcow2 file. The protocol based on block granularity is the virtioblk protocol. After the read-write layer file corresponding to the target container image is mounted as the root file system of the target container in the target virtual machine, the target container can read and write data to the root file system of the target container through the virtioblk protocol. Thus, the target container reads and writes data to the root file system of the target container at block granularity, improving the read and write performance of the container to the root file system of the container.

[0045] refer to Figure 3 , which shows a flow chart of another information providing method applied to a server of an edge computing cluster provided by an embodiment of the present disclosure, which method can be executed by a computer device such as a server.

[0046] Step S301, obtain the target container image, and for each image layer with a parent image layer in the target container image, create an image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer; format the image layer file corresponding to the image layer, and decompress the image layer content of the image layer into the image layer file corresponding to the image layer.

[0047] When kubelet starts the pod to which the container belongs through the Container Runtime Interface (CRI), it can call the cri plugin in containerd, which is the container runtime, to pull the target container image from the container image library. The target container image includes the manifest of the target container image and the image layer content of each image layer of the target container image.

[0048] In step S301, for an image layer having a parent image layer in the target container image, the image layer file corresponding to the image layer is formatted, so that the image layer file corresponding to the image layer can become a corresponding file system. As an example, the image layer file corresponding to the image layer is formatted, so that the image layer file corresponding to the image layer can become an ext4 file system.

[0049] As an example, the target container image includes a base image layer, an image layer layer1, an image layer layer2, and an image layer layer3. The file format is qcow2 format. Among them, the parent image layer of the image layer layer1 is the base image layer, the parent image layer of the image layer layer2 is the image layer1, and the parent image layer of the image layer layer3 is the image layer2. The qcow2 file corresponding to the base image layer is used as the backingfile, and the qcow2 file corresponding to the image layer layer1 is created. The qcow2 file corresponding to the image layer layer1 is formatted corresponding to ext4, so that the qcow2 file corresponding to the image layer layer1 is equivalent to an ext4 system, and the image layer content of the image layer layer1 is decompressed to the qcow2 file corresponding to the image layer layer1. The qcow2 file corresponding to the image layer layer1 is used as the backingfile, and the qcow2 file corresponding to layer2 is created. The qcow2 file corresponding to layer2 is formatted corresponding to ext4, so that the qcow2 file corresponding to the image layer layer2 is equivalent to an ext4 system, and the image layer content of the image layer layer2 is decompressed to the qcow2 file corresponding to the image layer layer2. Use the qcow2 file corresponding to the image layer layer2 as the backingfile, create the qcow2 file corresponding to the image layer layer3, format the qcow2 file corresponding to the image layer layer3 corresponding to ext4, so that the qcow file corresponding to the image layer layer3 is equivalent to an ext4 system, and decompress the image layer content of the image layer layer3 to the qcow2 file corresponding to layer3.

[0050] In step S301, obtaining the image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer includes: using a preset snapshotter to obtain the image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer.

[0051] As a container runtime, containerd defines the snapshotter protocol, which supports the implementation of snapshotter according to requirements. You can pre-implement a preset snapshotter and configure the runtime in containerd to use the preset snapshotter.

[0052] As an example, when the format of the image layer file corresponding to the image layer and the format of the read-write layer file corresponding to the target container image are both qcow2, the preset snapshotter can be called qcow2 Snapshotter. qcow2 Snapshotter is called by containerd as the container runtime, and qcow2 Snapshotter creates an image layer file corresponding to each image layer with a parent image layer in the target container image according to the image layer file corresponding to the parent image layer of the image layer; formats the image layer file corresponding to the image layer, and decompresses the image layer content of the image layer into the image layer file corresponding to the image layer.

[0053] Step S302, obtaining a read-write layer file corresponding to the target container image according to the image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer without a sub-image layer in the target container image.

[0054] In step S302, a preset snapshotter may be used to obtain a read-write layer file corresponding to the target container image according to an image layer file corresponding to the top image layer in the target container image.

[0055] The preset snapshotter can be called by the container runtime. When the preset snapshotter is called, the preset snapshotter obtains the image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer, and obtains the read-write layer file corresponding to the target container image according to the image layer file corresponding to the top image layer in the target container image.

[0056] Step S303: hot-insert the read-write layer file corresponding to the target container image into the target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices.

[0057] The block device may specifically refer to a virtual disk block device. The block granularity-based protocol supports reading and writing data to the block device at a block granularity.

[0058] As an example, the block-granularity-based protocol is the virtioblk protocol. Through the virtioblk protocol, the read-write layer file corresponding to the target container image is hot-inserted into the target virtual machine.

[0059] Step S304: mount the read-write layer file corresponding to the target container image as the root file system of the target container in the target virtual machine in the target virtual machine, wherein the target container reads and writes data for the root file system of the target container through a block-granularity-based protocol.

[0060] The process of step S304 refers to the process of step S204 and will not be repeated here.

[0061] The disclosed embodiments also provide an information providing device for a server of an edge computing cluster, which is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated. As used below, the term "unit" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0062] refer to Figure 4 , which shows a structural block diagram of an information providing device for a server of an edge computing cluster provided by an embodiment of the present disclosure, and the information providing device for a server of an edge computing cluster provided by an embodiment of the present disclosure includes:

[0063] An image layer file generation unit 401 is used to obtain a target container image, and for each image layer having a parent image layer in the target container image, obtain an image layer file corresponding to the image layer according to an image layer file corresponding to the parent image layer of the image layer, wherein the format of the image layer file corresponding to the image layer is related to a copy-on-write data writing method;

[0064] A read-write layer file generating unit 402 is used to obtain a read-write layer file corresponding to the target container image according to the image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer without a sub-image layer in the target container image, and the format of the read-write layer file is related to the copy-on-write data writing method;

[0065] A hot-plug unit 403 is used to hot-plug the read-write layer file into the target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices;

[0066] The mounting unit 404 is used to mount the read-write layer file in the target virtual machine as the root file system of the target container in the target virtual machine, wherein the target container reads and writes data for the root file system of the target container through the block-granularity-based protocol.

[0067] In an optional implementation, the image layer file generation unit 401 is further used to create an image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer; format the image layer file corresponding to the image layer, and decompress the image layer content of the image layer into the image layer file corresponding to the image layer.

[0068] In an optional implementation, the image layer file generation unit 401 is further used to use a preset snapshotter to obtain the image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer; the read-write layer file generation unit is further used to use a preset snapshotter to obtain the read-write layer file corresponding to the target container image according to the image layer file corresponding to the top-level image layer in the target container image.

[0069] In an optional implementation, the information providing device applied to the server of the edge computing cluster further includes:

[0070] A calling unit, which calls a preset snapshotter when the container is running, wherein when the preset snapshotter is called, the image layer file corresponding to the image layer is obtained according to the image layer file corresponding to the parent image layer of the image layer, and the read-write layer file corresponding to the target container image is obtained according to the image layer file corresponding to the top image layer in the target container image.

[0071] In an optional implementation, the hot-plug unit 403 is further used to call a daemon process applied to a container in a target virtual machine by the container runtime; the daemon process hot-plugs the read-write layer file into the target virtual machine through a block-granularity-based protocol.

[0072] In an optional implementation, the image layer file generation unit 401 is further configured to use a plug-in for pulling container images to pull the target container image from a container image library to obtain the target container image.

[0073] In an optional implementation, the information providing device applied to the server of the edge computing cluster further includes:

[0074] The starting unit is used to mount the read-write layer file as the root file system of the target container in the target virtual machine in the target virtual machine, and then call the container agent in the target virtual machine by the container runtime; and start the target container by the container agent.

[0075] In this embodiment, the device is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0076] The further functional description of each of the above units is the same as that of the above corresponding embodiments and will not be repeated here.

[0077] refer to Figure 5 , which shows a hardware structure diagram of a computer device provided by an embodiment of the present disclosure, the computer device has the above-mentioned device, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0078] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0079] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0080] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0081] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0082] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0083] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.

[0084] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0085] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for providing information to a server in an edge computing cluster, characterized in that: The method comprises: Obtain a target container image, and for each image layer having a parent image layer in the target container image, obtain an image layer file corresponding to the image layer according to an image layer file corresponding to the parent image layer of the image layer, wherein the format of the image layer file corresponding to the image layer is related to the copy-on-write data writing method; According to the image layer file corresponding to the top image layer in the target container image, obtain the read-write layer file corresponding to the target container image, wherein the top image layer is the image layer without a sub-image layer in the target container image, and the format of the read-write layer file is related to the copy-on-write data writing method; The read-write layer file is hot-plugged into the target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices, the block-granularity-based protocol is a virtioblk protocol, the target virtual machine is a virtual machine including at least one container that needs to use the read-write layer file corresponding to the target container image as a root file system, and after the read-write layer file corresponding to the target container image is hot-plugged into the target virtual machine, the read-write layer file corresponding to the target container image is presented as a block device in the target virtual machine; The read-write layer file is mounted in the target virtual machine as the root file system of the target container in the target virtual machine, wherein the target container is any container in the target virtual machine that needs to use the read-write layer file corresponding to the target container image as the root file system, and the target container reads and writes data for the root file system of the target container through the block-granularity-based protocol. The target container reads and writes data for the root file system of the target container through the block-granularity-based protocol includes: the target container reads and writes data for the root file system of the target container at block granularity through the virtioblk protocol.

2. The method according to claim 1, characterized in that According to the image layer file corresponding to the parent image layer of the image layer, obtaining the image layer file corresponding to the image layer includes: Create an image layer file corresponding to the image layer according to the image layer file corresponding to the parent image layer of the image layer; The image layer file corresponding to the image layer is formatted, and the image layer content of the image layer is decompressed into the image layer file corresponding to the image layer.

3. The method according to claim 1, characterized in that According to the image layer file corresponding to the parent image layer of the image layer, obtaining the image layer file corresponding to the image layer includes: Using a preset snapshotter, obtaining an image layer file corresponding to the image layer according to an image layer file corresponding to a parent image layer of the image layer; and According to the image layer file corresponding to the top image layer in the target container image, obtaining the read-write layer file corresponding to the target container image includes: By using a preset snapshotter, a read-write layer file corresponding to the target container image is obtained according to the image layer file corresponding to the top image layer in the target container image.

4. The method according to claim 3, characterized in that The method further comprises: The preset snapshotter is called by the container runtime, wherein when the preset snapshotter is called, the image layer file corresponding to the image layer is obtained according to the image layer file corresponding to the parent image layer of the image layer, and the read-write layer file corresponding to the target container image is obtained according to the image layer file corresponding to the top image layer in the target container image.

5. The method according to claim 4, characterized in that Hot-plugging the read-write layer file into the target virtual machine through a block-granularity-based protocol includes: The container runtime calls a daemon process applied to a container in the target virtual machine; The daemon process hot-inserts the read-write layer file into the target virtual machine through a block-granularity-based protocol.

6. The method according to claim 4, characterized in that Obtaining the target container image includes: The target container image is pulled from the container image library by a plug-in for pulling the container image to obtain the target container image.

7. The method according to claim 4, characterized in that After mounting the read-write layer file in the target virtual machine as a root file system of a target container in the target virtual machine, the method further includes: The container runtime calls the container agent in the target virtual machine; The target container is started by the container agent.

8. An information providing device for a server of an edge computing cluster, characterized in that: The device comprises: An image layer file generation unit is used to obtain a target container image, and for each image layer having a parent image layer in the target container image, obtain an image layer file corresponding to the image layer according to an image layer file corresponding to the parent image layer of the image layer, wherein the format of the image layer file corresponding to the image layer is related to the copy-on-write data writing method; A read-write layer file generating unit, configured to obtain a read-write layer file corresponding to the target container image according to an image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer without a sub-image layer in the target container image, and the format of the read-write layer file is related to a copy-on-write data writing method; A hot-plug unit, configured to hot-plug the read-write layer file into a target virtual machine through a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices, the block-granularity-based protocol is a virtioblk protocol, the target virtual machine is a virtual machine including at least one container that needs to use the read-write layer file corresponding to the target container image as a root file system, and after the read-write layer file corresponding to the target container image is hot-plugged into the target virtual machine, the read-write layer file corresponding to the target container image appears as a block device in the target virtual machine; A mounting unit, used for mounting the read-write layer file in the target virtual machine as a root file system of a target container in the target virtual machine, wherein the target container is any container in the target virtual machine that needs to use the read-write layer file corresponding to the target container image as the root file system, and the target container reads and writes data for the root file system of the target container through the block-granularity-based protocol. The target container reads and writes data for the root file system of the target container through the block-granularity-based protocol includes: the target container reads and writes data for the root file system of the target container at block granularity through the virtioblk protocol.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.