Image distribution method, image distribution device, electronic device and storage medium

During the container image distribution process, the image file data is sent to the edge node in advance, and the image metadata is returned after receiving the metadata acquisition request of the edge node, data loss and data loss during the container image distribution process in the prior art are solved. The issue of safety hazards has achieved efficient and secure mirror distribution.

CN114238262BActive Publication Date: 2025-02-18CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111558467.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-02-18
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

The prior art has data loss and security risks in the process of container image distribution, especially in edge computing scenarios, the security protection capability of edge nodes is lower than that of central nodes, which easily leads to theft of mirror metadata.

Method used

By obtaining the image file data in the central mirror warehouse and sending it to the edge node, and storing it in the edge mirror warehouse, the mirror pulling delay is reduced; at the same time, after receiving the metadata acquisition request of the edge node, the target is then set. The mirrored image metadata is returned to the edge node to avoid the mirrored metadata being stored in the edge node in advance, reducing security risks.

Benefits of technology

It effectively reduces the mirror pull delay, improves the security of mirror distribution, prevents theft of mirror metadata, and enhances the security protection capabilities of edge nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238262B_ABST
    Figure CN114238262B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an image distribution method, an image distribution device, an electronic device and a storage medium, the method comprising: obtaining an image stored in a central image warehouse, the image comprising corresponding image metadata and image file data; sending the image file data corresponding to the image stored in the central image warehouse to an edge node, so that the edge node stores the received image file data in the edge image warehouse; according to a metadata acquisition request sent by the edge node, returning the image metadata corresponding to the target image to the edge node for storage, wherein the target image is the image requested to be obtained by the terminal device from the edge node. The technical solution of the embodiment of the present application can reduce the security risks of image distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud computing, and in particular to an image distribution method, an image distribution device, an electronic device, and a storage medium. Background Art

[0002] In the prior art, starting a container is very fast. However, in most cases, starting a container requires first pulling the entire container image from a remote container repository and writing it to the local computer's disk. This causes a certain waste of computer resources. For small containers, this problem is rarely noticed. However, for larger containers, the pull operation quickly becomes the slowest part of starting the container. Related studies have shown that the time taken by docker (application container engine) image pull can account for 76% of the total time taken to start a container. This problem has been plaguing various workloads. Although there are various ways to minimize the size of docker images, it is still impossible to avoid the need for large-volume images in some scenarios. In order to shorten the time taken to pull images and save bandwidth, some prior arts deploy container images in edge computing scenarios. The distribution of container images follows the typical cloud-edge-end three-level architecture, but this distribution method of container images has a large data loss security risk. Summary of the invention

[0003] To solve the above technical problems, the embodiments of the present application provide an image distribution method, an image distribution device, an electronic device, and a storage medium, which can reduce the security risks of image distribution.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0005] According to one aspect of an embodiment of the present application, there is provided an image distribution method, comprising: obtaining an image stored in a central image repository, the image comprising corresponding image metadata and image file data; sending the image file data corresponding to the image stored in the central image repository to an edge node, so that the edge node stores the received image file data in the edge image repository; and returning the image metadata corresponding to the target image to the edge node for storage according to a metadata acquisition request sent by the edge node, wherein the target image is the image that a terminal device requests to obtain from the edge node.

[0006] According to one aspect of an embodiment of the present application, there is provided an image distribution method, comprising: receiving an image acquisition request sent by a terminal, the image acquisition request being used to request acquisition of a target image; based on the image acquisition request, sending a metadata acquisition request to a central node, the metadata acquisition request being used to request acquisition of image metadata corresponding to the target image stored in a central image repository; receiving image metadata corresponding to the target image returned by the central node, and storing the received image metadata in an edge image repository; and returning the image metadata and image file data corresponding to the target image stored in the edge image repository to a terminal device.

[0007] According to one aspect of an embodiment of the present application, an image distribution device is provided, including: an acquisition module, used to acquire an image stored in a central image repository, the image including corresponding image metadata and image file data; a first sending module, used to send the image file data corresponding to the image stored in the central image repository to an edge node, so that the edge node stores the received image file data in the edge image repository; a second sending module, used to return the image metadata corresponding to the target image to the edge node for storage according to a metadata acquisition request sent by the edge node, wherein the target image is the image that the terminal device requests the edge node to obtain.

