Peer evaluation method, peer scorer, and mirror distribution method and system

By using peer evaluation methods and scorers, combined with DHT networks and IP multicast to optimize image distribution, the problem of low image distribution efficiency in edge computing environments is solved, efficient image downloading and resource utilization are achieved, and system stability and storage resource management are improved.

WO2025195019A1PCT designated stage Publication Date: 2025-09-25HAINAN INST OF ZHEJIANG UNIV +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/074668
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-19
Filing Date
2025-01-24
Publication Date
2025-09-25

AI Technical Summary

Technical Problem

Existing image distribution solutions are inefficient in edge computing environments. When the network status of centralized warehouses is poor, the image pulling time increases, the centralized image warehouse is heavily burdened, and existing P2P technologies lack intelligent selection of network resources in edge environments.

Method used

A peer evaluation method and peer scorer are provided. The peer suitability score is generated by content popularity and network score, the image distribution process is optimized, peer discovery is performed by combining DHT network and IP multicast, the suitability score is dynamically updated, and peers in the local area network are given priority for peer-to-peer downloading.

Benefits of technology

It improves image download efficiency and resource utilization, reduces network traffic and time overhead, optimizes image distribution in edge computing environments, reduces the burden on centralized warehouses, and improves system robustness and storage resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025074668_25092025_PF_FP_ABST
    Figure CN2025074668_25092025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a peer evaluation method, a peer scorer, and a mirror distribution method and system. The evaluation method comprises: evaluating the applicability score of each peer on the basis of content popularity and a network state, and scoring the applicability of a target peer according to the following steps. The mirror distribution method comprises: in a point-to-point downloading process, using peers containing a target mirror layer as candidate peers, and selecting corresponding candidate peers on the basis of applicability scores for point-to-point downloading. The evaluation method provided by the present application considers both the network performance and the content popularity, the applicability scores reflect the selection applicability of the peers, and in practical applications, a person skilled in the art can perform peer selection on the basis of the applicability scores so as to optimize the mirror downloading efficiency and resource utilization in edge computing environments.
Need to check novelty before this filing date? Find Prior Art

Description

Peer evaluation method, peer scorer, mirror distribution method and system Technical Field

[0001] The present invention relates to the field of network technology, and in particular to a peer evaluation method, a peer scorer, and a mirror distribution method and system. Background Art

[0002] Container technology is becoming increasingly important due to its lightweight and portable nature. Whether leveraging the full set of immutable dependency environments provided by containers to simplify deployment or using cloud-native microservices, containers are a core component. However, image distribution in edge computing environments faces significant challenges.

[0003] Existing image distribution solutions often rely on centralized repositories, which limits their effectiveness in dynamic network environments. For example, popular solutions like Docker Hub (Docker's official public cloud image repository) and Google Container Registry (Google's open-source container image repository), while performing well in stable network environments, face numerous challenges in edge computing scenarios where network quality fluctuates significantly.

[0004] These challenges mainly manifest themselves in two aspects: first, when the network status is poor, the time to pull images from the centralized repository will increase significantly; second, when a large number of containers are deployed at the same time, centralized image pull requests will also bring a heavy burden to the centralized image repository.

[0005] To address the above issues, current methods to improve the efficiency of image distribution include optimizing the download order of image layers and using compression technology to reduce data transmission volume. However, in edge computing environments where network status changes frequently, the effectiveness of the above methods is limited.

[0006] To address the above issues, P2P technology (peer-to-peer technology) is currently used to disperse the pressure, but the existing P2P technology lacks consideration for network resources in edge environments. Summary of the Invention

[0007] The present invention addresses the shortcomings of the existing P2P technology used in mirror distribution scenarios, such as the lack of a peer evaluation method and the inability to intelligently select suitable peers under conditions of dynamic changes in the network environment and limited resources. The invention provides a peer evaluation method and a peer scorer, as well as a mirror distribution method and system.

[0008] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0009] A peer evaluation method is provided, wherein each discovered peer is used as a target peer, and the suitability of the target peer is scored according to the following steps:

[0010] Obtaining the image owned by the target peer to obtain a target image set, wherein the image includes a plurality of image layers;

[0011] Determining the popularity of the image layer based on the distribution of the image layer among all discovered peers;

[0012] Generating a content popularity score for the target peer based on the popularity corresponding to each image layer in the target image set;

[0013] Get the target peer's network score;

