Information providing method and apparatus applied to server of edge computing cluster
By using the VirtiOBlk protocol in the edge computing cluster to hot-plug the read-write layer files of the container image into the virtual machine and mount it as the root file system, the problem of low read and write efficiency of the container root file system is solved and the overall performance is improved.
Patent Information
- Application Number
- PCT/CN2025/078180
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-21
- Filing Date
- 2025-02-20
- Publication Date
- 2025-09-25
AI Technical Summary
In edge computing clusters, the read and write efficiency of the container's root file system is low, resulting in a decrease in overall work efficiency.
Through a block-granularity-based protocol, the read-write layer files of the container image are hot-inserted into the target virtual machine and mounted as the root file system of the container. The virtioblk protocol is used to read and write data, improving read and write performance.
This improves the read and write efficiency of the container's root file system and the overall performance of the edge computing cluster.
Smart Images

Figure CN2025078180_25092025_PF_FP_ABST
Abstract
Description
Information providing method and device for servers applied to edge computing clusters
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application number 202410330019.6, filed on March 21, 2024, entitled “Information providing method and device for servers applied to edge computing clusters”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present disclosure relates to the field of Internet technology, and in particular to an information providing method, apparatus, computer equipment, and storage medium for a server in an edge computing cluster. Background Art
[0004] Containers in virtual machines in edge computing clusters, such as those in the Kata Containers project, require a root file system (rootfs) to operate. Currently, this is typically done by stacking the file system on the host machine in the edge computing cluster with overlayfs and transparently passing it to the container in the virtual machine. The virtual machines and host machines in the edge computing cluster can be deployed separately on servers in the edge computing cluster. Summary of the Invention
[0005] Embodiments of the present disclosure provide an information providing method, apparatus, computer equipment, and storage medium for a server in an edge computing cluster.
[0006] 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:
[0007] Obtain a target container image, and for each image layer in the target container image that has a parent image layer, obtain an image layer file corresponding to the image layer based on the image layer file corresponding to the parent image layer of the image layer, where the format of the image layer file corresponding to the image layer is related to the copy-on-write data writing method;
[0008] Obtaining a read-write layer file corresponding to the target container image based on the image layer file corresponding to the top image layer in 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;
[0009] Hot-inserting the read-write layer file into the target virtual machine via a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices;
[0010] 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.
[0011] 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:
[0012] An image layer file generation unit is configured 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 the 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;
[0013] a read-write layer file generation unit, configured to obtain a read-write layer file corresponding to the target container image based on the image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer in the target container image without a sub-image layer, and the format of the read-write layer file is related to the copy-on-write data writing method;
[0014] a hot-plug unit, configured to hot-plug the read-write layer file into the target virtual machine via a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices;
[0015] A mounting unit is configured 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 from and to the root file system of the target container through the block-granularity-based protocol.
[0016] 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 stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0017] 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 embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. 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.
[0019] FIG1 is a schematic diagram showing the principle of an information provision method applied to a server of an edge computing cluster according to an embodiment of the present disclosure;
[0020] FIG2 is a flow chart of an information provision method applied to a server of an edge computing cluster according to an embodiment of the present disclosure;
[0021] FIG3 is a flow chart of another information provision method applied to a server of an edge computing cluster according to an embodiment of the present disclosure;
[0022] FIG4 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;
[0023] FIG5 is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions 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, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present disclosure.
[0025] Containers in virtual machines in edge computing clusters, such as those in the Kata Containers project, require a root file system (rootfs) to operate. Currently, the file system on the host machine in the edge computing cluster is stacked using overlayfs and then transparently passed to the container in the virtual machine. The virtual machines and host machines in the edge computing cluster can be deployed separately on servers in the edge computing cluster. Stacking the file system on the host machine in the edge computing cluster using overlayfs and then transparently passing it to the container in the virtual machine results in high CPU I / O wait times within the container, resulting in low read and write efficiency for the container's root file system. This negatively impacts the overall efficiency of the edge computing cluster. Improving the read and write efficiency of the container's root file system has become a pressing issue.
[0026] In view of this, the embodiments of the present disclosure provide an information provision method, apparatus, computer equipment, and storage medium for a server of an edge computing cluster to solve the problem of how to improve the read and write efficiency of a container for a container's root file system.
[0027] Reference is made to FIG1 , which shows a schematic diagram illustrating the principle of an information providing method for a server of an edge computing cluster provided in an embodiment of the present disclosure.
[0028] The method provided by the embodiments of the present disclosure can be applied to a Kubernetes (K8s) cluster. A device for executing the information provision method provided by the embodiments of the present disclosure for a server in an edge computing cluster, such as the information provision device provided by the embodiments of the present disclosure for a server in an edge computing cluster, 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 shows the target container. As an example, the target container is a container provided by Kata Containers. Kata Containers is a container project managed by the OpenStack Foundation but independent of the OpenStack project. Kata Containers is a runtime tool that can create containers in the form of ultra-lightweight virtual machines using container images. The block-based protocol 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, i.e., 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 (qemu copy-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 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. The read-write layer file corresponding to the target container image is mounted in the target virtual machine as the root file system (rootfs) of the target container.
[0029] Referring to FIG2 , there is shown a flow chart of an information provision method applied to a server of an edge computing cluster provided by an embodiment of the present disclosure. The method can be executed by a computer device such as a server.
[0030] 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.
[0031] In step S201, a target container image can be obtained from a container image repository. 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 copy-on-write data writing method. In other words, the format of the image layer file corresponding to the image layer is a format that supports copy-on-write.
[0032] The target container image includes multiple image layers and the image layer contents of multiple image layers. As an example, the image layer file corresponding to the image layer is the 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 based on the image layer file corresponding to the parent image layer of the image layer, the image layer file corresponding to the base image layer is first created. For image layer i with a parent image layer in the target container image, the image layer file corresponding to image layer i may include the decompressed image layer content of image layer i and information indicating the dependency relationship between the image layer file corresponding to image layer i and the image layer file corresponding to the image layer below image layer i. Image layer i is any image layer with a parent image layer in the target container image. The image layers below image layer i include at least one of the following: the parent image layer of image layer i, the image layer between the parent image layer of image layer i and the base image layer, and the base image layer. The decompressed image layer content of image layer i is obtained by decompressing the image layer content of image layer i. The image layer file corresponding to image layer i can store data that is different from the data in the image layer file corresponding to the parent image layer of image layer i.
[0033] As an example, the image layer file corresponding to an image layer is in the qcow2 format. The image layer file corresponding to an 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. The qcow2 file corresponding to image layer i is obtained based on the qcow2 file corresponding to the parent image layer of image layer i.
[0034] 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 the backing file to obtain the image layer file corresponding to the image layer i.
[0035] As an example, the target container image includes a base image layer, image layer layer1, image layer layer2, and 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. Specifically, the parent image layer of image layer layer1 is the base image layer, and the child image layer of the base image layer is image layer layer1. The parent image layer of image layer layer2 is image layer layer1, and the child image layer of image layer layer1 is image layer layer2. The parent image layer of image layer layer3 is image layer layer2, and the child image layer of image layer layer2 is image layer layer3. The image layer files corresponding to the image layers are qcow2 files. The qcow2 file corresponding to the base image layer is used as the backing file to obtain the qcow2 file corresponding to layer1. The qcow2 file corresponding to layer1 is used as the backing file to obtain the qcow2 file corresponding to layer2. The qcow2 file corresponding to layer2 is used as the backing file to obtain the qcow2 file corresponding to layer3.
[0036] 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 the image layer without a sub-image layer in the target container image.
[0037] 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 data changes that occur in the image layer in the target container image. When modifying data in the target container that requires modifying the image layer in the target container image, the data to be modified can be searched in the image layer in the target container image, and the data to be modified can be copied to the read-write layer file corresponding to the target container image for modification.
[0038] As an example, the target container image includes a base image layer, image layer layer1, image layer layer2, and image layer layer3. The parent image layer of image layer layer1 is the base image layer, the parent image layer of image layer layer2 is layer1, the parent image layer of image layer layer3 is image layer layer2, image layer layer3 is the image layer without a child image layer in the target container image, and 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 image layer layer3 is the qcow2 file corresponding to image layer layer3. Based on the qcow2 file corresponding to image layer layer3, a qcow2 file is obtained as the read-write layer file corresponding to the target container image.
[0039] Obtaining the read-write layer file corresponding to the target container image based on the image layer file corresponding to the top image layer in the target container image can specifically refer to obtaining the read-write layer file corresponding to the target container image using the image layer file corresponding to the top image layer in the target container image as the backing file. 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 the backing file, a qcow2 file is obtained as the read-write layer file corresponding to the target container image.
[0040] 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.
[0041] 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.
[0042] As an example, a block-granularity-based protocol is the virtioblk protocol, which hot-plugs the read-write layer files corresponding to the target container image into the target virtual machine.
[0043] 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.
[0044] Step S204: 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. The target container reads and writes data to the root file system of the target container through a block-granularity-based protocol.
[0045] For a virtual machine, if at least one container in the virtual machine requires the read-write layer files corresponding to the target container image as its root file system, the virtual machine is considered the target virtual machine. The target container can be any container in the target virtual machine that requires the read-write layer files corresponding to the target container image as its root file system.
[0046] 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.
[0047] As an example, the read-write layer file corresponding to the target container image is a qcow2 file. The block-granular protocol is the VirtiOBlk protocol. After the read-write layer file corresponding to the target container image is mounted as the target container's root file system in the target virtual machine, the target container can read and write data to the target container's root file system using the VirtiOBlk protocol. This allows the target container to read and write data to the target container's root file system at block granularity, improving the container's read and write performance for the container's root file system.
[0048] Referring to FIG3 , there is shown 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. The method can be executed by a computer device such as a server.
[0049] Step S301: Obtain the target container image, and for each image layer in the target container image that has a parent image layer, 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.
[0050] When kubelet starts a container's pod through the Container Runtime Interface (CRI), it calls the criplugin plugin in containerd, the container runtime, to pull the target container image from the container image repository. The target container image includes the target container image's manifest and the image layer contents of each layer.
[0051] In step S301, for an image layer in the target container image that has a parent image layer, the image layer file corresponding to the image layer is formatted so that the image layer file corresponding to the image layer becomes 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 becomes an ext4 file system.
[0052] As an example, the target container image includes a base image layer, image layer 1, image layer 2, and image layer 3. The file format is qcow2. The parent image layer of image layer 1 is the base image layer, the parent image layer of image layer 2 is image layer 1, and the parent image layer of image layer 3 is image layer 2. The qcow2 file corresponding to the base image layer is used as the backing file. A qcow2 file corresponding to image layer 1 is created. This qcow2 file corresponding to image layer 1 is formatted with ext4, making it equivalent to an ext4 system. The image layer contents of image layer 1 are decompressed into the qcow2 file corresponding to image layer 1. The qcow2 file corresponding to image layer 1 is used as the backing file. A qcow2 file corresponding to image layer 2 is created. This qcow2 file corresponding to image layer 2 is formatted with ext4, making it equivalent to an ext4 system. The image layer contents of image layer 2 are decompressed into the qcow2 file corresponding to image layer 2. 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.
[0053] 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.
[0054] Containerd, the container runtime, defines the snapshotter protocol, which supports custom snapshotter implementations. You can pre-implement a pre-set snapshotter and configure the runtime in containerd to use it.
[0055] 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 qcow2Snapshotter. Containerd, which is the container runtime, calls qcow2Snapshotter. For each image layer in the target container image that has a parent image layer, qcow2Snapshotter creates an image layer file corresponding to the image layer based on the image layer file corresponding to the parent image layer of the image layer. It also 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.
[0056] Step S302 : 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 the image layer without a sub-image layer in the target container image.
[0057] 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.
[0058] The container runtime can call a preset snapshotter. When called, the preset snapshotter obtains the image layer file corresponding to the image layer based on 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 based on the image layer file corresponding to the top image layer in the target container image.
[0059] 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.
[0060] 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.
[0061] As an example, a block-granularity protocol is the virtioblk protocol, which hot-inserts the read-write layer files corresponding to the target container image into the target virtual machine.
[0062] Step S304: 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. The target container reads and writes data to the root file system of the target container through a block-granularity-based protocol.
[0063] The process of step S304 refers to the process of step S204 and will not be repeated here.
[0064] The information provision method provided by the embodiment of the present disclosure is applied to a server of an edge computing cluster. For each image layer with a parent image layer in a target container image, the image layer file corresponding to the image layer is obtained based on 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 based on 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 protocol; and 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 to the target container's root file system through a block-granularity protocol, thereby improving the read and write performance of the container to the container's root file system. The image layer files and read-write layer files corresponding to the image layer are both related to the copy-on-write data writing method, and storage space is only allocated when data is written, which can save storage space.
[0065] The embodiments of the present disclosure also provide an information providing device for a server applied to 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 that implements 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.
[0066] 4 shows a block diagram of an information providing apparatus for an edge computing cluster server according to an embodiment of the present disclosure. The information providing apparatus for an edge computing cluster server according to an embodiment of the present disclosure includes:
[0067] An image layer file generation unit 401 is configured to obtain a target container image and, for each image layer in the target container image that has a parent image layer, obtain an image layer file corresponding to the image layer based on the image layer file corresponding to the parent image layer of the image layer. The format of the image layer file corresponding to the image layer is related to the copy-on-write data writing method.
[0068] A read-write layer file generation unit 402 is configured to obtain a read-write layer file corresponding to the target container image based on the image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer in the target container image without a sub-image layer, and the format of the read-write layer file is related to the copy-on-write data writing method;
[0069] A hot-plug unit 403 is configured to hot-plug the read-write layer file into the target virtual machine via a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices;
[0070] The mounting unit 404 is configured 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 from and to the root file system of the target container through the block-granularity-based protocol.
[0071] In an optional embodiment, 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.
[0072] In an optional embodiment, 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.
[0073] In an optional embodiment, the information providing device applied to the server of the edge computing cluster further includes:
[0074] 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.
[0075] In an optional embodiment, the hot plug unit 403 is further used to call a daemon process applied to the container in the 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.
[0076] 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.
[0077] In an optional embodiment, the information providing device applied to the server of the edge computing cluster further includes:
[0078] 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.
[0079] 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 memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0080] 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.
[0081] With reference to Figure 5, it shows a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present disclosure, the computer device having the above-mentioned device, and the computer device including: 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 a 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).
[0082] 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 an application-specific 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.
[0083] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0084] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on 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 located 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.
[0085] 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.
[0086] The computer device further 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, and FIG5 shows a bus connection as an example.
[0087] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, an indicator stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). 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 can be a touch screen.
[0088] 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 implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, 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.
[0089] Although the embodiments of the present disclosure have been described with reference to 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, comprising: Obtain a target container image, and for each image layer in the target container image that has a parent image layer, obtain an image layer file corresponding to the image layer based on the image layer file corresponding to the parent image layer of the image layer, where the format of the image layer file corresponding to the image layer is related to the copy-on-write data writing method; Obtaining a read-write layer file corresponding to the target container image based on the image layer file corresponding to the top image layer in 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; Hot-inserting the read-write layer file into the target virtual machine via a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices; 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.
2. The method according to claim 1, wherein 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 comprises: 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, wherein 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 comprises: 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 by using a preset snapshotter; as well as 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: A preset snapshotter 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.
4. The method according to claim 3, further comprising: 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, wherein hot-plugging the read-write layer file into the target virtual machine through a block-granularity-based protocol comprises: The container runtime calls a daemon process applied to the container in the target virtual machine; The daemon process hot-inserts the read-write layer file into the target virtual machine via a block-granularity-based protocol.
6. The method according to claim 4, wherein obtaining the target container image comprises: 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, wherein after mounting the read-write layer file as a root file system of a target container in the target virtual machine in the target virtual machine, the method further comprises: 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 in an edge computing cluster, comprising: An image layer file generation unit is configured 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 the 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 generation unit, configured to obtain a read-write layer file corresponding to the target container image based on the image layer file corresponding to the top image layer in the target container image, wherein the top image layer is an image layer in the target container image without a sub-image layer, and the format of the read-write layer file is related to the copy-on-write data writing method; a hot-plug unit, configured to hot-plug the read-write layer file into the target virtual machine via a block-granularity-based protocol, wherein the block-granularity-based protocol is a protocol for block devices; A mounting unit is configured 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 from and to the root file system of the target container through the block-granularity-based protocol.
9. A computer device comprising: 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 having computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to execute the method according to claim 1 .
Citation Information
Patent Citations
DOCKER container creation method, apparatus and system
CN107590033A
Mirror image processing method and device, electronic equipment and readable storage medium
CN113209633A
Container starting method and device, electronic equipment and storage medium
CN116483514A
Information providing method and device applied to server of edge computing cluster
CN117931096A
Measuring containers
US20220179959A1