[0008] According to one aspect of an embodiment of the present application, an image distribution device is provided, including: a first receiving module, used to receive an image acquisition request sent by a terminal, the image acquisition request is used to request to obtain a target image; a third sending module, used to send a metadata acquisition request to a central node based on the image acquisition request, the metadata acquisition request is used to request to obtain image metadata corresponding to the target image stored in the central image warehouse; a second receiving module, used to receive image metadata corresponding to the target image returned by the central node, and store the received image metadata in an edge image warehouse; a fourth sending module, used to return the image metadata and image file data corresponding to the target image stored in the edge image warehouse to the terminal device.

[0009] According to one aspect of an embodiment of the present application, an electronic device is provided, including a processor and a memory, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the above image distribution method is implemented.

[0010] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the image distribution method provided above.

[0011] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the image distribution method provided in the above various optional embodiments.

[0012] In the technical solution provided in the embodiments of the present application, on the one hand, since the image transmission delay includes the image metadata data transmission delay and the image file data transmission delay, and the image file data transmission delay is much smaller than the image metadata data transmission delay, the solution of the present application sends the image file data corresponding to the image stored in the central image warehouse to the edge node in advance, so that the edge node stores the received image file data in the edge image warehouse, thereby reducing the image pulling delay; on the other hand, since the security protection capability of the edge node is usually lower than the security protection capability of the central node, the solution of the present application returns the image metadata corresponding to the target image requested by the terminal device to the edge node to the edge node for storage after receiving the metadata acquisition request sent by the edge node, which can prevent the security risks caused by the image metadata being stored in the edge node in advance.

[0013] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0015] Figure 1 is an architecture diagram of a cloud-edge-end three-level architecture shown in an exemplary embodiment of the prior art;

[0016] Figure 2 is an architectural diagram of an image distribution mechanism shown in an exemplary embodiment of the prior art;

[0017] Figure 3 is a flowchart of a mirror distribution method shown in an exemplary embodiment of the present application;

[0018] Figure 4 is an architectural diagram of an image distribution mechanism shown in an exemplary embodiment of the prior art;

[0019] Figure 5is a flowchart of a mirror distribution method shown in an exemplary embodiment of the present application;

[0020] Figure 6 yes Figure 5 Step S204 in the illustrated embodiment is a flow chart of an exemplary embodiment;

[0021] Figure 7 is a flowchart of a mirror distribution method shown in another exemplary embodiment of the present application;

[0022] Figure 8 yes Figure 7 Step S304 in the illustrated embodiment is a flow chart of an exemplary embodiment;

[0023] Fig. 9 yes Figure 7 Step S306 in the illustrated embodiment is a flow chart of an exemplary embodiment;

[0024] Fig.10 is a block diagram of an image distribution device shown in an exemplary embodiment of the present application;

[0025] Fig.11 It is a block diagram of a mirror distribution device shown in another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0026] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0029] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.

[0030] As a lightweight, portable, and low-cost virtualization processing method, containers have become a way for many companies to reduce costs and improve efficiency. Starting a container requires a container image file on the hard disk. The container image is the basis for starting a container instance and contains all the data required for the container to run. Before starting a container instance, the complete container image must be downloaded locally. The currently widely used container framework adopts a client-warehouse model. The client is responsible for the management of the actual container life cycle, including starting, pausing, resuming, and destroying. The warehouse is responsible for centrally storing the container images that need to be deployed so that the client can freely obtain the required images. In the cloud native scenario, when a job needs to start the same container on multiple nodes, these nodes will request the container image file from the image warehouse, but the export bandwidth of the image warehouse node is limited, so the average preparation time of the job on each node is linearly related to the deployment scale of the node.

[0031] In response to the technical problem that the existing centralized cloud network can no longer meet the increasing demand for cloud resources on the terminal side, the existing technology combines central control with edge cloud nodes. Under the control of the central control device, the edge cloud nodes can obtain the required images and then create instances corresponding to cloud computing services. This provides the condition for "putting cloud computing in edge cloud nodes closer to the terminal for processing", and then using the resources in the edge cloud nodes to provide users with cloud computing services, which is conducive to reducing response delays and reducing bandwidth costs.