[0014] A suitability score for the target peer is generated based on the content popularity score and the network score.

[0015] As an implementable approach:

[0016] The method for obtaining the network score is as follows:

[0017] Obtain the current transmission speed from the target peer to the target client;

[0018] Obtain the global average speed corresponding to the target client at the current moment;

[0019] A network score of the target peer is generated based on the transmission speed and the global average speed.

[0020] A peer scorer is used to take each discovered peer as a target peer and score the suitability of the target peer;

[0021] It includes a network score calculation unit, a content popularity calculation unit and a scoring unit;

[0022] The network score calculation unit is used to obtain the network score of the target peer;

[0023] The content popularity calculation unit includes:

[0024] An image acquisition unit, configured to acquire an image owned by the target peer to obtain a target image set, wherein the image includes a plurality of image layers;

[0025] An image layer scoring unit, configured to determine the popularity of an image layer based on the distribution of the image layer among all discovered peers;

[0026] a peer scoring unit, configured to generate a content popularity score for a target peer based on the popularity corresponding to each image layer in the target image set;

[0027] The scoring unit is configured to generate a suitability score for the target peer based on the content popularity score and the network score.

[0028] A mirror distribution method includes the following steps:

[0029] Obtain an image download request containing information about the layer to be downloaded, and use the image layer corresponding to the information about the layer to be downloaded as the target image layer;

[0030] When the local cache does not contain the target image layer, peer discovery is performed based on a preset discovery time. During the peer discovery process, each discovered peer is scored based on the above-mentioned peer evaluation method, and the suitability score of each peer is generated and dynamically updated;

[0031] The peers containing the target image layer are taken as candidate peers, and corresponding candidate peers are selected based on the applicability score for peer-to-peer downloading.

[0032] As an implementation method, the target image layer is divided into a plurality of data blocks, and a corresponding candidate peer is selected for each data block to make a download request. The step of selecting the corresponding candidate peer for the target data block includes:

[0033] Randomly select at least one candidate peer to obtain the target peer;

[0034] A download request for downloading the target data block is sent to the target peer with the highest suitability score.

[0035] As one possible implementation, peer discovery is performed based on a DHT network, Tracker, and IP multicast.

[0036] As an implementable method, Tracker is automatically elected based on the stability of the node.

[0037] As an implementation method, cache information is obtained based on a preset cleaning cycle, and when it is determined based on the cache information that cache space is insufficient, image cache cleaning is performed according to the following steps:

[0038] Sort the cached image layers by frequency of use from low to high;

[0039] Starting from the least frequently used image layer, check other nodes in the LAN to see if they have the same image layer. Until a node finds an image layer that is already in use, clean up the image layer and end the cleaning cycle.

[0040] When all cached image layers are not retained by other nodes, the least frequently used image layer is cleaned up and the cleaning cycle ends.

[0041] As an implementation method, when the layer volume of the target image layer is less than a preset first volume threshold, or when no peer containing the target image layer is found within a preset discovery time, the target image layer is downloaded from the central image repository.

[0042] An image distribution system includes an image downloading system, wherein the image downloading system includes:

[0043] Interface module;

[0044] Cache module;

[0045] Download engine;

[0046] The interface module is configured to obtain an image download request including information of a layer to be downloaded, and use the image layer corresponding to the information of the layer to be downloaded as the target image layer;

[0047] The download engine:

[0048] Used to retrieve the target image layer from the cache module;

[0049] Also configured to, when the cache module does not contain the target image layer, perform peer discovery based on a preset discovery time, and during the peer discovery process, score each discovered peer based on the above-mentioned peer evaluation method, and generate and dynamically update the suitability score of each peer;

[0050] It is also used to take the peers containing the target image layer as candidate peers, and select corresponding candidate peers for peer-to-peer downloading based on the applicability score.

[0051] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and drawings. The best embodiments or means of the present invention will be described in detail with reference to the drawings, but they are not intended to limit the technical solutions of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0053] FIG1 is a schematic diagram of an evaluation process of a peer evaluation method of the present invention;

[0054] FIG2 is a schematic diagram of the process of the P2P download task in Example 3;

[0055] FIG3 is a schematic diagram of module connections of a mirror distribution system according to the present invention. DETAILED DESCRIPTION

[0056] The present invention will be further described in detail below with reference to the examples. The following examples are intended to explain the present invention but the present invention is not limited to the following examples.

