Server-aware computing image distribution method and system based on peer-to-peer transmission
By using a peer-to-peer transmission-based image distribution method, optimizing the function placement plan and image transmission strategy, the problem of long image distribution time in server-unaware computing is solved, achieving efficient image distribution and improving user experience.
Patent Information
- Application Number
- CN202410983533.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Existing image distribution technology has problems such as long image distribution time, low cache hit rate and network resource competition in server-unaware computing, especially low efficiency when load fluctuates and multiple applications are distributed simultaneously.
A peer-to-peer transmission-based image distribution method is adopted. Through image cache awareness and high-parallelism image distribution mode, function placement plan, image distribution strategy and image transmission are optimized, the number of target servers is reduced, and the shortest remaining processing time algorithm is used to schedule image transmission tasks.
It improves image distribution efficiency, reduces network bottlenecks, achieves rapid image distribution, and enhances user experience.
Smart Images

Figure CN118740857B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data center scheduling, and in particular to a method and system for distributing server-unaware computing images based on peer-to-peer transmission. Background Art
[0002] Server-aware computing is an emerging cloud computing model. Using this model, cloud service developers can break down server-based web applications into fine-grained cloud service functions for easier development and deployment. Developers can focus solely on business logic without worrying about server management, as the server-aware computing platform handles the function deployment, resource allocation, and server configuration required to support business logic.
[0003] When performing server-aware computing, the server needs to launch the corresponding function instance from the function image it stores. The main advantage of server-aware computing is the computing elasticity it provides, that is, the amount of resources configured for cloud service functions changes dynamically with the request rate. The amount of resources configured for a function is determined by the number of corresponding function instances in the server cluster. As cloud service requests increase, the platform dynamically and instantly adds server resources and launches more function instances. However, if the newly provisioned server does not store the corresponding function image, the function image must be transferred to the server before the function instance can be launched and resources added. How to quickly transfer function images to each server is known as the image distribution problem.
[0004] However, due to the strong fluctuations in server-aware computing load, existing image distribution technologies typically rely on centralized backend image storage. When a large number of function images need to be distributed, network congestion will occur on the function image storage side, affecting the image distribution time. In addition, when selecting which servers to add, existing image distribution technologies do not consider the function image cache status on each server, resulting in a low function image cache hit rate and an increase in the number of target servers for image distribution. In addition, because the server-aware computing platform simultaneously loads multiple applications from different users, there is competition for network resources when multiple applications require image distribution at the same time. Existing image distribution technologies use traditional network protocols, which divide the network bandwidth equally among each application. Each application only occupies a portion of the bandwidth, making it take a long time for all applications to complete image distribution.
[0005] Therefore, there is an urgent need for a method for rapid image distribution in server-unaware computing to solve the problem of long image distribution time in server-unaware computing in related technologies. Summary of the Invention
[0006] In view of the above problems, an embodiment of the present application provides a server-unaware computing image distribution method and system based on peer-to-peer transmission to overcome the above problems or at least partially solve the above problems.
[0007] In a first aspect of an embodiment of the present application, a server-unaware computing image distribution method based on peer-to-peer transmission is disclosed, which is applied to a scheduler. The method includes:
[0008] Obtaining a function call request, the function call request including: function image information and the requested number of function instances;
[0009] With the goal of minimizing the number of target servers for image distribution, a function placement plan is calculated based on the function call request, the function image cache information and resource information of each server. The number of target servers is positively correlated with the amount of point-to-point image transmission tasks.
[0010] Estimate the network usage of each target server in the function placement solution, and obtain the image distribution strategy by simulating the image distribution process with maximum parallelism;
[0011] Each point-to-point image transmission task in the image distribution strategy is assigned to a corresponding target server, and the point-to-point image transmission task is used by the target server to execute the point-to-point image transmission task according to the shortest remaining processing time algorithm to complete the image distribution.
[0012] Optionally, with the goal of minimizing the number of target servers for image distribution, a function placement plan is calculated based on the function call request, function image cache information of each server, and resource information, including:
[0013] Determining resource dimensions of each server, wherein the resource dimensions include: a single resource dimension and a multi-resource dimension;
[0014] According to the function placement algorithm corresponding to the resource dimension, the function call request, the function image cache information of each server and the resource information, the function instance is placed with the goal of minimizing the number of target servers for image distribution, and a function placement plan is obtained. The function placement algorithm includes: a greedy algorithm corresponding to a single resource dimension and a dynamic programming algorithm corresponding to multiple resource dimensions.
[0015] Optionally, when the resource dimension is a single resource dimension, according to a greedy algorithm corresponding to the single resource dimension, the function call request, the function image cache information of each server, and the resource information, function instances are placed with the goal of minimizing the number of target servers for image distribution, to obtain a function placement plan, including:
[0016] Determine a first-category server based on the function image information in the function call request and the function image cache information of each server, and place the function instance on the first-category server, where the first-category server is a server that has a function image cached.
[0017] If the number of function instances placed on the first-category servers does not meet the number of requested function instances in the function call request, arrange the second-category servers in descending order of remaining resources, and place the remaining function instances on the second-category servers in sequence until the placement is complete. The second-category servers are servers that do not cache the function image.
[0018] The first type of server and the second type of server where the function instance is placed are used as target servers to obtain a function placement plan.
[0019] Optionally, when the resource dimension is a multi-resource dimension, according to a dynamic programming algorithm corresponding to the multi-resource dimension, the function call request, the function image cache information of each server, and the resource information, function instances are placed with the goal of minimizing the number of target servers for image distribution, to obtain a function placement plan, including:
[0020] Using the dynamic programming algorithm, the minimum skewness increment of the server cluster when using different numbers of target servers is calculated to obtain multiple alternative function placement solutions. The skewness represents the amount of resources remaining after multiple resources in the server are allocated according to the average proportion of tasks.
[0021] With the goal of minimizing the number of target servers for image distribution and minimizing the skewness of the server cluster, a function placement scheme is determined from the multiple alternative function placement schemes according to the slope and the minimum skewness increment of the alternative function placement scheme.
[0022] Optionally, the dynamic programming algorithm is used to calculate the minimum skewness increment of the server cluster when using different numbers of target servers, and multiple candidate function placement solutions are obtained, including:
[0023] Perform dynamic planning state transitions in the order of increasing server numbers. Based on the skewness increment when placing different numbers of function instances on each server, calculate the skewness increment of the server cluster when some servers are used to place some function instances.
[0024] According to the skewness increment of the server cluster, the minimum skewness increment of the server cluster under different target server numbers when function instance placement is completed is calculated, and multiple alternative function placement solutions are obtained.
[0025] Optionally, estimating the network occupancy of each target server in the function placement solution and simulating the image distribution process with maximum parallelism to obtain an image distribution strategy includes:
[0026] Determine a target server that has a function image cached as a source server, and determine a target server that does not have the function image cached as a server to be transferred;
[0027] Determine a corresponding server to be transferred as a transfer target for each source server, simulate point-to-point transmission of the function image to the corresponding server to be transferred, and complete the current round of image distribution. The server to be transferred corresponding to each source server is different.
[0028] The server to be transferred that has received the function image is used as a source server to participate in subsequent rounds of image distribution until all the servers to be transferred have received the function image, thereby obtaining an image distribution strategy.
[0029] Optionally, determining a corresponding server to be transferred as a transfer target for each source server, and simulating point-to-point transfer of the function image to the corresponding server to be transferred, includes:
[0030] estimating the duration of the point-to-point mirror transmission task assigned to the source server, and adding the corresponding source server to the list of available servers when the duration of the mirror transmission task is greater than a preset point-to-point mirror transmission task duration;
[0031] The source server in the sendable server list is determined as the sending server that performs the point-to-point mirror transmission task, and the server to be transmitted that is expected to be idle in the network is selected as the receiving server, and the point-to-point transmission of the function mirror from the sending server to the receiving server is simulated.
[0032] A second aspect of the embodiments of the present application discloses a server-unaware computing image distribution method based on peer-to-peer transmission, which is applied to a target server. The method includes:
[0033] Get the point-to-point mirror transmission task assigned by the scheduler;
[0034] The point-to-point image transmission task is executed according to the shortest remaining processing time algorithm to complete the image distribution.
[0035] Optionally, the method further includes:
[0036] Receiving a function image, where the function image is transmitted by executing a point-to-point image transmission task on another target server that has the function image cached therein;
[0037] Executing the point-to-point mirror transmission task according to the shortest remaining processing time algorithm includes:
[0038] The function image is transmitted to a transmission target corresponding to the point-to-point image transmission task, where the transmission target is a target server that does not cache the function image.
[0039] A third aspect of the embodiments of the present application discloses a server-unaware computing image distribution system based on peer-to-peer transmission, the system comprising:
[0040] The scheduler is configured to obtain a function call request, the function call request including function image information and the number of requested function instances; calculate a function placement plan based on the function call request, function image cache information, and resource information of each server, with the goal of minimizing the number of target servers for image distribution, where the number of target servers is positively correlated with the amount of point-to-point image transmission tasks; estimate the network occupancy of each target server in the function placement plan, and obtain an image distribution strategy by simulating an image distribution process with maximum parallelism; and assign each point-to-point image transmission task in the image distribution strategy to a corresponding target server.
[0041] The target server is used to obtain the point-to-point image transmission task assigned by the scheduler; and execute the point-to-point image transmission task according to the shortest remaining processing time algorithm to complete the image distribution.
[0042] The embodiments of the present application include the following advantages:
[0043] In an embodiment of the present application, a function call request is obtained, wherein the function call request includes: function mirror information and the number of requested function instances; with the goal of minimizing the number of target servers for mirror distribution, a function placement plan is calculated based on the function call request, the function mirror cache information and resource information of each server; the network occupancy of each target server in the function placement plan is estimated, and a mirror distribution strategy is obtained by simulating a mirror distribution process with maximum parallelism; each point-to-point mirror transmission task in the mirror distribution strategy is assigned to a corresponding target server, and the point-to-point mirror transmission task is used by the target server to execute the point-to-point mirror transmission task according to the shortest remaining processing time algorithm to complete the mirror distribution.
[0044] This method, based on an image cache-aware approach, calculates function placement plans with the goal of minimizing the number of target servers for image distribution. This reduces the number of target servers for image distribution and improves the image cache hit rate of newly added servers. The number of target servers is positively correlated with the amount of point-to-point image transfer tasks. Therefore, by reducing the number of target servers for image distribution, the amount of point-to-point image transfer tasks is reduced, thereby shortening the image distribution time. Furthermore, by adopting a peer-to-peer transfer model between servers, image distribution is split into point-to-point image transfer tasks between servers, eliminating the network bottleneck of image storage. Furthermore, the image distribution strategy is determined by maximizing the parallelism of image distribution and considering the network occupancy of each target server, thereby improving image distribution efficiency and achieving efficient function image transfer. Furthermore, when performing image distribution, the target server schedules image distribution according to the shortest remaining processing time algorithm, prioritizing point-to-point image transfer tasks with the shortest remaining processing time, further optimizing the completion time of function image distribution.
[0045] In this way, the embodiment of the present application realizes a server-unaware computing image distribution method based on peer-to-peer transmission based on image transmission awareness and high-parallelism image distribution mode, optimizes the image distribution time through three aspects: function scheme, image distribution strategy and image transmission, eliminates the network bottleneck of image distribution, improves the image distribution efficiency, and realizes rapid image distribution of server-unaware computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0047] Figure 1 This is a structural diagram of a server-unaware computing image distribution system based on peer-to-peer transmission provided by an embodiment of the present application;
[0048] Figure 2 This is a flowchart of the steps of a server-unaware computing image distribution method based on peer-to-peer transmission provided by an embodiment of the present application;
[0049] Figure 3 This is a flowchart of the steps of another server-unaware computing image distribution method based on peer-to-peer transmission provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] To make the above-mentioned purposes, features, and advantages of this application more clearly understood, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of this application.
[0051] When configuring a server-agnostic computing function, developers typically submit a customized function image to the server-agnostic computing platform. The server must launch the corresponding function instance from the stored function image. Because function image files are typically large, they must be transferred to each server during function deployment, increasing the network load on the server-agnostic computing platform. Using the same function image, multiple function instances can be launched on a single server, limited by server resources.
[0052] The cold start time of server-agnostic computing (i.e., the response time from a function call request to the completion of server resource allocation) is a significant factor affecting the platform's user experience, and image distribution time is a major component of this cold start time. Therefore, server-agnostic computing platforms need to improve their image distribution efficiency to enhance the user experience. Achieving rapid image distribution on server-agnostic computing platforms with user-defined function images faces the following two challenges:
[0053] (1) Server-aware computing has high load fluctuations. The request rate of a single cloud service application can surge to more than 500 times the normal rate, requiring the server-aware computing platform to immediately distribute a large number of images. Existing image distribution technologies usually rely on centralized backend image storage, that is, the backend image storage is responsible for transferring all function images that need to be distributed to additional servers, which consumes the network resources of the image storage. When a large number of function images need to be distributed, network congestion will occur on the image storage side, affecting the image distribution time.
[0054] Furthermore, while the server's non-aware computing load fluctuates strongly, sudden increases in load are usually caused by only a few applications, meaning that sudden loads are localized. This provides the possibility for the image distribution system to cache function images to reduce image distribution time. When a corresponding function image is stored on a server, restarting several function instances on that server does not require image transmission. However, existing image distribution technologies generally do not consider the function image cache status on each server when selecting which servers to add, i.e., when deciding on function placement. This results in a low function image cache hit rate, an increase in the number of target servers for image distribution, and a greater increase in image distribution time.
[0055] (2) The server-aware computing platform simultaneously loads multiple applications from different users. When multiple applications require image distribution at the same time, they will compete for network resources. Existing image distribution technology uses traditional network protocols, which divides the network bandwidth equally among the applications. Each application only occupies a portion of the bandwidth, making it take a long time for all applications to complete image distribution.
[0056] Therefore, in order to solve the problem of long image distribution time in server-unaware computing in related technologies, the embodiments of the present application provide a server-unaware computing image distribution method and system based on peer-to-peer transmission based on image transmission awareness and high-parallelism image distribution mode.
[0057] In the embodiments of the present application, it is considered that in server-unaware computing, the function call response time consists of three parts: planning time, image distribution time, and communication time. Among them, image distribution takes the longest time and accounts for the main part because it requires the transmission of data files. First, considering that the image distribution time is affected by the number of servers, the more distribution targets, the longer it takes, so a suitable function placement scheme will reduce the number of image distribution targets and optimize the distribution time. Secondly, image distribution is carried out in parallel in a distributed manner among the servers. The higher the degree of parallelism, the shorter the time, and the degree of parallelism is determined by the image distribution strategy. Finally, when multiple function images are distributed at the same time, the reasonable allocation of network bandwidth will reduce the average distribution completion time, so the image transmission task should be reasonably scheduled. In summary, the image distribution time is affected by three factors: function placement scheme, image distribution strategy, and transmission scheduling. Therefore, the present application optimizes the image distribution time through these three aspects: function scheme, image distribution strategy, and image transmission, eliminates the network bottleneck of image distribution, improves image distribution efficiency, and realizes fast image distribution of server-unaware computing, thereby improving user experience.
[0058] Reference Figure 1 As shown, Figure 1 This is a structural diagram of a server-unaware computing image distribution system based on peer-to-peer transmission provided by an embodiment of the present application, the system comprising:
[0059] The scheduler is used to obtain function call requests, wherein the function call requests include: function image information and the number of requested function instances; with the goal of minimizing the number of target servers for image distribution, calculate a function placement plan based on the function call request, the function image cache information and resource information of each server, where the number of target servers is positively correlated with the amount of point-to-point image transmission tasks; estimate the network occupancy of each target server in the function placement plan, and obtain an image distribution strategy by simulating the image distribution process with maximum parallelism; and assign each point-to-point image transmission task in the image distribution strategy to the corresponding target server.
[0060] The target server is used to obtain the point-to-point image transmission task assigned by the scheduler; and execute the point-to-point image transmission task according to the shortest remaining processing time algorithm to complete the image distribution.
[0061] In an embodiment of the present application, the system is composed of a scheduler and a target server, and collaborates with containerized application software (Kubernetes, K8s) to complete the scheduling and operation of the container. The scheduler is centralized and is responsible for receiving and processing function call requests to calculate the function placement plan and plan the image distribution strategy. The target server is distributed and is responsible for executing the point-to-point image transmission tasks assigned by the scheduler. An agent component runs on the target server, and the point-to-point image transmission tasks planned by the scheduler (i.e., sending and receiving function images) are implemented through the agent component. Whenever a target server receives a function image, the scheduler will notify K8s to start the function container requested by the function call request on the corresponding target server. When the corresponding containers have all been started on the assigned target servers, the function call request is completed accordingly.
[0062] In specific implementation, when the function call request sent by the user reaches the scheduler through the gateway, the scheduler will obtain the function image information and the number of requested function instances in the function call request. Thus, the server information (i.e., function image cache information and resource information) is integrated to calculate the function placement plan and image distribution strategy. The scheduler then assigns each point-to-point image transmission task in the image distribution strategy to the corresponding target server. The target server executes the point-to-point image transmission task after receiving the point-to-point image transmission task; if the target server does not cache the required function image, the target server waits for it to receive the corresponding function image before executing the point-to-point image transmission task to send the function image out to achieve image distribution.
[0063] The following is a detailed description of a server-unaware computing image distribution method based on peer-to-peer transmission provided by an embodiment of the present application in conjunction with the accompanying drawings.
[0064] Reference Figure 2 As shown, Figure 2 This is a flowchart of a method for distributing server-aware computing images based on peer-to-peer transmission provided by an embodiment of the present application, which is applied to a scheduler. Figure 2 As shown, the method includes steps S210 to S240:
[0065] Step S210: Obtain a function call request, where the function call request includes function image information and the requested number of function instances.
[0066] In this embodiment of the present application, when a function call request sent by a user reaches the scheduler through the gateway, the scheduler will obtain the function image information and the requested number of function instances in the function call request. The function image information refers to the function image required to start the function instance, and the requested number of function instances refers to the number of function instances required to start this function call request.
[0067] In a single function call request, the number of function instances requested corresponds to the same function instance. In multiple function call requests, the requested function instances may be different. For example, in the first function call request, all requested function instances may be A, and in the second function call request, all requested function instances may be B. The function instances requested in different function call requests may be different.
[0068] Step S220: With the goal of minimizing the number of target servers for image distribution, a function placement plan is calculated based on the function call request, the function image cache information and resource information of each server. The number of target servers is positively correlated with the amount of point-to-point image transmission tasks.
[0069] In an embodiment of the present application, a function placement plan includes multiple target servers, where a target server refers to a server used to start the function instance requested in a function call request. The target servers include servers that have cached function images and servers that do not have cached function images. The greater the number of servers that do not have cached function images, the greater the amount of function image transmission tasks. Therefore, when calculating the function placement plan, the goal is to minimize the number of target servers for image distribution to reduce the amount of image distribution tasks.
[0070] When the server has a corresponding function image cached, the function instance can be started directly by the function image without transferring the function image to the server again. Therefore, the server with the function image cached can be used as the target server as much as possible; when multiple function instances are placed on the same server, only the function image needs to be transferred to the server once. The image can start multiple function instances. Since the number of function instances that can be started on each server is limited by the free resources in the server, the scheduler comprehensively considers the server's resource information and the function image cache status to calculate the function placement plan.
[0071] In this way, based on the image cache awareness method, the function placement plan is calculated with the goal of minimizing the number of target servers for image distribution, reducing the number of target servers for image distribution, thereby improving the image cache hit rate of new servers; since the number of target servers is positively correlated with the amount of point-to-point image transmission tasks, by reducing the number of target servers for image distribution, the amount of point-to-point image transmission tasks is reduced, that is, the time for image distribution is reduced.
[0072] Step S230: estimating the network occupancy of each target server in the function placement solution, and obtaining a mirror distribution strategy by simulating a mirror distribution process with maximum parallelism.
[0073] In the embodiments of the present application, after the function placement plan is determined, the target server for mirror distribution is also determined. At this point, the total amount of data transmission required for mirror distribution is fixed. To minimize the completion time of mirror distribution, the mirror distribution strategy needs to maximize the bandwidth of function mirror transmission, that is, maximize the parallelism of mirror distribution.
[0074] Therefore, a peer-to-peer transmission mode between servers is adopted to split the image distribution into point-to-point image transmission tasks between servers to maximize the parallelism of the image distribution. For a specific function image, the parallelism of the image distribution is limited by the number of target servers that store the function image. When all target servers that cache the function image participate in the image distribution, the parallelism reaches the upper limit. For example, each target server that caches the function image transmits the function image to a target server (i.e., the transmission target) that does not cache the function image, and the target servers that do not cache the function image are different from each other. At this time, the parallelism reaches the upper limit. When the image is distributed according to this upper limit, the number of servers that store the corresponding function image will double after each round of image distribution is completed. Therefore, the embodiment of the present application adopts a peer-to-peer transmission mode based on "multiplication" for image distribution.
[0075] At the same time, because server network resources are affected by previous transmission tasks, some target servers cannot participate in the image transmission immediately. Therefore, we adopt an image transmission awareness method to estimate the network usage of each target server and plan the image distribution strategy by simulating the image distribution process with maximum parallelism.
[0076] In this way, through the peer-to-peer transmission mode between servers, image distribution is split into point-to-point image transmission tasks between servers, eliminating the network bottleneck of image storage (that is, the function image storage end in centralized distribution will cause network congestion problems) and achieving efficient function image transmission.
[0077] Step S240: Allocate each point-to-point image transmission task in the image distribution strategy to the corresponding target server, and the point-to-point image transmission task is used by the target server to execute the point-to-point image transmission task according to the shortest remaining processing time algorithm to complete the image distribution.
[0078] In an embodiment of the present application, the image distribution strategy includes multiple point-to-point image transmission tasks, and a point-to-point image transmission task is a function transmission between servers. For example, point-to-point image transmission task 1 is: target server a transmits the function image to target server b. In order to avoid the situation where the target server sends multiple function images at the same time during the image distribution task, the point-to-point image transmission task is executed according to the shortest remaining processing time algorithm (SRPT) through image perception, and the point-to-point image transmission task with the shortest remaining processing time is executed first to optimize the average completion time of the function image distribution.
[0079] Based on the above implementation process, a server-unaware computing image distribution method based on peer-to-peer transmission is realized through image transmission awareness and high-parallelism image distribution mode. The image distribution time is optimized through three aspects: function scheme, image distribution strategy and image transmission, which eliminates the network bottleneck of image distribution, improves the image distribution efficiency, and realizes fast image distribution of server-unaware computing.
[0080] The present application will be described in detail below in conjunction with the above implementation steps.
[0081] In an optional embodiment, step S220 calculates a function placement plan based on the function call request, function image cache information, and resource information of each server with the goal of minimizing the number of target servers for image distribution, including steps S220-1 and S220-2:
[0082] Step S220 - 1 : Determine the resource dimension of each server, where the resource dimension includes a single resource dimension and a multi-resource dimension.
[0083] Step S220-2: According to the function placement algorithm corresponding to the resource dimension, the function call request, the function image cache information of each server and the resource information, the function instance is placed with the goal of minimizing the number of target servers for image distribution, and a function placement plan is obtained. The function placement algorithm includes: a greedy algorithm corresponding to a single resource dimension and a dynamic programming algorithm corresponding to multiple resource dimensions.
[0084] In the embodiment of the present application, a single resource dimension means that there is only one resource in the server, and a multi-resource dimension means that there are multiple resources in the server. A single server can start multiple function instances, and the number of function instances is constrained by the total amount of server resources. Since the resource dimensions in the server include a single resource dimension and a multi-resource dimension, the number of function instances started on the server is limited by a single resource dimension or multiple (such as two) resource dimensions on the target server. For example, there are two resources, a central processing unit (CPU) and memory, in the server, and each function instance occupies the CPU and memory in different proportions. It is necessary to constrain resources separately in the two dimensions, that is, the total amount of resources occupied by each function instance on the server cannot exceed the server's limit in both the CPU and memory resource dimensions.
[0085] Therefore, different function placement algorithms are selected to calculate function placement solutions based on the resource dimensions of each server. In one example, when function instance loads are biased towards using a single resource or using two resources proportionally, the resources within the server can be treated as a single resource dimension to simplify the problem.
[0086] (1) When the resource dimension is a single resource dimension, the number of function instances that can be placed on the server can be calculated by dividing the free resources of the server by the required resources of a single function instance. Since the function instances in a single function call request are consistent, that is, the required resources of a single function instance are the same, the more free resources the server has, the more function instances can be placed on the server. The more function instances are placed on a single server, the fewer servers are required to place the function instances requested in the function call request. Therefore, a greedy algorithm is proposed to calculate the function placement solution under a single resource dimension. For a single function call request, the greedy algorithm gives a solution with the least number of mirror distribution target servers; for multiple consecutive function call requests, although the greedy algorithm cannot guarantee optimality, the function placement problem of multiple function call requests can be compared to the one-dimensional bin packing problem, which is an NPC problem (i.e., Nondeterministic Polynomial-time Complete, a non-deterministic problem with polynomial complexity). Considering the high efficiency of the greedy algorithm, the greedy algorithm can still be used to calculate the optimal function placement solution under multiple function call requests.
[0087] In a specific embodiment, when the resource dimension is a single resource dimension, a function placement plan is obtained by placing function instances with the goal of minimizing the number of target servers for image distribution according to a greedy algorithm corresponding to the single resource dimension, the function call request, the function image cache information of each server, and the resource information, including steps A1 to A3:
[0088] Step A1: Determine a first-class server based on the function image information in the function call request and the function image cache information of each server, and place the function instance on the first-class server, which is a server with a cached function image.
[0089] Step A2: When the number of function instances placed on the first type of server does not meet the number of requested function instances in the function call request, the second type of servers are arranged from most to least according to the remaining resources, and the remaining function instances are placed in the second type of servers in turn until the placement is completed. The second type of servers are servers that do not cache the function image.
[0090] Step A3: The first type of server and the second type of server where the function instance is placed are taken as target servers to obtain a function placement plan.
[0091] In an embodiment of the present application, function image information refers to the function image required to start a function instance, and the function image cache information of the server refers to the function image information currently cached in the server. In order to place the function instance on the server that has cached the function image as much as possible, step A1 is first executed. Based on the function image information and the function image cache information of the server, it is determined whether the required function image is cached in the server, and the server that has cached the required function image is regarded as a first-class server, and the function instance is placed on the first-class server first.
[0092] If the number of function instances placed on the first-class servers does not meet the number of function instances requested in the function call request, step A2 is executed. To minimize the number of target servers for image distribution, the remaining second-class servers that do not have cached function images are sorted from most to least by remaining resources, with second-class servers with the most remaining resources being prioritized for function instance placement. Finally, when all function instances have been placed, step A3 is executed, where all servers with function instances placed are designated as target servers, resulting in a function placement plan.
[0093] (2) In the case of multiple resource dimensions, if we continue to adopt a greedy algorithm, that is, placing as many function instances as possible on the server, it may result in the server being depleted of one resource while another resource is still largely available (for example, the server's CPU is fully loaded while the memory is idle), which will result in a waste of resources within the server. Therefore, in the case of multiple resource dimensions, the resources within the server are not only different in quantity, but also in the ratio of various resources. Therefore, it is necessary to balance the resource configuration of the server. Therefore, in the case of multiple resource dimensions, a dynamic programming algorithm is proposed to calculate the function placement plan.
[0094] In a specific embodiment, when the resource dimension is a multi-resource dimension, a function placement plan is obtained by placing function instances with the goal of minimizing the number of target servers for image distribution based on a dynamic programming algorithm corresponding to the multi-resource dimension, the function call request, the function image cache information of each server, and the resource information, including steps B1 and B2:
[0095] Step B1: Using the dynamic programming algorithm, the minimum skewness increment of the server cluster when using different numbers of target servers is calculated to obtain multiple alternative function placement solutions. The skewness represents the amount of resources remaining after multiple resources in the server are allocated according to the average proportion of tasks.
[0096] Step B2: With the goal of minimizing the number of target servers for image distribution and minimizing the skewness of the server cluster, a function placement scheme is determined from the multiple alternative function placement schemes based on the slope and the minimum skewness increment of the alternative function placement scheme.
[0097] In this embodiment, skewness is introduced to optimize function placement. The skewness of a server is the amount of resources remaining after allocating multiple resources to tasks in an average ratio. Skewness represents the amount of resources that would be free if the server were to handle the average number of tasks. Furthermore, the sum of the skewnesses of multiple servers is recorded as the skewness of the cluster.
[0098] For example, taking the dual resource dimension as an example, the skewness of the server and the skewness of the cluster can be expressed as:
[0099]
[0100] where Skewness(server) represents the skewness of server serve, Skewness(claster) represents the skewness of cluster claster, r1 and r2 represent two resources of server server, server.r1 represents the amount of free resources of server server on resource r1, server.r2 represents the amount of free resources of server server on resource r2, avg1 represents the average overhead of all function instances on resource r1, avg2 represents the average overhead of all function instances on resource r2, max(·) represents the maximum function, and min(·) represents the minimum function.
[0101] Therefore, the dynamic programming algorithm is used to calculate the function placement solution that minimizes the skewness increment when using different target server numbers. This solution is then used as the candidate function placement solution. Ultimately, a function placement solution is determined from the multiple candidate function placement solutions while satisfying the dual goals of minimizing the number of target servers for image distribution and minimizing the skewness of the server cluster.
[0102] In an optional embodiment, the dynamic programming algorithm is used to calculate the minimum skewness increment of the server cluster when using different numbers of target servers, thereby obtaining multiple candidate function placement solutions, including step B1-1 and step B1-2:
[0103] Step B1-1: Perform dynamic planning state transfer in the order of the number of servers from small to large. Based on the skewness increment when each server places different numbers of function instances, calculate the skewness increment of the server cluster when some servers are used to place some function instances.
[0104] Step B1-2: Based on the skewness increment of the server cluster, the minimum skewness increment of the server cluster under different target server numbers when the function instance placement is completed is calculated to obtain multiple alternative function placement solutions.
[0105] The skewness increment (i.e., the change in skewness) is obtained by subtracting the skewness before and after placing the function instance on the server. Taking two resource dimensions as an example, the skewness increment ΔSkewness is expressed as:
[0106]
[0107] Among them, ΔSkewness(i,t) represents the change in skewness when t function instances are placed on the i-th server, s i .r1 and s i .r2 respectively denotes the free resources in the first two dimensions (i.e., resource r1 and resource r2) before the i-th server is placed. req.r1 and req.r2 respectively denote the overhead of a function instance on resource r1 and resource r2. avg1 denotes the average overhead of all function instances on resource r1, and avg2 denotes the average overhead of all function instances on resource r2. max(·) denotes the maximum value function, min(·) denotes the minimum value function, and t denotes the number of function instances.
[0108] According to the skewness increment when placing different numbers of function instances on each server, the number of function instances t (i.e., different numbers of function instances) placed on the current server is enumerated for state transfer, thereby obtaining the alternative function placement plan corresponding to the minimum skewness increment.
[0109] For example, in dynamic programming, let F i,j,c It represents the minimum skewness increment of the cluster when j (i.e., the number of partial servers used in step B1-1) servers are used in the first i servers to place c (i.e., the number of partial function instances placed in step B1-1) function instances. The number of function instances placed on the current server t for state transition is expressed as:
[0110] F i-1,j,c +ΔSkewness(i,t)→F i,j+1,c+t
[0111] Among them, F i-1,j,c F represents the minimum skewness increment of the cluster when j servers are used to place c function instances among the first i-1 servers; i,j+1,c+t It represents the minimum skewness increment of the cluster when j+1 servers are used to place c+t function instances among the first i servers; ΔSkewness(i,t) represents the change in skewness when t function instances are placed on the i-th server.
[0112] By using the state transition equation, the skewness increment of the server cluster when using some servers to place some function instances can be calculated in the order of the number of servers from least to most. That is to say, when performing dynamic planning: enumerate the subscript i in the state transition equation from 1 to n (n is the total number of servers in the cluster server), j from 1 to n, and c from 1 to q (q is the number of requested function instances). Each (i, j, c) triple performs a state transition, and uses the calculated value on the left to update the state value on the right. The update means that the new state value is selected as the better value between the calculated value and the original state value. Finally, the multiple servers that use the minimum skewness increment when using different target server numbers are used as the target servers in the corresponding alternative function placement plan.
[0113] In the embodiment of the present application, it is desired to minimize the number of servers and cluster skewness in a certain solution to optimize function placement. However, increasing the number of servers will result in a smaller cluster skewness, so the function placement solution is required to make a trade-off between skewness and the number of servers. Since the function of the minimum skewness increment with respect to the number of servers is convex, a parameter (slope) k is selected to balance the two goals of minimizing the number of target servers for mirror distribution and minimizing the skewness of multiple target servers, so as to determine the function placement solution from the alternative function placement solutions.
[0114] For example, the total number of servers in the cluster is n, the number of requested function instances is q, and the minimum skewness increment of the alternative function placement solution when using j target servers is expressed as F n,j,q (j=1…n), then in order to meet the goal of minimizing the number of target servers for image distribution and the goal of minimizing the skewness of the server cluster, the function placement scheme F is selected from the alternative function placement schemes according to the slope k and the minimum skewness increment of the alternative function placement scheme. n,pick,q ,The target server number pick of the function placement scheme is expressed as:
[0115] pick=argmin j (F n,j,q +j×k)
[0116] Among them, argmin j (·) represents the minimum target number of servers required to achieve both the minimum number of servers and the minimum cluster skewness.
[0117] In this embodiment of the application, skewness is used as an indicator to measure the resource allocation status of a server cluster (i.e., multiple target servers), which has good scalability. When the resource dimension of the server is increased, a similar algorithm can still be used to calculate the skewness of the server and cluster, guiding the algorithm to balance the resource allocation between servers and tasks.
[0118] By introducing skewness, we consolidate multiple dimensions of resource allocation into a single dimension, integrating resource allocation across multiple servers in a cluster into a single metric. This greatly simplifies the resource allocation problem in function placement and enables a function placement algorithm with polynomial complexity. Secondly, skewness controls the balance between the number of target servers for image distribution and resource allocation for each function call request, limiting resource waste caused by blindly pursuing fewer servers. Furthermore, skewness provides the function placement algorithm with cluster awareness, enabling it to optimize across multiple function calls to a certain extent, and comprehensively optimize the number of target servers for image distribution at a higher level. Furthermore, incorporating skewness into the optimization objectives of the computational function placement plan not only reduces resource waste and improves resource utilization, but also improves function load locality. When resource allocations vary across servers, a skewness-based function placement plan allocates function instances to servers that best suit their resource requirements. For example, CPU-intensive function instances are allocated to compute servers, while memory-intensive function instances are allocated to memory-intensive servers. As a result, function instances with different requirements are separated from each other, while function instances with the same requirements are relatively concentrated. The same function instance is more likely to be allocated to the same server, thereby increasing the locality of the function load.
[0119] In an optional embodiment, step S230 estimates the network usage of each target server in the function placement solution and obtains an image distribution strategy by simulating the image distribution process with maximum parallelism, including steps S230-1 to S230-3:
[0120] Step S230 - 1 : determining a target server that has a function image cached therein as a source server, and determining a target server that does not have the function image cached therein as a server to be transferred.
[0121] Step S230-2: Determine a corresponding server to be transferred as the transfer target for each source server, simulate the point-to-point transmission of the function image to the corresponding server to be transferred, to complete the current round of image distribution. The servers to be transferred corresponding to each source server are different.
[0122] Step S230 - 3 : The server to be transferred that has received the function image is used as a source server to participate in subsequent rounds of image distribution until all servers to be transferred have received the function image, thereby obtaining an image distribution strategy.
[0123] In an embodiment of the present application, the scheduler uses an amplified peer-to-peer transmission mode when planning the image distribution path. The scheduler estimates each point-to-point image transmission task in the amplified transmission and sends these point-to-point image transmission tasks to each target server. First, the target server with the function image cached is determined as the source server, and the target server without the function image cached is determined as the server to be transmitted. Second, the scheduler starts with all source servers and sequentially uses the server to be transmitted as the transmission target, simulating several rounds of image distribution. Finally, the server to be transmitted that receives the function image will participate in subsequent rounds of image distribution.
[0124] For example, let s be the number of servers that initially cache the function image (i.e., the number of source servers). After T rounds of image distribution, the number of target servers that store the function image is t = s × 2 T Therefore, when there are n servers that need to distribute corresponding images, the number of image distribution rounds required is log(n / s)=O(logn), which is logarithmically related to the number of image distribution target servers, indicating that the image distribution strategy has excellent scalability.
[0125] In an optional embodiment, a corresponding server to be transferred is determined for each source server as a transfer target, and point-to-point transfer of the function image to the corresponding server to be transferred is simulated, including steps C1 and C2:
[0126] Step C1: estimating the duration of the point-to-point mirror transmission task allocated to the source server, and when the mirror transmission task duration is greater than the preset point-to-point mirror transmission task duration, adding the corresponding source server to the list of available servers.
[0127] Step C2: Determine the source server in the sendable server list as the sending server that performs the point-to-point mirror transmission task, select the server to be transmitted that is expected to be idle on the network as the receiving server, and simulate the point-to-point transmission of the function mirror from the sending server to the receiving server.
[0128] In the embodiments of the present application, taking into account the multiplied peer-to-peer transmission mode, network congestion may occur due to inappropriate task allocation in multiple consecutive mirror distribution tasks. For example, a target server, as the root node, undertakes multiple rounds of transmission tasks in the first mirror distribution, and is also assigned the first and subsequent transmission tasks in the second mirror distribution, resulting in the first round of transmission of the second mirror distribution not being completed in time, and the subsequent transmissions are all delayed, forming a serious "head of line" blockage, causing a large amount of time delay. This delay is caused by the scheduler not understanding the network status of the target server when planning the mirror distribution path, and the scheduler assigns critical transmission tasks to the target server with a busy network. The multiplied mode of mirror distribution is heavily dependent on the smooth completion of the previous transmission, thus affecting the distribution efficiency of the multiplied transmission mode.
[0129] Therefore, a mirror transmission awareness strategy is adopted to solve this problem. That is, for each source server, the time to execute the next point-to-point mirror transmission task is determined based on the duration of the assigned point-to-point mirror transmission task. If the current mirror transmission task takes longer than the estimated duration of the assigned task, the network resources of the corresponding source server will become idle, so the scheduler will add the source server to the list of sendable servers and assign a point-to-point mirror transmission task. When assigning a point-to-point mirror transmission task, the transmission target is determined based on the network status of the server to be transmitted, and the transmission target selects the target server that is expected to be idle the earliest. Assigning transmission tasks according to network status solves the problem of network congestion.
[0130] Finally, for the source server that performs point-to-point mirror transmission tasks, the scheduler will estimate the start time and end time of each point-to-point mirror transmission task, thereby updating the sendable server list according to the time and assigning point-to-point mirror transmission tasks to the servers in it.
[0131] In this embodiment, the scheduler records a lower bound on the network occupancy time and, based on this lower bound, ensures that all available servers with anticipated network idleness participate in the image transmission, thereby achieving the maximum possible image transmission bandwidth at any given moment. Therefore, without introducing additional servers for forwarding transmission, this distribution strategy optimizes the completion time of each image distribution.
[0132] In an optional embodiment, the scheduler further performs the following steps:
[0133] Step S250: receiving updated function image cache information and updated resource information fed back by the target server.
[0134] Step S260: Calculate a function placement solution corresponding to the next function call request based on the updated function image cache information and the updated resource information.
[0135] In this embodiment of the present application, the scheduler assigns each point-to-point image transfer task in the image distribution strategy to the corresponding target server. After the target server executes the point-to-point image transfer task, it updates its own function image cache information and resource information and feeds the updated function image cache information and updated resource information back to the scheduler. The scheduler then calculates the function placement plan corresponding to the next function call request based on the information fed back by the target server.
[0136] Reference Figure 3 As shown, Figure 3 This is a flowchart of another method for distributing server-aware computing images based on peer-to-peer transmission provided by an embodiment of the present application, which is applied to the target server. Figure 3 As shown, the method includes steps S310 to S320:
[0137] Step S310: Obtain the point-to-point mirror transmission task assigned by the scheduler.
[0138] Step S320: executing the point-to-point image transmission task according to the shortest remaining processing time algorithm to complete the image distribution.
[0139] In the embodiment of the present application, the target server uses the Shortest Remaining Processing Time (SRPT) algorithm to schedule the server's point-to-point mirror transfer tasks to optimize the average completion time of the mirror transfer. The SRPT algorithm is an efficient task scheduling algorithm that can minimize the overall average completion time in a single-processor system.
[0140] Specifically, the point-to-point mirror transmission task is executed according to the shortest remaining processing time algorithm, including: determining the remaining processing time of all unfinished point-to-point mirror transmission tasks, wherein the remaining processing time is determined based on the function mirror size and the network bandwidth of the target server; and executing the point-to-point mirror transmission task with the shortest remaining processing time.
[0141] For example, if the target server receives a new point-to-point mirror transmission task, and the remaining processing time of the new point-to-point mirror transmission task is greater than the remaining processing time of the currently executing point-to-point mirror transmission task, the target server interrupts the currently executing point-to-point mirror transmission task and prioritizes the execution of the new point-to-point mirror transmission task.
[0142] In the embodiment of the present application, based on the shortest remaining processing time algorithm, all unfinished task characteristics will be checked at any time to determine the remaining processing time of all unfinished point-to-point mirror transmission tasks in the target server, so as to give priority to executing the task with the least remaining processing time, thereby reducing the waiting time of the point-to-point mirror transmission task, and optimizing the average completion time of the function mirror distribution as a whole. The implementation of this method relies on the accurate estimation of the remaining processing time of the task by SRPT, and in the mirror distribution scenario, the time required for the point-to-point mirror transmission task can be accurately estimated. The time required for the point-to-point mirror transmission task can be obtained by dividing the function mirror size by the server network bandwidth, and the function mirror size can be obtained by querying the function mirror registration information. Therefore, the perceptibility of the function mirror size in the mirror distribution scenario allows the target server to predict the time required for the point-to-point mirror transmission task before executing the mirror distribution, and then arrange the transmission tasks, realize the point-to-point mirror transmission task based on the SRPT scheduling server, and optimize the average transmission completion time.
[0143] In some implementations, since function image size is proportional to transfer time, tasks can be directly sorted by remaining function image size without calculating transfer time. This allows for preemptive image transfer scheduling. By recording the function image size corresponding to each point-to-point image transfer task and maintaining the transfer progress of each task, when the task list is updated, the task with the smallest remaining file size is selected for transfer, thereby optimizing the average transfer completion time.
[0144] In an optional embodiment, the target server further performs the following steps:
[0145] Step S330: receiving a function image, where the function image is transmitted by executing a point-to-point image transmission task on another target server that has cached the function image.
[0146] Step S340: transmitting the function image to a transmission target corresponding to the point-to-point image transmission task, where the transmission target is a target server that does not cache the function image.
[0147] In an embodiment of the present application, after the target server receives a point-to-point image transmission task, if the target server does not cache the required function image, the target server waits to receive the corresponding function image; after receiving the function image, the point-to-point image transmission task is executed to send the function image out to realize image distribution.
[0148] In an optional embodiment, the target server further performs the following steps:
[0149] Step S350: After receiving the function image, update the function image cache information and resource information according to the unused algorithm.
[0150] Step S360: Feedback the updated function image cache information and the updated resource information to the scheduler, so that the scheduler calculates the function placement plan corresponding to the next function call request based on the updated function image cache information and the updated resource information.
[0151] In this embodiment of the present application, the target server monitors its own resource status and, after receiving the mirrored function image, updates the image cache and resource information according to a least recently used algorithm. This updated information is then sent to the scheduler, enabling the scheduler to calculate a function placement plan based on the latest server information to determine the accuracy of the function placement plan. Furthermore, after receiving the function image, the target server also reports to the scheduler that the image has been successfully received.
[0152] In the embodiment of the present application, based on the mirror cache awareness method, the function placement plan is calculated with the goal of minimizing the number of target servers for mirror distribution, reducing the number of target servers for mirror distribution and improving the mirror cache hit rate of the newly added servers; the number of target servers is positively correlated with the amount of point-to-point mirror transmission tasks, so by reducing the number of target servers for mirror distribution, the amount of point-to-point mirror transmission tasks is reduced, that is, the time for mirror distribution is reduced. In addition, the mode of peer-to-peer transmission between servers is adopted to split the mirror distribution into point-to-point mirror transmission tasks between servers, eliminating the network bottleneck of mirror storage; and the mirror distribution strategy is determined by maximizing the parallelism of mirror distribution and considering the network occupancy of each target server, thereby improving the efficiency of mirror distribution and realizing efficient function mirror transmission. In addition, when the target server performs mirror distribution, it schedules the mirror distribution according to the shortest remaining processing time algorithm, and gives priority to executing the point-to-point mirror transmission task with the shortest remaining processing time, further optimizing the completion time of function mirror distribution.
[0153] In this way, the embodiment of the present application realizes a server-unaware computing image distribution method based on peer-to-peer transmission based on image transmission awareness and high-parallelism image distribution mode, optimizes the image distribution time through three aspects: function scheme, image distribution strategy and image transmission, and designs or adopts dynamic programming, shortest remaining time priority and other algorithms to further complete the overall optimization of the average completion time of image distribution, eliminate the network bottleneck of image distribution, improve the efficiency of image distribution, and realize rapid image distribution of server-unaware computing.
[0154] Furthermore, to verify the effectiveness of the server-unaware computing image distribution method based on peer-to-peer transmission, this solution implemented a prototype system and tested it using a variety of synthetic loads. Specifically, the test covered multiple aspects of the prototype system's image distribution performance, scalability, stability, and other aspects. In the performance test, the prototype system achieved an average 8.2-fold improvement in image distribution efficiency compared to existing image distribution technologies. In the scalability test, the prototype system's average image distribution completion time increased logarithmically with the problem size, demonstrating good scalability. In the stability test, the prototype system successfully handled a large number of sudden function call requests, with minimal performance fluctuations, rapid recovery to normal, and strong system stability.
[0155] In summary, the technical solution provided by the embodiment of the present application has the following advantages: in terms of optimizing image distribution efficiency, the image distribution efficiency of the server-unaware computing platform is optimized in multiple aspects; in terms of strong system scalability, the image distribution time of this method increases logarithmically with the scale of the problem; in terms of fast, stable and anti-fluctuation, this method can cope with sudden increases in request loads and quickly recover to a stable state; in terms of ease of deployment and use, this method does not require upper-level application code modification, and does not require special platform hardware or underlying support.
[0156] 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.
[0157] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods and systems according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, 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 generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0158] 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, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0159] 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 a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0160] Although 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 become aware of the basic inventive concepts. 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 embodiments of the present invention.
[0161] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0162] The above is a detailed introduction to the server-unaware computing image distribution method and system based on peer-to-peer transmission provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method of this application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.
Claims
1. A server-unaware computing image distribution method based on peer-to-peer transmission, characterized in that: Applied to a scheduler, the method includes: Obtaining a function call request, the function call request including: function image information and the requested number of function instances; With the goal of minimizing the number of target servers for image distribution, a function placement plan is calculated based on the function call request, the function image cache information and resource information of each server. The number of target servers is positively correlated with the amount of point-to-point image transmission tasks. Estimate the network usage of each target server in the function placement solution, and obtain the image distribution strategy by simulating the image distribution process with maximum parallelism; Allocating each point-to-point image transmission task in the image distribution strategy to a corresponding target server, wherein the point-to-point image transmission task is used by the target server to execute the point-to-point image transmission task according to the shortest remaining processing time algorithm to complete the image distribution; The goal is to minimize the number of target servers for image distribution, and to calculate a function placement plan based on the function call request, the function image cache information of each server, and resource information, including: Determining resource dimensions of each server, wherein the resource dimensions include: a single resource dimension and a multi-resource dimension; According to the function placement algorithm corresponding to the resource dimension, the function call request, the function image cache information of each server and the resource information, the function instance is placed with the goal of minimizing the number of target servers for image distribution, and a function placement plan is obtained. The function placement algorithm includes: a greedy algorithm corresponding to a single resource dimension and a dynamic programming algorithm corresponding to multiple resource dimensions.
2. A server-unaware computing image distribution method based on peer-to-peer transmission according to claim 1, characterized in that: In the case where the resource dimension is a single resource dimension, according to a greedy algorithm corresponding to the single resource dimension, the function call request, the function image cache information of each server, and the resource information, function instances are placed with the goal of minimizing the number of target servers for image distribution, thereby obtaining a function placement plan, including: Determine a first-category server based on the function image information in the function call request and the function image cache information of each server, and place the function instance on the first-category server, where the first-category server is a server that has a function image cached. If the number of function instances placed on the first-category servers does not meet the number of requested function instances in the function call request, arrange the second-category servers in descending order of remaining resources, and place the remaining function instances on the second-category servers in sequence until the placement is complete. The second-category servers are servers that do not cache the function image. The first type of server and the second type of server where the function instance is placed are used as target servers to obtain a function placement plan.
3. The server-unaware computing image distribution method based on peer-to-peer transmission according to claim 1 is characterized in that: In the case where the resource dimension is a multi-resource dimension, the function instance is placed with the goal of minimizing the number of target servers for image distribution according to a dynamic programming algorithm corresponding to the multi-resource dimension, the function call request, the function image cache information of each server, and the resource information, to obtain a function placement plan, including: Using the dynamic programming algorithm, the minimum skewness increment of the server cluster when using different numbers of target servers is calculated to obtain multiple alternative function placement solutions. The skewness represents the amount of resources remaining after multiple resources in the server are allocated according to the average proportion of tasks. With the goal of minimizing the number of target servers for image distribution and minimizing the skewness of the server cluster, a function placement scheme is determined from the multiple alternative function placement schemes according to the slope and the minimum skewness increment of the alternative function placement scheme.
4. A server-unaware computing image distribution method based on peer-to-peer transmission according to claim 3, characterized in that: The dynamic programming algorithm is used to calculate the minimum skewness increment of the server cluster when using different numbers of target servers, and multiple alternative function placement solutions are obtained, including: Dynamically plan state transitions in order of increasing server numbers. Based on the skewness increment when placing different numbers of function instances on each server, calculate the skewness increment of the server cluster when some servers are used to place some function instances. According to the skewness increment of the server cluster, the minimum skewness increment of the server cluster under different target server numbers when function instance placement is completed is calculated, and multiple alternative function placement solutions are obtained.
5. The server-unaware computing image distribution method based on peer-to-peer transmission according to claim 1 is characterized in that: Estimate the network usage of each target server in the function placement solution, and obtain the image distribution strategy by simulating the image distribution process with maximum parallelism, including: Determine a target server that has a function image cached as a source server, and determine a target server that does not have the function image cached as a server to be transferred; Determine a corresponding server to be transferred as a transfer target for each source server, simulate point-to-point transmission of the function image to the corresponding server to be transferred, and complete the current round of image distribution. The server to be transferred corresponding to each source server is different. The server to be transferred that has received the function image is used as a source server to participate in subsequent rounds of image distribution until all the servers to be transferred have received the function image, thereby obtaining an image distribution strategy.
6. A server-unaware computing image distribution method based on peer-to-peer transmission according to claim 5, characterized in that: Determining a corresponding server to be transmitted as a transmission target for each source server, and simulating point-to-point transmission of the function image to the corresponding server to be transmitted, including: estimating the duration of the point-to-point mirror transmission task assigned to the source server, and adding the corresponding source server to the list of available servers when the duration of the mirror transmission task is greater than a preset point-to-point mirror transmission task duration; The source server in the sendable server list is determined as the sending server that performs the point-to-point mirror transmission task, and the server to be transmitted that is expected to be idle in the network is selected as the receiving server, and the point-to-point transmission of the function mirror from the sending server to the receiving server is simulated.
7. A server-unaware computing image distribution method based on peer-to-peer transmission, characterized in that: Applied to a target server, the method includes: Obtaining a point-to-point mirror transmission task assigned by a scheduler according to the method according to any one of claims 1 to 6; The point-to-point image transmission task is executed according to the shortest remaining processing time algorithm to complete the image distribution.
8. The server-unaware computing image distribution method based on peer-to-peer transmission according to claim 7 is characterized in that: The method further comprises: Receiving a function image, where the function image is transmitted by another target server that has the function image cached therein, performing a point-to-point image transmission task; Executing the point-to-point mirror transmission task according to the shortest remaining processing time algorithm includes: The function image is transmitted to a transmission target corresponding to the point-to-point image transmission task, where the transmission target is a target server that does not cache the function image.
9. A server-unaware computing image distribution system based on peer-to-peer transmission, characterized in that: The system comprises: The scheduler is configured to obtain a function call request, the function call request including function image information and the number of requested function instances; calculate a function placement plan based on the function call request, function image cache information, and resource information of each server, with the goal of minimizing the number of target servers for image distribution, where the number of target servers is positively correlated with the amount of point-to-point image transmission tasks; estimate the network occupancy of each target server in the function placement plan, and obtain an image distribution strategy by simulating an image distribution process with maximum parallelism; and assign each point-to-point image transmission task in the image distribution strategy to a corresponding target server. The method aims to minimize the number of target servers for image distribution and calculates a function placement plan based on the function call request, the function image cache information of each server, and the resource information. The method includes: determining the resource dimension of each server, where the resource dimension includes a single resource dimension and a multi-resource dimension; placing function instances based on the function placement algorithm corresponding to the resource dimension, the function call request, the function image cache information of each server, and the resource information, with the goal of minimizing the number of target servers for image distribution, thereby obtaining a function placement plan. The function placement algorithm includes a greedy algorithm corresponding to the single resource dimension and a dynamic programming algorithm corresponding to the multi-resource dimension. The target server is used to obtain the point-to-point image transmission task assigned by the scheduler; and execute the point-to-point image transmission task according to the shortest remaining processing time algorithm to complete the image distribution.
Citation Information
Patent Citations
Edge node task scheduling method and device, computer equipment and storage medium
CN114528092A
Redundant array of disk writing method and system oriented to server non-perceptual computing
CN116149575A