[0032] When deploying container applications in edge computing scenarios, the distribution of container images generally follows the typical cloud-edge-device three-level architecture. Figure 1 , Figure 1 FIG. 1 is an architecture diagram of a cloud-edge-end three-level architecture shown in an exemplary embodiment of the prior art. Figure 1 As shown, the cloud-edge-end three-level architecture includes a central cloud and edge nodes 1, 2 and 3 connected to the central cloud, devices 1, 2 and 3 connected to edge node 1, devices 4 and 5 connected to edge node 2, and devices 6 and 7 connected to edge node 3.

[0033] The central cloud includes a central image warehouse, which is used to store images. Edge node 1 includes edge warehouse 1, edge node 2 includes edge warehouse 2, and edge node 3 includes edge warehouse 3. Edge warehouse 1, edge warehouse 2, and edge warehouse 3 are used to store images sent by the central cloud and received by edge node 1. Devices 1-3 pull the required images from edge node 1, devices 4-5 pull the required images from edge node 2, and devices 6-7 pull the required images from edge node 3.

[0034] See also Figure 2 , Figure 2 is an architecture diagram of an image distribution mechanism shown in an exemplary embodiment of the prior art, such as Figure 2 As shown, the central node synchronously sends the image metadata and image file data stored in the central image warehouse to the edge node, so that the edge image warehouse stores the image metadata and image file data, and the A device and the B device obtain the image metadata and image file data from the edge image warehouse through the edge node to obtain a usable target image.

[0035] The current image distribution mechanism has the potential security risk that the image data of edge nodes is easily leaked. In edge scenarios, unattended edge nodes usually do not have the strong network and physical protection capabilities of the central cloud, and the image data is easily attacked, which poses a risk of data leakage. To solve this problem, the embodiments of the present application respectively propose an image distribution method, an image distribution device, an electronic device, and a computer-readable storage medium, which will be described in detail below.

[0036] See also Figure 3 , Figure 3 is a flowchart of an image distribution method shown in an exemplary embodiment of the present application, such as Figure 3 As shown, the method comprises the following steps:

[0037] Step S101: Obtain an image and store it in a central image repository.

[0038] The method provided in this embodiment is executed by a central node, and the central node includes a central image warehouse. Specifically, the central node can be a device or server with processing capabilities, and has a relatively strong security protection capability, which can ensure that the image data in the central image warehouse will not be easily stolen. The central node can obtain the image by receiving multiple images sent by external devices, or build the required image by itself, which is not specifically limited here.

[0039] The central image repository is used to store images, each of which includes corresponding image metadata and image file data.

[0040] In this embodiment, the image metadata includes the attribute information of the image, such as the size, name, identifier or image file identifier of the image, etc. The image file data includes the data in the image except the image metadata. The image metadata and the image file data constitute a usable image.

[0041] Step S102: sending the image file data corresponding to the image stored in the central image repository to the edge node, so that the edge node stores the received image file data in the edge image repository.

[0042] In this embodiment, the edge node corresponds to the central cloud or the traditional cloud computing platform. The edge node is a relative concept. The edge node refers to a cloud computing platform that is relatively close to the terminal. In other words, it is different from the central cloud or the traditional cloud computing platform. The central cloud or the traditional cloud computing platform may include a data center with scaled resources and centralized locations, while the edge node covers a wider network range and is therefore closer to the terminal. The resource scale of a single edge node is smaller.

[0043] Exemplarily, this embodiment can send the image file data corresponding to the image stored in the central image warehouse to multiple edge nodes, so that the multiple edge nodes store the received image file data in the edge image warehouse. In this way, the network range covered by the edge nodes is wider.

[0044] Exemplarily, the image file data corresponding to the image stored in the central image warehouse is synchronized to the edge node. Specifically, when the image file data of the image is obtained in the central image warehouse, the image file data corresponding to the image stored in the central image warehouse is sent to the edge node, so that the image file data corresponding to the image in the edge image warehouse and the central image warehouse are changed synchronously, which can ensure that the terminal device can send an image pull request at any time.

[0045] Step S103: according to the metadata acquisition request sent by the edge node, the image metadata corresponding to the target image is returned to the edge node for storage, wherein the target image is the image that the terminal device requests to obtain from the edge node.

[0046] In this embodiment, when the terminal device generates a need to pull an image, it sends an image pull request to the edge node connected to it, and the image pull request is used to pull the target image. After receiving the image pull request sent by the terminal device, the edge node sends a metadata acquisition request to the central node.