[0057] Example 1: A peer evaluation method, wherein each discovered peer is used as a target peer, and the suitability of the target peer is scored according to the following steps:

[0058] S100, obtaining the content popularity score of the target peer;

[0059] Content popularity scores are based on how often peers in the network request specific content;

[0060] The specific steps of obtaining the content popularity score include:

[0061] S110, obtaining the image owned by the target peer to obtain a target image set, wherein the image includes several image layers;

[0062] S120. Determine the popularity of the image layer based on the distribution of the image layer among all discovered peers.

[0063] The formula for calculating popularity is:

[0064] in:

[0065] ρ l Indicates the popularity of image layer l in image i;

[0066] Represents the set of peers known to the target client, where the target client is the client that issues the image download request, i.e., Represents the set of discovered peers;

[0067] Represents the set of images owned by peer p;

[0068] When the image layer l exists in peer p, then is defined as 0 otherwise.

[0069] S130. Generate a content popularity score for the target peer based on the popularity corresponding to each image layer in the target image set;

[0070] Content popularity score of peer p The calculation formula is:

[0071] in:

[0072] Represents the set of image layers that constitute image i;

[0073] ρ l Indicates the popularity of the corresponding image layer l;

[0074] λ is the preset weight parameter.

[0075] S200: Obtain the network score of the target peer;

[0076] The specific steps include:

[0077] S210. Obtain the current transmission speed from the target peer to the target client;

[0078] Obtaining a historical transmission speed from a target peer to a target client, and calculating the transmission speed based on the historical transmission speed;

[0079] In this embodiment, a sliding window is maintained in advance for each peer. The sliding window is used to record the historical transmission speed from the peer to the target client. The historical transmission speed is extracted from the sliding window corresponding to the target peer.

[0080] The calculation formula for the transmission speed in this embodiment is:

[0081] in:

[0082] represents the transmission speed of peer p at the current time t;

[0083] represents the sliding window corresponding to peer p. The length of the sliding window is L. Those skilled in the art can set the length of the sliding window.

[0084] Indicates the historical transmission speed of peer p at time t'.

[0085] S220: Obtain the global average speed corresponding to the target client at the current moment;

[0086] Obtaining a historical global average speed corresponding to the target client, and calculating the transmission speed based on the historical global average;

[0087] In this embodiment, a global sliding window is maintained in advance. The global sliding window is used to record the historical global average speed;

[0088] The calculation formula of the global average speed in this embodiment is:

[0089] in:

[0090] represents the global average speed corresponding to the current time t;

[0091] represents a global sliding window, the length of which is L. Those skilled in the art can set the length of the global sliding window by themselves;

[0092] represents the global average velocity corresponding to time t'.

[0093] S230: Generate a network score for the target peer based on the transmission speed and the global average speed.

[0094] The network score of peer p at time t It can be obtained by the following formula:

[0095] S300: Generate a suitability score for the target peer based on the content popularity score and the network score.

[0096] On the premise of knowing the content popularity score and the network score, those skilled in the art can set the calculation mechanism of the adaptive score by themselves, such as weighted summation. In this embodiment, a score of [0, 100] is assigned to the peer based on the content popularity score and the network score.

[0097] The evaluation method proposed in this embodiment takes into account both network performance and content popularity. The applicability score reflects the suitability of peer selection. In practical applications, those skilled in the art can select peers based on the applicability score to optimize image download efficiency and resource utilization in edge computing environments.

[0098] 1 , further, when the target peer and the target client are located in the same local area network, the target peer is given the highest score.

[0099] Existing P2P technology cannot distinguish between local and remote neighbors. When both local and remote neighbors have mirror copies, downloading from the local neighbor cannot be prioritized, wasting valuable egress bandwidth.

[0100] This embodiment further introduces network location into the suitability evaluation, and directly assigns the highest suitability score to the target peer located in the same local area network as the target client, thereby reducing the computational complexity of the evaluation algorithm while ensuring the optimization effect.

[0101] Embodiment 2: A peer scorer is configured to take each discovered peer as a target peer and score the suitability of the target peer;

[0102] It includes a network score calculation unit, a content popularity calculation unit and a scoring unit;

[0103] The network score calculation unit is used to obtain the network score of the target peer;

[0104] The content popularity calculation unit includes:

[0105] An image acquisition unit, configured to acquire an image owned by the target peer to obtain a target image set, wherein the image includes a plurality of image layers;

