| CPC G06F 16/172 (2019.01) [G06F 16/137 (2019.01)] | 9 Claims |

|
1. A batch-type image distribution method based on an IPFS, applied to container clusters in a computer system, comprising:
using a container orchestration engine to obtain a container scheduling result, and obtaining a list of cluster nodes needed to download images based on the container scheduling result;
based on the list of cluster nodes, calculating a caching ratio of an image layer of images to be distributed that each node already has owned, comparing the caching ratio of each node with a threshold of a preset node, and selecting a node with the caching ratio greater than the threshold to obtain a complete image from an image repository;
adding the node with the complete image in the list of cluster nodes to a list of source nodes, and adding remaining nodes needed to download images in the list of cluster nodes to a list of demand nodes, and constructing an initial InterPlanetary File System (IPFS) network based on each node in the list of source nodes, and exporting and sharing the image based on the IPFS network;
calculating target demand nodes using an optimization algorithm, and inputting the target demand nodes in a batch into the IPFS network for image download according to results of the optimization algorithm, and importing the downloaded image into a container and starting the container; and
removing a demand node that downloads the image completely and currently from the list of demand nodes and adding the removed demand node to the list of source nodes, and continuing image download of demand nodes in a next batch until the list of demand nodes is empty and the image download of all demand nodes are completed.
|