[0047] In this embodiment, the image pulling policy parameter "imagePullPolicy" of the terminal device can be set to "always" so that each time the terminal device needs to use an image to build a container, it obtains the corresponding image through the image distribution method provided in this embodiment, thereby ensuring that the image used by the device terminal is synchronously updated with the image of the central node.

[0048] Since the edge node has stored the image file data in the edge image warehouse in step S102, the edge image warehouse includes the image file data corresponding to the target image. In addition, when the metadata acquisition request is obtained, the central node sends the image metadata corresponding to the target image to the edge node. At this time, the edge node includes the corresponding metadata and image file data of the target image. At this time, the corresponding metadata and image file data of the target image are sent to the terminal device to complete the entire image distribution process. The terminal device of this embodiment refers to the demand end of the cloud computing service, for example, it can be a terminal or user end in the Internet, or a terminal or user end in the Internet of Things.

[0049] In summary, the image distribution method provided by this embodiment, on the one hand, because the image transmission delay includes the image metadata data transmission delay and the image file data transmission delay, and the image file data transmission delay is much smaller than the image metadata data transmission delay, therefore, this embodiment sends the image file data corresponding to the image stored in the central image warehouse to the edge node in advance, so that the edge node stores the received image file data in the edge image warehouse, thereby reducing the image pull delay. On the other hand, because the security protection capability of the edge node is usually lower than that of the central node, the image metadata corresponding to the target image is returned to the edge node for storage after receiving the metadata acquisition request sent by the edge node, wherein the target image is the image requested by the terminal device to the edge node, which can greatly shorten the time that the image metadata corresponding to the image is stored in the edge node, thereby reducing the possibility of the image metadata being stolen and improving the security of image distribution.

[0050] See also Figure 4 , Figure 4 is an architecture diagram of an image distribution mechanism shown in an exemplary embodiment of the prior art, such as Figure 4As shown, the target image authorizes device A and device B. The central image warehouse synchronizes the authorization information, i.e., the device token, to the edge image warehouse through step 1. Since the synchronization is successful, the edge image warehouse now includes the authorization information of device A and device B, i.e., the device token of device A and the device token of device B. Device A and device B can obtain the target image from the edge image warehouse based on their device tokens respectively. When the target image cancels the authorization of user device B, the central image warehouse synchronizes the updated device token of device B to the edge image warehouse through step 2. Due to the failure of synchronization, the edge image warehouse did not obtain the updated device token of device B. At this time, device B can still obtain the target device from the edge image warehouse through the device token before the update.

[0051] Obviously, from the above examples, it can be seen that the current container image distribution mechanism has a major security risk: the security risk caused by the asynchronous permission control policy between the central node and the edge node, that is, the current image distribution mechanism is to synchronize the authentication information to the edge node, and the edge node performs authentication and authorization, but the edge node has problems such as network instability. When the security policy of the central node (such as access rights) changes, it will cause unauthorized image access before the security policy is synchronized to the edge node. To solve this problem, this embodiment proposes a method for image distribution, which will be described in detail below.

[0052] See also Figure 5 , Figure 5 is a flowchart of an image distribution method shown in an exemplary embodiment of the present application, such as Figure 5 As shown, the method comprises the following steps:

[0053] Step S201: Obtain an image and store it in a central image repository, where the image includes corresponding image metadata and image file data.

[0054] Step S202: sending the image file data corresponding to the image stored in the central image repository to the edge node, so that the edge node stores the received image file data in the edge image repository.

[0055] Step S201, step S202 and step S206 of the image distribution method provided in this embodiment are similar to steps 101 to 103 of the image distribution method provided in the above embodiment, respectively. Please refer to the above embodiment for details, and no further description is given here.

[0056] Step S203: receiving an authentication request sent by an edge node.

[0057] In this embodiment, the authentication request includes authentication information and authorization information, which are respectively used to authenticate and authorize the device requesting to obtain the image. The authentication information includes device information of the device requesting to obtain the image, such as a device identifier, and the authorization information is such as a device token.

[0058] Step S204: according to the authentication request, the terminal device requesting to obtain the target image is authenticated and authenticated.