[0106] An image layer scoring unit, configured to determine the popularity of an image layer based on the distribution of the image layer among all discovered peers;

[0107] a peer scoring unit, configured to generate a content popularity score for a target peer based on the popularity corresponding to each image layer in the target image set;

[0108] The scoring unit is configured to generate a suitability score for the target peer based on the content popularity score and the network score.

[0109] Embodiment 3: A mirror distribution method, including a mirror download method;

[0110] The image download method includes the following steps:

[0111] S100: Obtain an image download request initiated by a client;

[0112] The image download request;

[0113] The image layer corresponding to the layer information to be downloaded is used as the target image layer;

[0114] S200, checking whether the local cache contains the target image layer;

[0115] When the local cache contains the target image layer, returning the target image layer to the client;

[0116] When the local cache does not contain the target image layer, execute step S300;

[0117] S300, performing peer discovery and scoring the discovered peers;

[0118] In this embodiment, a discovery time is preset. When the time for peer discovery reaches the discovery time, the peer discovery step is ended and the process goes to step S400.

[0119] This embodiment limits the time for peer discovery to avoid the system wasting too much time in confirming whether the image is cached on the network. Those skilled in the art can set the discovery time according to actual needs.

[0120] In this embodiment, peer discovery is performed in parallel based on a DHT network (Distributed Hash Table net), a tracker, and IP multicast. In this embodiment of the present invention, a local peer discovery method based on multicast is given priority, thereby avoiding the more time-consuming DHT and tracker discovery processes. In addition, the local peer discovery based on multicast controls network traffic within the local area network, thereby minimizing unnecessary traffic overhead and significantly reducing data transmission volume and time overhead.

[0121] During the peer discovery process, each discovered peer is scored based on the peer evaluation method described in Example 1, and the suitability score of each peer is generated and dynamically updated;

[0122] S400, generating a corresponding download task based on the peer discovery result;

[0123] When no peer containing the target image layer is found, an HTTP download task is generated, and the target image layer is downloaded from the central image repository using HTTP download.

[0124] When a peer containing the target image layer is found, a P2P download task is generated and step S500 is executed;

[0125] The efficiency of peer location in a DHT network is a key consideration in this process, as the multiple network hops involved can cause significant time delays. This is especially true when there are poor network conditions between peers (such as limited bandwidth or high packet loss), which further prolongs the time required for peer discovery.

[0126] Taking into account the negative impact that such delay may have on user experience, this embodiment implements a time limit mechanism for peer aggregation through the design of discovery time. Specifically, if the availability of the image can be confirmed within the set time window, this indicates that the image holder exists in the neighboring area of ​​the network, making P2P download the preferred path; on the contrary, if the image holder cannot be successfully located within the time limit, this usually means that there is no holder in the local network or the holder is far away from the requesting node, so the system will choose to download the image directly from Docker Hub.

[0127] S400, executing a P2P download task;

[0128] The peers containing the target image layer are taken as candidate peers, and corresponding candidate peers are selected based on the suitability score for peer-to-peer downloading. That is, the target image layer is divided into several data blocks, and corresponding candidate peers are selected for each data block to make download requests.

[0129] The specific steps include:

[0130] S410, obtaining the data block corresponding to the current download batch, obtaining the target data block;

[0131] Divide the target image layer into several data blocks in advance, and divide the data blocks into several download batches when executing the P2P download task;

[0132] In peer-to-peer (P2P) downloading, content is divided into several blocks as a conventional technical means. Block division enables subsequent download processes to download different blocks from multiple peers in the network, thereby fully utilizing the available bandwidth;

[0133] In this embodiment, after obtaining the image download request initiated by the client, the image layer size information is obtained according to the information of the layer to be downloaded, and the target image layer is converted to a block range according to the byte range information in the request (i.e., the "Range" header) to obtain the corresponding data block;

[0134] If the chunks are too large, it will be difficult to request many peers at the same time, making it difficult to fully utilize all available potential bandwidth. However, if the chunks are too small, the communication overhead of the system will also be high;

[0135] This embodiment presets a second image volume threshold, a first block size, and a second block size, wherein the first block size is larger than the second block size;

[0136] When the layer volume of the target image layer is greater than or equal to the second volume threshold, the block division is performed according to the first block size; otherwise, the block division is performed according to the second block size;

[0137] That is, for images with a larger size, the present invention uses a larger block size, so as to balance parallelism and overhead. The opposite is true for smaller images.