[0059] See also Figure 6 , Figure 6 yes Figure 5 The flowchart of step S204 in the embodiment shown is an exemplary embodiment, as shown in FIG. Figure 6 As shown, step S204 includes the following steps:

[0060] Step S2041: Based on the device information contained in the authentication request, the device information stored in association with the target image is queried in the database. If the device information contained in the authentication request is found, it is determined that the terminal device has passed the identity authentication.

[0061] Step S2042: query the database for a device token stored in association with the device information. If the queried device token is the same as the device token contained in the authentication request, it is determined that the terminal device has passed the authentication.

[0062] In this embodiment, the database of the central node stores a list of devices corresponding to each image in advance. The list of devices is used to indicate devices that have the authority to pull the corresponding image. The device information of each device includes a device identifier and a device token, so that the corresponding device can use the device token to pull the corresponding image. The list of devices corresponding to each image can be updated in real time to control the device's access to the corresponding image. The device information stored in association with the target image is the device information of the device in the device list corresponding to the target image.

[0063] In this embodiment, the device identifier and device token contained in the authentication request are searched in the device information stored in association with the target image. If the device identifier is found, it is confirmed that the terminal device requesting to obtain the target image has passed the identity authentication. If the device token corresponding to the device identifier is found, it is determined that the terminal device has passed the authentication.

[0064] Step S205: If the terminal device passes the authentication and authorization, a confirmation message is returned to the edge node, so that the edge node initiates a metadata acquisition request based on the confirmation message.

[0065] Step S206: according to the metadata acquisition request sent by the edge node, the image metadata corresponding to the target image is returned to the edge node for storage, wherein the target image is the image that the terminal device requests to obtain from the edge node.

[0066] The image distribution method provided in this embodiment authenticates and authorizes the terminal device requesting to obtain the image before step S206, which can improve the security of image distribution. In addition, unlike the prior art that uses edge nodes to authenticate and authorize devices, this embodiment directly uses central nodes to authenticate and authorize devices to prevent the device list information of the image from being unable to be synchronized to the edge node in time when the image is changed, thereby causing the image to be mis-sent, thereby improving the security of image distribution.

[0067] See also Figure 7 , Figure 7 FIG. 1 is a flowchart of an exemplary embodiment of the present application showing a mirror distribution method. The execution subject of the mirror distribution method provided in this embodiment is an edge node, and the edge node is connected to the central node and the terminal device respectively. Figure 7 As shown, the method comprises the following steps:

[0068] Step S301: receiving image file data corresponding to the image stored in the central image repository sent by the central node.

[0069] The central node sends the image file data corresponding to the image stored in the central image warehouse to the edge node based on the SSH transmission command or the SCP transmission command to ensure the security of the image file data during the transmission process.

[0070] SSH is the abbreviation of Secure Shell, which was developed by the Network Working Group of IETF. SSH is a security protocol based on the application layer and the transport layer. SSH is currently the most reliable protocol that provides security for remote login sessions and other network services. The use of the SSH protocol can effectively prevent information leakage during remote management. SSH was originally a program on the UNIX system, and later quickly expanded to other operating platforms. When used correctly, SSH can fill in the gaps in the network.

[0071] SCP is the abbreviation of Secure Copy. SCP is a command for secure remote file copying based on SSH login in operating systems such as Linux.

[0072] Exemplarily, the image file data corresponding to the image stored in the central image warehouse sent by the central node at regular intervals is received. In this way, the image file data corresponding to the image in the edge image warehouse can be updated at regular intervals.

[0073] Step S302: Store the received image file data in the edge image warehouse.

[0074] Step S303: receiving an image acquisition request sent by the terminal device, where the image acquisition request is used to request acquisition of a target image.

[0075] In this embodiment, the image acquisition request includes device information of the terminal device, such as a device identifier, a device token, and a device IP address, and the image acquisition request also includes an image identifier of a target image.

[0076] Step S304: Based on the image acquisition request, a metadata acquisition request is sent to the central node, where the metadata acquisition request is used to request to acquire image metadata corresponding to the target image stored in the central image repository;

[0077] In this embodiment, the metadata acquisition request includes the image identifier of the target image, so that the midpoint node sends the image metadata of the target image to the edge node according to the image identifier of the target image.

[0078] Step S305: receiving the image metadata corresponding to the target image returned by the central node, and storing the received image metadata in the edge image warehouse.