[0138] Those skilled in the art may set the first image volume threshold, the first block size, and the second block size according to actual needs, and this embodiment does not limit them in detail.

[0139] S420: Select candidate peers for peer-to-peer downloading of the target data block;

[0140] S421. Randomly select at least one candidate peer to obtain a target peer;

[0141] S422: Send a download request for the target data block to the target peer with the highest suitability score.

[0142] This embodiment avoids the concentration of requests on a small number of high-scoring candidate peers through the design of candidate peer sampling, thereby effectively ensuring the parallel execution of download tasks and further optimizing download efficiency.

[0143] The downloaded data blocks will be stored in the local cache and sent to the client. Once the current batch is successfully completed, the process will be repeated to download a new batch.

[0144] 2 , a P2P download task includes several download batches, each of which contains several data blocks to be downloaded. The download process of the current download batch includes the following steps:

[0145] (1) The batch starts; the target data block is determined. In the figure, the target data block is block x.

[0146] (2) Sampling based on scores;

[0147] Real-time update of the suitability scores of the peers aggregated in the peer aggregator, i.e., dynamically update the suitability scores of all discovered peers;

[0148] Sampling candidate peers to obtain target peers. In this embodiment, three candidate peers are randomly selected as target peers.

[0149] Obtain the suitability score of the target peer and determine the target peer with the highest suitability score. For example, peer 1 (peer 1) has the highest suitability score in the figure.

[0150] (3) Peer 1 is selected as the source of block x;

[0151] At this point a request is sent to peer 1 to download block x.

[0152] (4) Get block x from peer 1;

[0153] (5) Hash tree verification;

[0154] After downloading block x, block x is integrity verified. If the block verification fails, it is returned to the pending queue. If the block verification succeeds, it is stored in the local cache and sent to the client. This is a common step in existing P2P downloads and will not be described in detail in this manual.

[0155] Further:

[0156] When the layer volume of the target image layer is less than a preset first volume threshold, the target image layer is downloaded from the central image repository.

[0157] In this embodiment, when it is detected in step S200 that the local cache does not contain the target image layer, the layer volume determination step is performed;

[0158] The first volume threshold is smaller than the second volume threshold. In this embodiment, the first volume threshold is set to 1 MiB.

[0159] To improve the efficiency of retrieval via P2P networks, we conducted an in-depth analysis of the latest image data on Docker Hub, focusing on the characteristics of the top 100 most popular images. The analysis showed that the vast majority of image layers are relatively small, with the median layer size being only 1.03 MiB.

[0160] These comprehensive peer discovery processes can be disproportionate in duration compared to downloading directly from the central registry; however, given the prevalence of small layer sizes, relying solely on downloads from the central registry can overload the central registry.

[0161] To solve this problem, this embodiment strikes a balance between download efficiency and resource utilization by designing the layer volume determination step. When the layer volume is small, it is downloaded directly from the central image repository, avoiding the long time required for the peer discovery process that relies on the full DHT and tracker, thereby ensuring fast access and minimizing the load on the central image repository.

[0162] Furthermore, P2P technology uses Trackers to accelerate the process of mutual discovery between nodes. The implementation of Trackers is centralized and there is a possibility of single point failure. To address this problem, this embodiment automatically elects Trackers based on the stability of the nodes. The nodes are clients, and the length of time they are online is used as a measure of node stability. The longer the online time, the higher the node stability.

[0163] In decentralized P2P networks, trackers are often used to coordinate communication between peers. However, traditional centralized trackers can easily become system bottlenecks and single points of failure. This embodiment embeds tracker functionality directly into the client, implementing a fully autonomous tracker system where tracker election and management are fully automated, requiring no human intervention. This design not only eliminates the shortcomings of centralized trackers but also enables rapid system recovery from node failures, ensuring the continuity of the image distribution process and overall system stability. This completely changes the existing separation between trackers and clients, and thoroughly resolves the centralization issue of traditional trackers.

[0164] The specific workflow is as follows:

[0165] ① The target node announces the start of the Tracker election process to all its neighbors.

[0166] After the node starts, it will ask all neighbors whether they have a Tracker available and store the nodes with Trackers for subsequent requests;

[0167] When the Tracker election process begins, each node with a Tracker uses its own online time as a metric to participate in the election, and uses the FloodMax algorithm to select the node p with the longest online time. max ;