[0079] Step S306: Return the image metadata and image file data corresponding to the target image stored in the edge image repository to the terminal device.

[0080] In this embodiment, before receiving the image acquisition request sent by the terminal device, the edge image warehouse has stored in advance the image file data corresponding to the target image obtained from the central image warehouse. When the image acquisition request of the terminal device is received, it is only necessary to obtain the image metadata corresponding to the target image from the central node. Since the image file data transmission delay is much smaller than the image metadata data transmission delay, this embodiment can return the image metadata and image file data corresponding to the target image to the terminal device in time, thereby reducing the image pulling delay and improving the image distribution efficiency.

[0081] On the other hand, since the security protection capabilities of edge nodes are usually lower than those of central nodes, the image metadata corresponding to the target image is obtained from the central node only after receiving the image acquisition request sent by the terminal device, which can prevent the security risks caused by the image metadata being stored in the edge node in advance.

[0082] See also Figure 8 , Figure 8 yes Figure 7 The flowchart of step S304 in the embodiment shown is an exemplary embodiment, as shown in FIG. Figure 8 As shown, step S304 includes the following steps:

[0083] Step S3041: Based on the image acquisition request, an authentication request is sent to the central node, so that the central node performs authentication and authorization processing on the terminal device requesting to obtain the target image according to the authentication request.

[0084] In this embodiment, the authentication and authentication request includes authentication information and authorization information, which are respectively used to authenticate and authorize the device requesting to obtain the image. The authentication information includes device information of the device requesting to obtain the image, such as the device identifier, and the authorization information such as the device token.

[0085] In this embodiment, the central node performs authentication and authentication processing on the terminal device requesting to obtain the target image according to the authentication and authentication request as follows: Figure 3 The steps S2041 to S2042 shown are not described in detail here.

[0086] Step S3042: Receive a confirmation message returned by the central node, where the confirmation message is used to indicate that the terminal device has passed authentication and authorization.

[0087] Step S3043: Send a metadata acquisition request to the central node.

[0088] The image distribution method provided in this embodiment sends an authentication request to the central node based on the image acquisition request before sending a metadata acquisition request to the central node, so that the central node can authenticate and authenticate the terminal device that requests to obtain the target image according to the authentication request. On the one hand, it can avoid the mis-sending of the image. On the other hand, this embodiment directly requests the central node to authenticate and authenticate the device to prevent the image from being mis-sent because the device list information of the image cannot be synchronized to the edge node in time when it changes. In this way, the security of image distribution is improved.

[0089] See also Fig. 9 , Fig. 9 yes Figure 7 The flowchart of step S306 in the illustrated embodiment is an exemplary embodiment.

[0090] In this embodiment, the image file data corresponding to the target image includes multiple layers of image files and image file identifiers corresponding to each layer of image files, and the image metadata corresponding to the target image includes image file identifiers and layer numbers corresponding to each layer of image files.

[0091] like Fig. 9 As shown, step S306 includes the following steps:

[0092] Step S3061: Based on the image file identifier of each layer of the image file, determine the layer sequence number of the corresponding image file.

[0093] In this embodiment, an image is composed of multiple image file layers, each image file layer stores part of the image data, the image file identifier is used to uniquely represent the image file layer, and the layer sequence number of the image file is used to represent the arrangement sequence number of the corresponding image file layer from top to bottom in the image.

[0094] Step S3062: According to the layer sequence number of each layer of the image file, multiple layers of image files are combined to obtain a usable target image.

[0095] For example, the target image includes three layers of image files, the layer number of the first layer image file is 1, the layer number of the second layer image file needs to be 2, and the layer number of the third layer image file needs to be 3. Then, the first layer image file, the second layer image file, and the third layer image file are arranged from top to bottom to obtain an available target image.

[0096] Step S3063: Return the available target image to the terminal device.

[0097] Since the central node sends the image file data corresponding to the target image to the edge node in advance so that the edge image warehouse can store it, and only after receiving the image acquisition request, the image metadata corresponding to the target image is obtained from the central node. Obviously, this image distribution method separates the image metadata and image file data corresponding to the target image, which can ensure the security of image file distribution. After the edge node obtains the image metadata corresponding to the target image, the image file data and image metadata corresponding to the target image are recombined at the edge node to obtain an available target image, and then the available target image is sent to the terminal device, so that the terminal device does not need to combine the image metadata and image file data corresponding to the target image, and can directly use the available target image to enable the new container, thereby improving work efficiency.

[0098] See also Fig.10 , Fig.10 is a block diagram of an image distribution device shown in an exemplary embodiment of the present application, such as Fig.10 As shown, the image distribution device 1000 includes an acquisition module 1100 , a first sending module 1200 and a second sending module 1300 .

[0099] Among them, the acquisition module 1100 is used to obtain the image stored in the central image warehouse, and the image includes corresponding image metadata and image file data; the first sending module 1200 is used to send the image file data corresponding to the image stored in the central image warehouse to the edge node, so that the edge node stores the received image file data in the edge image warehouse; the second sending module 1300 is used to return the image metadata corresponding to the target image to the edge node for storage according to the metadata acquisition request sent by the edge node, wherein the target image is the image that the terminal device requests to obtain from the edge node.

[0100] In another exemplary embodiment, the image distribution device 1000 may further include a third receiving module, an authentication module, and a returning module.

[0101] Among them, the third receiving module is used to receive the authentication and authorization request sent by the edge node; the authentication and authorization module is used to authenticate and authenticate the terminal device requesting to obtain the target image according to the authentication and authorization request; the return module is used to return a confirmation message to the edge node if the terminal device passes the authentication and authorization, so that the edge node initiates a metadata acquisition request based on the confirmation message.

[0102] In another exemplary embodiment, the authentication module includes an authentication unit and an authentication unit.

[0103] Among them, the authentication unit is used to query the device information stored in association with the target image in the database based on the device information contained in the authentication and authorization request. If the device information is queried, it is determined that the terminal device has passed the identity authentication; the authentication unit is used to query the device token stored in association with the device information in the database. If the queried device token is the same as the device token contained in the authentication and authorization request, it is determined that the terminal device has passed the authentication.

[0104] See also Fig.11 , Fig.11 is a block diagram of an image distribution device shown in an exemplary embodiment of the present application, such as Fig.11 As shown, the image distribution device 2000 includes a first receiving module 2100 , a third sending module 2200 , a second receiving module 2300 and a fourth sending module 2400 .

[0105] The first receiving module 2100 is used to receive an image acquisition request sent by the terminal, and the image acquisition request is used to request to obtain the target image; the third sending module 2200 is used to send a metadata acquisition request to the central node based on the image acquisition request, and the metadata acquisition request is used to request to obtain the image metadata corresponding to the target image stored in the central image warehouse; the second receiving module 2300 is used to receive the image metadata corresponding to the target image returned by the central node, and store the received image metadata in the edge image warehouse; the fourth sending module 2400 is used to return the image metadata and image file data corresponding to the target image stored in the edge image warehouse to the terminal device.

[0106] In another exemplary embodiment, the image distribution device 2000 may further include a fourth receiving module and a storage module.

[0107] Among them, the fourth receiving module is used to receive the image file data corresponding to the image stored in the central image warehouse sent by the central node at a regular interval; the storage module is used to store the received image file data in the edge image warehouse.

[0108] In another exemplary embodiment, the third sending module 2200 includes a first sending unit, a receiving unit, and a second sending unit.

[0109] Among them, the first sending unit is used to send an authentication request to the central node based on the image acquisition request, so that the central node can authenticate and authenticate the terminal device requesting to obtain the target image according to the authentication request; the receiving unit is used to receive a confirmation message returned by the central node, and the confirmation message is used to indicate that the terminal device has passed the authentication and authentication; the second sending unit is used to send a metadata acquisition request to the central node.

[0110] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0111] In another exemplary embodiment, the present application provides an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the image distribution method as described above is implemented.

[0112] Another aspect of the present application further provides a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor, implements the image distribution method provided in any of the previous embodiments.

[0113] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the image distribution method provided in each of the above embodiments.

[0114] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0115] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0117] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A mirror distribution method, characterized in that: include: Obtaining the image and storing it in the central image warehouse, the image includes the corresponding image metadata and image file data; Sending the image file data corresponding to the image stored in the central image warehouse to the edge node, so that the edge node stores the received image file data in the edge image warehouse; According to the metadata acquisition request sent by the edge node, the image metadata corresponding to the target image is returned to the edge node for storage, wherein the target image is the image that the terminal device requests to obtain from the edge node.