[0168] The purpose of selecting the node with the longest online time is to ensure the stability of the Tracker as much as possible.

[0169] ② Node p max Confirm that it has become a tracker, activate its built-in tracker module, and broadcast the information that it has become a tracker to the entire network;

[0170] At the same time, each node in the network should forward the notification information to ensure that the newly born Tracker is known to all nodes in the network.

[0171] If the node p max If the processing capability is lost for some reason, there will be a node that discovers the request p max If it fails, the node will become the target node and will also initiate the Tracker election process until a new Tracker is elected. Furthermore, P2P technology inevitably introduces local cache overhead. In edge computing environments, cache overhead is non-negligible relative to the limited storage space. To address this issue, this embodiment introduces a method based on the container image's historical usage and distribution on other nodes to remove some image caches when storage space is tight.

[0172] In this embodiment, cache information is obtained based on a preset cleaning cycle, and when it is determined based on the cache information that cache space is insufficient, image cache cleaning is performed according to the following steps:

[0173] Sort the cached image layers by frequency of use from low to high;

[0174] Starting from the least frequently used image layer, check other nodes in the LAN to see if they have the same image layer. Until a node finds an image layer that is already in use, clean up the image layer and end the cleaning cycle.

[0175] When all cached image layers are not retained by other nodes, the least frequently used image layer is cleaned up and the cleaning cycle ends.

[0176] Those skilled in the art can set the cleaning cycle by themselves. In this embodiment, a cache cleaning judgment is performed every 30 seconds.

[0177] In this embodiment, the cache information is the ratio of available disk space. When it is greater than a preset available threshold, this cleaning is skipped. Otherwise, the image cache cleaning process is entered. Each time the cache cleaning process is entered, one image layer will be deleted.

[0178] This embodiment determines the image layers to be cleared based on the usage frequency of the image layers and the distribution of the image layers in the local network. That is, image layers that have not been used for a long time and image layers that already exist in the local network are removed first, ensuring that the removed images do not have a significant impact on the operation of system services. Even if the image is needed again, it can be retrieved at a low cost.

[0179] Through the design of the image cache cleaning mechanism, this embodiment can intelligently decide which image caches can be cleaned based on the frequency of container image usage and its distribution in the local network. By regularly evaluating the importance and substitutability of images, the system can automatically remove image caches that have not been used for a long time or are easily accessible in the local network, thereby freeing up valuable storage space. The implementation of this mechanism not only optimizes the utilization efficiency of storage resources, but also reduces the demand for network bandwidth due to frequent image downloads, ensuring that the system can adapt to the needs of edge computing environments with tight storage space while maintaining high-performance operation, and can efficiently manage the limited storage resources of edge computing devices.

[0180] Example 4: Image distribution system, as shown in Figure 3, includes an image download system, a central image repository, and a Tracker system:

[0181] The image download system includes:

[0182] An interface module is configured to obtain an image download request including information of a layer to be downloaded, and use the image layer corresponding to the information of the layer to be downloaded as a target image layer;

[0183] Cache module;

[0184] Download Engine:

[0185] Used to retrieve the target image layer from the cache module;

[0186] Also configured to, when the cache module does not contain the target image layer, perform peer discovery based on a preset discovery time, and during the peer discovery process, score each discovered peer based on the peer evaluation method described in Example 1, and generate and dynamically update the suitability score of each peer;

[0187] It is also used to take the peers containing the target image layer as candidate peers, and select corresponding candidate peers for peer-to-peer downloading based on the applicability score.

[0188] The download engine is used to execute the image download method described in Example 3.

[0189] In this embodiment, the download engine includes:

[0190] Peer aggregation, used for peer discovery and aggregation. In this embodiment, it is based on the DHT network, and Tracker and IP multicast perform peer discovery in parallel;

[0191] A peer scorer, configured to score each peer in the peer aggregator based on content popularity and network status, i.e., the peer scorer described in Example 2;

[0192] A P2P downloader, configured to respond to a P2P download task, select peers containing the target image layer as candidate peers, select corresponding candidate peers for peer-to-peer download based on the suitability score, and store the downloaded image in a cache;

[0193] The request dispatcher:

[0194] Used to check whether the local cache contains the target image layer;

[0195] Also used for returning the target image layer to the client when the local cache contains the target image layer;

[0196] Also used for generating a P2P download task or a remote download task when the local cache does not contain the target image layer;

[0197] Also used for generating a remote download task when the layer volume of the target image layer is less than a preset first volume threshold;