2. The method according to claim 1, characterized in that Before returning the image metadata corresponding to the target image to the edge node for storage according to the metadata acquisition request sent by the edge node, the method further includes: Receive the authentication request sent by the edge node; According to the authentication request, the terminal device requesting to obtain the target image is authenticated and authenticated; If the terminal device passes the authentication and authorization, a confirmation message is returned to the edge node, so that the edge node initiates the metadata acquisition request based on the confirmation message.

3. The method according to claim 2, characterized in that The step of performing authentication and authorization processing on the terminal device requesting to obtain the target image according to the authentication and authorization request includes: Based on the device information contained in the authentication request, query the database for device information stored in association with the target image, and if the device information contained in the authentication request is found, determine that the terminal device has passed the identity authentication; The device token stored in association with the device information is queried in the database, and if the queried device token is the same as the device token contained in the authentication request, it is determined that the terminal device has passed the authentication.

4. A mirror distribution method, characterized in that: include: Receiving an image acquisition request sent by a terminal device, wherein the image acquisition request is used to request to acquire a target image; Based on the image acquisition request, a metadata acquisition request is sent to a central node, wherein the metadata acquisition request is used to request to obtain image metadata corresponding to the target image stored in the central image repository; Receive the image metadata corresponding to the target image returned by the central node, and store the received image metadata in the edge image warehouse; The image metadata and image file data corresponding to the target image stored in the edge image warehouse are returned to the terminal device.

5. The method according to claim 4, characterized in that Before the image acquisition request sent by the receiving terminal device is received, the method includes: Receive the image file data corresponding to the image stored in the central image warehouse sent by the central node regularly; The received image file data is stored in the edge image warehouse.

6. The method according to claim 4, characterized in that The step of sending a metadata acquisition request to a central node based on the image acquisition request includes: Based on the image acquisition request, sending an authentication request to the central node, so that the central node performs authentication and authentication processing on the terminal device requesting to obtain the target image according to the authentication request; Receive a confirmation message returned by the central node, wherein the confirmation message is used to indicate that the terminal device has passed the authentication and authorization; The metadata acquisition request is sent to the central node.

7. The method according to claim 5, characterized in that The image file data corresponding to the target image includes multiple layers of image files and image file identifiers corresponding to each layer of image files, and the image metadata corresponding to the target image includes image file identifiers of each layer of image files and layer sequence numbers of each layer of image files; The returning the image metadata and image file data corresponding to the target image stored in the edge image warehouse to the terminal device includes: Based on the image file identifier of each layer of the image file, determine the layer sequence number of the corresponding image file; Combining the multiple layers of image files according to the layer sequence number of each layer of image files to obtain an available target image; The available target image is returned to the terminal device.

8. A mirror distribution device, characterized in that: include: An acquisition module is used to acquire an image stored in a central image repository, wherein the image includes corresponding image metadata and image file data; A first sending module, configured to send the image file data corresponding to the image stored in the central image warehouse to the edge node, so that the edge node stores the received image file data in the edge image warehouse; The second sending module is used to return the image metadata corresponding to the target image to the edge node for storage according to the metadata acquisition request sent by the edge node, wherein the target image is the image that the terminal device requests to obtain from the edge node.

9. A mirror distribution device, characterized in that: include: A first receiving module, configured to receive an image acquisition request sent by a terminal, wherein the image acquisition request is used to request acquisition of a target image; A third sending module is used to send a metadata acquisition request to the central node based on the image acquisition request, wherein the metadata acquisition request is used to request to obtain the image metadata corresponding to the target image stored in the central image warehouse; A second receiving module is used to receive the image metadata corresponding to the target image returned by the central node, and store the received image metadata in the edge image warehouse; The fourth sending module is used to return the image metadata and image file data corresponding to the target image stored in the edge image warehouse to the terminal device.

10. An electronic device, characterized in that: include: a memory storing computer-readable instructions; A processor reads the computer-readable instructions stored in the memory to execute the method according to any one of claims 1 to 7.

11. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Resource acquisition method and apparatus, resource distribution method and apparatus, resource downloading method and apparatus, device, and storage medium

    CN108683747A

  • Mirror image distribution system and method

    CN117675837A