[0198] It is also used to request the dispatcher to start peer discovery from the peer aggregator when the layer volume of the target image layer is greater than or equal to a preset first volume threshold, and to generate a P2P download task or a remote download task based on the peer discovery result. That is, if no peer containing the target image layer is found within a preset discovery time, a remote download task is generated;

[0199] It is also used to perform remote download tasks, that is, download the target image layer from the central image warehouse.

[0200] Furthermore: The Tracker system is used for peer discovery and automatic Tracker election based on node stability.

[0201] Further:

[0202] The cache module includes a cache memory and a cache manager;

[0203] The cache memory is used to store the image layer;

[0204] The cache manager is used to search for image layers from the cache memory, and is also used to obtain cache information based on a preset cleaning cycle, and to clean up the image cache when it is determined that the cache space is insufficient based on the cache information.

[0205] Further:

[0206] The interface module uses the Docker API interface.

[0207] The Docker API interface makes full use of the standard API set by the Open Container Initiative (OCI). More specifically, the system adapts a portion of the Docker Registry API, allowing for complex container image retrieval and management while maintaining user-friendly operation. This integration enables seamless operation of image processing and hides the complex process behind it. The key to how the Docker engine handles image pull requests is to handle multiple HTTP requests defined in the standard: one for image metadata and the others for each layer that does not exist on the current device. Image metadata is typically a JSON structure containing detailed information about the requested image, while layer requests for specific layers return a tarball of the actual data. The present invention is specifically optimized for these two API endpoints:

[0208] Image metadata: Considering that the size of metadata is usually small, this invention does not use distributed storage. Instead, the metadata is cached in an in-memory storage structure and continuously updated to reflect changes in the remote Docker Registry.

[0209] Image layer: The image download interface is a lightweight encapsulation layer that delegates the complexity of the download strategy to the download engine.

[0210] The Docker engine's API encapsulation layer provides a concise interface. The present invention queries the Docker engine version via a UNIX socket during initialization and subsequently provides runtime data to other system components. Essentially, the Docker API acts as a bridge between the Docker engine and the present invention's internal mechanisms. Through this clever encapsulation, the present invention can precisely control and monitor the operation of the Docker engine, freeing it to focus on optimizing its inner workings.

[0211] This component is implemented as a transparent proxy. Requests between the local Docker engine and the remote registry should transparently pass through the encapsulation layer. However, the encapsulation layer should also record necessary metadata, such as the size of each image layer. Image pull requests should be intercepted and handled by the download engine. The encapsulation layer must ensure that the format of each API request and response remains unchanged, allowing for seamless loading and use without modifying the Docker engine.

[0212] This system utilizes a decentralized, distributed architecture, intelligently integrating key technical components such as the Docker API, a download engine, an embedded autonomous tracker, and a cache cleanup mechanism to optimize container image distribution in edge computing environments. The Docker API serves as the system's gateway to the outside world, ensuring seamless integration with existing container environments while shielding complex backend processing logic. The download engine dynamically selects the optimal image source based on real-time network conditions and content popularity, ensuring efficient data transmission, whether from a remote central repository or other nodes in the P2P network. The embedded autonomous tracker overcomes the vulnerability of traditional centralized trackers, which can easily become system bottlenecks and single points of failure. Its decentralized approach enhances the system's robustness and self-recovery capabilities. The cache cleanup mechanism, while ensuring data transmission efficiency, uses intelligent algorithms to manage local storage resources, optimize storage utilization, and reduce network bandwidth requirements. The overall system design aims to maximize the use of limited resources in edge computing environments while ensuring efficient and reliable container image distribution, thereby improving user experience and system performance.

[0213] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0214] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0215] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0216] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.

[0217] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0218] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0219] It should be noted that:

[0220] References in this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Therefore, appearances of the phrases "one embodiment" or "an embodiment" in various places throughout this specification do not necessarily refer to the same embodiment.

[0221] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0222] Furthermore, it should be noted that the specific embodiments described in this specification may vary in the shapes and names of their components. Any equivalent or simple variations based on the structure, features, and principles described in the patented concept of this invention are included within the scope of protection of this patent. Persons skilled in the art may make various modifications, additions, or substitutions to the described specific embodiments, and these modifications, as long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, shall fall within the scope of protection of this invention.

Claims

1. A peer evaluation method, characterized in that: Each discovered peer is used as a target peer, and the suitability of the target peer is scored according to the following steps: Obtaining the image owned by the target peer to obtain a target image set, wherein the image includes a plurality of image layers; Determining the popularity of the image layer based on the distribution of the image layer among all discovered peers; Generating a content popularity score for the target peer based on the popularity corresponding to each image layer in the target image set; Get the target peer's network score; A suitability score for the target peer is generated based on the content popularity score and the network score.

2. A peer evaluation method according to claim 1, Its characteristics are: The method for obtaining the network score is as follows: Obtain the current transmission speed from the target peer to the target client; Obtain the global average speed corresponding to the target client at the current moment; A network score of the target peer is generated based on the transmission speed and the global average speed.

3. A peer scorer, characterized in that: for taking each discovered peer as a target peer and scoring the suitability of the target peer; It includes a network score calculation unit, a content popularity calculation unit and a scoring unit; The network score calculation unit is used to obtain the network score of the target peer; The content popularity calculation unit includes: An image acquisition unit, configured to acquire an image owned by the target peer to obtain a target image set, wherein the image includes a plurality of image layers; An image layer scoring unit, configured to determine the popularity of an image layer based on the distribution of the image layer among all discovered peers; a peer scoring unit, configured to generate a content popularity score for a target peer based on the popularity corresponding to each image layer in the target image set; The scoring unit is configured to generate a suitability score for the target peer based on the content popularity score and the network score.

4. A mirror distribution method, characterized in that: The following steps are involved: Obtain an image download request containing information about the layer to be downloaded, and use the image layer corresponding to the information about the layer to be downloaded as the target image layer; When the local cache does not contain the target image layer, peer discovery is performed based on a preset discovery time, and during the peer discovery process, each discovered peer is scored based on the peer evaluation method according to claim 1 or 2, and a suitability score of each peer is generated and dynamically updated; The peers containing the target image layer are taken as candidate peers, and corresponding candidate peers are selected based on the applicability score for peer-to-peer downloading.

5. The image distribution method according to claim 4, characterized in that: Dividing the target image layer into a plurality of data blocks, selecting a corresponding candidate peer for each data block to make a download request, the step of selecting the corresponding candidate peer for the target data block comprising: Randomly select at least one candidate peer to obtain the target peer; A download request for downloading the target data block is sent to the target peer with the highest suitability score.

6. A mirror distribution method according to claim 4 or 5, characterized in that: Peer discovery is performed based on DHT networks, Tracker, and IP multicast.

7. The image distribution method according to claim 6, characterized in that: Automatically elect a Tracker based on node stability.

8. A mirror distribution method according to claim 4 or 5, characterized in that: Cache information is obtained based on a preset cleaning cycle, and when it is determined based on the cache information that cache space is insufficient, image cache cleaning is performed according to the following steps: Sort the cached image layers by frequency of use from low to high; Starting from the least frequently used image layer, check other nodes in the LAN to see if they have the same image layer. Until a node finds an image layer that is already in use, clean up the image layer and end the cleaning cycle. When all cached image layers are not retained by other nodes, the least frequently used image layer is cleaned up and the cleaning cycle ends.

9. A mirror distribution method according to claim 4 or 5, characterized in that: When the layer volume of the target image layer is less than a preset first volume threshold, or when no peer containing the target image layer is found within a preset discovery time, the target image layer is downloaded from the central image repository.

10. An image distribution system, including an image download system, characterized in that: The image download system includes: Interface module; Cache module; Download engine; The interface module is configured to obtain an image download request including information of a layer to be downloaded, and use the image layer corresponding to the information of the layer to be downloaded as the target image layer; The download engine: Used to retrieve the target image layer from the cache module; Also configured to, when the cache module does not contain the target image layer, perform peer discovery based on a preset discovery time, and during the peer discovery process, score each discovered peer based on the peer evaluation method according to claim 1 or 2, and generate and dynamically update the suitability score of each peer; It is also used to take the peers containing the target image layer as candidate peers, and select corresponding candidate peers for peer-to-peer downloading based on the applicability score.

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 preloading method and device and storage medium

    CN111897550A

  • Peer-to-peer node selection method and device

    CN116095092A

  • Mirror layer P2P (Peer-to-Peer) sharing transmission method and system based on Kubernetes scheduling scheme

    CN116737317A

  • Peer evaluation method, peer scoring device, mirror image distribution method and system

    CN118175171A