An Edge Computing-Based Container Placement Optimization Method, System, and Terminal
By optimizing container placement in an edge computing environment, the high cost caused by request scheduling in the prior art and the inability to adapt to the dynamic environment are solved, and lower overall cost and higher adaptability are achieved.
Patent Information
- Application Number
- CN202410984009.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2044-07-22
AI Technical Summary
The prior art ignores system costs when containers are placed, resulting in excessive scheduling of requests to specific edge clusters, causing wake-up delays and high energy consumption, while being unable to adapt to dynamic edge environments.
By obtaining user service requests, performing edge cluster scheduling and cost analysis, decomposing cost information into multiple convex problems, solving and iterating up and down, optimizing container placement schemes to reduce overall costs.
It effectively reduces the overall cost of the system, reduces wake-up delay and energy consumption, and adapts to changes in dynamic edge environments.
Smart Images

Figure CN119088501B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data optimization, and particularly to a container placement optimization method, system, terminal and storage medium based on edge computing. Background Art
[0002] With the rapid growth of Internet applications, the core network is facing increasing pressure. Edge computing solves this problem by utilizing various clusters deployed at the edge of the core network. In the edge computing scenario, containers have become a powerful tool for service development across various computing environments. Containers are characterized by being lightweight, independent, executable, and having a layered structure image that contains all the basic components for hosting services. To run a container on an edge cluster, it is necessary to locally store the indispensable layers of the container image; or if these layers are not stored locally, they must be downloaded from a cloud-based remote container image registry; and container placement is an important research topic in containerized edge clusters, and container placement based on image granularity has been widely explored. Therefore, container placement based on layer granularity has been widely studied.
[0003] Currently, existing technologies only focus on layer-based container placement, but ignore the additional system costs that will occur in reality. Driven by layer sharing, containers sharing common layers will be placed on a specific edge cluster, resulting in too many requests corresponding to these containers being scheduled to this specific edge cluster. And the excessive incoming requests require the cluster to wake up the server to provide more resources to carry the requests, resulting in a large wake-up delay; it may also lead to scheduling requests to remote edge clusters or edge clusters with low energy efficiency ratio, thus bringing higher communication delays or high energy consumption; and relying on the container placement strategy of offline layers assumes a prior understanding of future request patterns, thus being unable to adapt to the dynamic and unpredictable characteristics of the online edge environment.
[0004] Therefore, the existing technologies still need to be improved and developed. Summary of the Invention
[0005] The main purpose of the present invention is to provide a container placement optimization method, system and terminal based on edge computing, aiming to solve the problems in the existing technologies that too many requests corresponding to containers are scheduled to a specific edge cluster, resulting in a large wake-up delay, and it may also lead to scheduling requests to remote edge clusters or edge clusters with low energy efficiency ratio, thus bringing higher communication delays or high energy consumption; and relying on the container placement strategy of offline layers, being unable to adapt to the dynamic characteristics of the online edge environment.
[0006] To achieve the above purpose, the present invention provides a container placement optimization method based on edge computing, and the container placement optimization method based on edge computing includes the following steps:
[0007] Obtain the service request of the user, perform edge cluster scheduling according to the service request to obtain a target edge cluster, and perform cost analysis on the service request according to the target edge cluster to obtain a cost analysis result;
[0008] Obtain the cost information of the cost analysis result, perform decomposition processing on the cost information to obtain a plurality of convex problems, and perform solution processing on all the convex problems to obtain a plurality of fractional solutions;
[0009] Perform up and down iteration processing on all the fractional solutions to obtain a target solution, optimize the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and process the service request according to the target container placement plan.
[0010] Optionally, in the container placement optimization method based on edge computing, wherein, the obtaining the service request of the user, performing edge cluster scheduling according to the service request to obtain a target edge cluster, and performing cost analysis on the service request according to the target edge cluster to obtain a cost analysis result specifically includes:
[0011] Obtain the service request of the user, perform edge cluster scheduling according to the type of the service request to obtain a target edge cluster, and determine the container image of the target edge cluster;
[0012] Obtain the container image layer information of the target edge cluster, and determine whether the container image layer information meets the mirror requirements according to the required mirror layers of the container image;
[0013] If the container image layer information includes the required mirror layers of the container image, it is determined that the container image layer information meets the mirror requirements, and cost analysis is performed on the service request according to the quantity of the service request and the scheduling request number of the target edge cluster to obtain a cost analysis result.
[0014] Optionally, in the container placement optimization method based on edge computing, wherein, after determining whether the container image layer information meets the mirror requirements according to the required mirror layers of the container image, it further includes:
[0015] If the container image layer information does not include the required mirror layers of the container image, it is determined that the container image layer information does not meet the mirror requirements, and a container image layer acquisition instruction is generated;
[0016] Send the container image layer acquisition instruction to the container image registry, and receive the target container image layer sent by the container image registry, wherein the target container image layer is obtained by the container image registry through download processing according to the container image layer acquisition instruction.
[0017] Optionally, in the container placement optimization method based on edge computing, obtaining the cost information of the cost analysis result, decomposing the cost information to obtain a plurality of convex problems, and solving all the convex problems to obtain a plurality of fractional solutions specifically includes:
[0018] Obtain the cost information of the cost analysis result, and perform replacement processing on the cost information according to the relative entropy function to obtain a regularization problem, where the cost information includes storage cost, request scheduling cost, server energy consumption cost, container placement cost, and server wake-up cost;
[0019] Decompose the regularization problem to obtain a plurality of convex problems, and solve all the convex problems according to the convex optimization algorithm to obtain a plurality of fractional solutions.
[0020] Optionally, in the container placement optimization method based on edge computing, the expression of the convex problem is:
[0021]
[0022]
[0023] Where is a convex problem, n ′ is the target edge cluster, n is the edge cluster, is the edge cluster group, i is the service request of the user, is the container image, is the communication cost that the service request arriving at the edge cluster is scheduled to the target edge cluster, is the number of service requests arriving at the edge cluster and scheduled to the target edge cluster during time slot t, l is the image layer, is the set of image layers, is the size of the image layer, is the situation of the edge cluster storing the image layer during time slot t, c n is the energy consumption of the server in the edge cluster, z n (t) is the number of active servers on the edge cluster during time slot t, is the delay of downloading the image layer to the edge cluster, η x and η z are both constants, ε and ε ′ are both positive constants, is the situation of the edge cluster storing the image layer during time slot t - 1, d n is the server wake-up delay of the edge cluster, z n (t - 1) is the number of active servers on the edge cluster during time slot t - 1.
[0024] Optionally, in the container placement optimization method based on edge computing, the step of performing up and down iteration processing on all the fractional solutions to obtain a target solution, optimizing the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and processing the service request according to the target container placement plan specifically includes:
[0025] Construct a bipartite graph, obtain the boundary values of the floating-point numbers in the bipartite graph, divide the bipartite graph according to the boundary values of the floating-point numbers to obtain corresponding subgraphs, and perform search processing on the loops of the subgraphs through depth-first search to obtain target loops;
[0026] Perform splitting processing on the target loops to obtain a preset number of matching data, set the rounding probabilities of any two fractional solutions among all the fractional solutions according to the matching data, and perform rounding processing on all the fractional solutions according to the rounding probabilities to obtain a rounding result, where the rounding methods of the fractions include rounding up and rounding down;
[0027] Obtain a target solution according to all the integer solutions of the rounding result, optimize the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and process the service request according to the target container placement plan.
[0028] Optionally, in the container placement optimization method based on edge computing, after performing rounding processing on all the fractional solutions according to the rounding probabilities to obtain a rounding result, it further includes:
[0029] When there is one remaining fractional solution that has not been rounded, perform rounding processing on the fractional solution according to the rounding up to obtain the corresponding integer solution.
[0030] Optionally, in the container placement optimization method based on edge computing, the container placement optimization system based on edge computing includes:
[0031] A cost analysis module, configured to obtain a service request of a user, perform edge cluster scheduling according to the service request to obtain a target edge cluster, and perform cost analysis on the service request according to the target edge cluster to obtain a cost analysis result;
[0032] A cost information solving module, configured to obtain cost information of the cost analysis result, perform decomposition processing on the cost information to obtain a plurality of convex problems, and perform solving processing on all the convex problems to obtain a plurality of fractional solutions;
[0033] A container placement optimization module is used to perform up and down iteration processing on all the fractional solutions to obtain a target solution, optimize the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and process the service request according to the target container placement plan.
[0034] In addition, to achieve the above object, the present invention further provides a terminal, wherein the terminal includes: a memory, a processor, and an edge computing-based container placement optimization program stored on the memory and executable on the processor. When the edge computing-based container placement optimization program is executed by the processor, the steps of the above-mentioned edge computing-based container placement optimization method are implemented.
[0035] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores an edge computing-based container placement optimization program. When the edge computing-based container placement optimization program is executed by a processor, the steps of the above-mentioned edge computing-based container placement optimization method are implemented.
[0036] In the present invention, a service request of a user is obtained, edge cluster scheduling is performed according to the service request to obtain a target edge cluster, and cost analysis is performed on the service request according to the target edge cluster to obtain a cost analysis result; cost information of the cost analysis result is obtained, the cost information is decomposed to obtain a plurality of convex problems, and all the convex problems are solved to obtain a plurality of fractional solutions; up and down iteration processing is performed on all the fractional solutions to obtain a target solution, the container placement plan of the target edge cluster is optimized according to the target solution to obtain a target container placement plan, and the service request is processed according to the target container placement plan. The present invention performs scheduling from the granularity of layers, considers the comprehensive influence of multiple factors such as request scheduling, storage, container placement, server energy consumption, and server wake-up cost, solves the problem of excessive cost caused by a single-factor consideration angle, thereby reducing the overall cost of the system; also decomposes the time-related container placement and server wake-up cost based on a regularization method, and a feasible solution that meets various system constraint conditions can be output through a step-by-step rounding process, avoiding repeated rounding attempts and a large amount of computational overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flowchart of a preferred embodiment of the edge computing-based container placement optimization method in the present invention;
[0038] Figure 2 is a schematic diagram of a mathematical model of layer-aware joint resource provision, request scheduling, and container placement in a preferred embodiment of the present invention;
[0039] Figure 3It is a schematic flow diagram of the ORR algorithm in a preferred embodiment of the present invention;
[0040] Figure 4 It is a schematic flow diagram of the WPR algorithm in a preferred embodiment of the present invention;
[0041] Figure 5 It is a schematic flow diagram of the PR algorithm in a preferred embodiment of the present invention;
[0042] Figure 6 It is a schematic diagram of the overall cost of each algorithm in different time sequences in a preferred embodiment of the present invention;
[0043] Figure 7 It is a schematic diagram of the quality of service of each algorithm in different time sequences in a preferred embodiment of the present invention;
[0044] Figure 8 It is a schematic diagram of the system consumption of each algorithm in different time sequences in a preferred embodiment of the present invention;
[0045] Figure 9 It is a schematic diagram of the quality of service of each algorithm under different processing capabilities in a preferred embodiment of the present invention;
[0046] Figure 10 It is a schematic diagram of the overall cost of each algorithm under different processing capabilities in a preferred embodiment of the present invention;
[0047] Figure 11 It is a schematic diagram of the overall cost of each algorithm under different bandwidths in a preferred embodiment of the present invention;
[0048] Figure 12 It is a schematic diagram of the principle of a preferred embodiment of an online container scheduling system based on edge computing in the present invention;
[0049] Figure 13 It is a schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. Detailed implementation manners
[0050] To make the objectives, technical solutions and advantages of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0051] It should be noted that if there are directional indications (such as up, down, left, right, front, back...) involved in the embodiments of the present invention, the directional indications are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the drawings). If the specific posture changes, the directional indications will also change accordingly.
[0052] In addition, if there are descriptions such as "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and should not be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first", "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions between various embodiments may be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0053] The method for optimizing container placement based on edge computing according to a preferred embodiment of the present invention, as Figure 1 shown, the method for optimizing container placement based on edge computing includes the following steps:
[0054] Step S10: Obtain a service request from a user, perform edge cluster scheduling according to the service request to obtain a target edge cluster, and perform cost analysis on the service request according to the target edge cluster to obtain a cost analysis result.
[0055] The step S10 includes:
[0056] Step S11: Obtain a service request from a user, perform edge cluster scheduling according to the type of the service request to obtain a target edge cluster, and determine the container image of the target edge cluster;
[0057] Step S12: Obtain the container image layer information of the target edge cluster, and determine whether the container image layer information meets the mirror requirements according to the required mirror layers of the container image;
[0058] Step S13: If the container image layer information includes the required mirror layers of the container image, determine that the container image layer information meets the mirror requirements, and perform cost analysis on the service request according to the quantity of the service request and the scheduling request number of the target edge cluster to obtain a cost analysis result.
[0059] Specifically, existing container placement based on layer granularity only focuses on layer-based container placement, but ignores the additional system costs that will occur in reality. Driven by layer sharing, containers sharing a common layer will be placed on a specific edge cluster, resulting in an excessive number of requests corresponding to these containers being scheduled to this specific edge cluster. And the excessive incoming requests require the cluster to wake up the server to provide more resources to carry the requests, resulting in a large wake-up delay; it may also cause requests to be scheduled to a remote edge cluster or an edge cluster with low energy efficiency ratio, thus bringing higher communication delay or high energy consumption; and relying on the container placement strategy based on the offline layer assumes a prior understanding of future request patterns, and thus cannot adapt to the dynamic characteristics of the online edge environment. To solve the above-mentioned problems, the present invention considers the comprehensive influence of various factors such as request scheduling, storage, container placement, server energy consumption, and server wake-up cost. As Figure 2 shown, in the embodiment of the present invention, a mathematical model for layer-aware joint resource provision, request scheduling, and container placement is established, aiming to minimize multiple costs; and the edge computing network, that is, the edge cluster group consists of a group of geographically dispersed edge clusters. For example, edge cluster 1, edge cluster 2, and edge cluster 3, etc., are represented by N = {1, 2, …, |N|} to represent the edge cluster group; each edge cluster in which is composed of two main parts, one part is a memory responsible for storing data, and the other part is a server responsible for processing service requests; use to represent the time slot set. Each edge cluster in the edge cluster group can communicate with each other and work collaboratively. The central controller makes control decisions within each time slot; after receiving the corresponding control decision, the edge cluster executes corresponding operations according to the control decision and transmits the cluster status back to the central controller so that the central controller can make a decision in the next time slot.
[0060] A set of container images is stored in the container image registry on the cloud, represented by Each container image consists of multiple layers (i.e., image layers), represented by to represent the set of image layers. Use to represent whether the container image contains an image layer. Among them, means that the container image contains an image layer, means that the container image does not contain an image layer. And to deploy a container on the corresponding edge cluster, the edge cluster must store all the image layers required for the corresponding container image. If there is a missing situation, the missing image layer must be downloaded from the container image registry; then, a cost analysis of the service request is performed according to the number of the service requests and the scheduling request number of the target edge cluster to obtain a cost analysis result. Specifically, use represents the number of service requests arriving at the edge cluster during time slot t. The service requests of users can be scheduled to any edge cluster running the corresponding service. represents the number of service requests that arrive at edge cluster n during time slot t and are scheduled to the target edge cluster n ′ ; and is denoted by represents the situation of the edge cluster storing the image layer during time slot t, where represents that the edge cluster stores the image layer during time slot t, represents that the edge cluster does not store the image layer during time slot t; therefore, the corresponding constraint can be expressed as This inequality indicates that the edge cluster has all the image layers required to deploy the container image, and the number of service requests of users scheduled to the target edge cluster cannot exceed the number of service requests of users sent to the original edge cluster. Moreover, the storage space of the edge cluster is used to store all the image layers, and the servers in the edge cluster can access these image layers through the internal high-speed local area network. Let z n (t) ∈ N + represents the number of servers activated on the edge cluster during time slot t.
[0061] Step S20: Obtain the cost information of the cost analysis result, decompose the cost information to obtain multiple convex problems, and solve all the convex problems to obtain multiple fractional solutions.
[0062] The step S20 includes:
[0063] Step S21: Obtain the cost information of the cost analysis result, and perform replacement processing on the cost information according to the relative entropy function to obtain a regularization problem, where the cost information includes storage cost, request scheduling cost, server energy consumption cost, container placement cost, and server wake-up cost;
[0064] Step S22: Decompose the regularization problem to obtain multiple convex problems, and solve all the convex problems according to the convex optimization algorithm to obtain multiple fractional solutions.
[0065] Specifically, in the embodiment of the present invention, the cost information of the cost analysis result is obtained. The cost information includes storage cost, request scheduling cost, server energy consumption cost, container placement cost, and server wake-up cost, where the expression of the storage cost is: l is the image layer, is the size of the image layer; the expression of the request scheduling cost is: i is the service request of the user, The communication cost for service requests of users arriving at the edge cluster is scheduled to the target edge cluster; the expression for the server energy consumption cost is: ∑ t∈T ∑ n∈N c n z n (t), where c n is the energy consumption of the server in the edge cluster; the expression for the container placement cost is: is the delay for the mirror layer to be downloaded to the edge cluster; the expression for the server wake-up cost is: ∑ t∈T ∑ n∈N d n [z n (t) - z n (t - 1)] + , where d n is the server wake-up delay of the edge cluster; with these costs and constraints, a problem P of joint layer-aware joint resource provisioning, request scheduling, and container placement is obtained, and the corresponding expression is:
[0066]
[0067] where, is the situation of the edge cluster storing the mirror layer during time slot t - 1, and z n (t - 1) is the number of servers activated on the edge cluster during time slot t - 1, and the corresponding constraint means that the edge cluster providing the service must have the required layers, and the number of requests scheduled to the target edge cluster cannot exceed the number of initiations. And to ensure stable service delivery, it is necessary to dispatch the service requests of each user to the corresponding edge cluster. Therefore, there is a constraint Note that z n (t) cannot exceed the maximum number of servers on the edge cluster, and the target edge cluster must ensure that there are sufficient computing resources to process the service requests of the received users. Therefore, there is a constraint Q n′ is the computing resource of the target edge cluster, and z n′ (t) is the number of servers activated on the target edge cluster during time slot t.
[0068] To solve problem P, an online algorithm is proposed in an embodiment of the present invention. Specifically, first, a relaxation problem is obtained by relaxing integer variables. When solving the relaxation problem, the remaining difficult problem is to convert the container placement and server wake-up costs between two consecutive time slots. The relative entropy function is a convex function and has been widely used to approximate the L1-distance term. Therefore, the relative entropy function is used to replace the container placement and server wake-up costs in the relaxation problem, thereby obtaining a regularized problem, denoted as P2. The regularized problem is expressed as the sum of sub-problems (i.e., convex problems, denoted as ), that is The expression of the convex problem is:
[0069]
[0070] where η x and η z are both constants, and ε and ε ′ are both positive constants. To prevent the occurrence of outliers, small positive constants ε and ε ′ are added to both the denominator and numerator of the fraction in the relative entropy function. The constants η x and η z are used to normalize the regularized container placement cost and server wake-up cost.
[0071] Since the objective function is a convex function and all constraint conditions are linear, the sub-problem is a convex problem for each time slot. In addition, the sub-problem only requires the current information and the previous decisions in the time slot. Therefore, the sub-problem can be efficiently solved within polynomial time complexity using a standard convex optimization algorithm (e.g., the interior point method). That is, the fractional solution can be obtained by separately processing the problem for each time slot using the subroutine ORR (Online Regularization and Rounding, a method based on online regularization). The ORR algorithm flow is as Figure 3 shown. Figure 3 In it, line 4 refers to calling the subroutine ORR to obtain the fractional solution, and lines 5 to 9 refer to calling the subroutines WPR (Weighted Pairwise Rounding) and PR (Pairwise Rounding) to obtain the integer solution. Specifically, first, WPR is called in line 5 to obtain a partial integer solution, then this partial integer solution is fixed, and PR is continued to be called in line 7 to obtain the integer solution. Then this partial integer solution is fixed again, and WPR is called in line 9 to obtain the final fractional solution.
[0072] Step S30: Perform up and down iteration processing on all the fractional solutions to obtain a target solution. Optimize the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and process the service request according to the target container placement plan.
[0073] The step S30 includes:
[0074] Step S31: Construct a bipartite graph, obtain the boundary values of the floating-point numbers in the bipartite graph, divide the bipartite graph according to the boundary values of the floating-point numbers to obtain corresponding subgraphs, and search for the loops of the subgraphs through depth-first search to obtain target loops;
[0075] Step S32: Perform splitting processing on the target loops to obtain a preset number of matching data. Set the rounding probabilities of any two fractional solutions among all the fractional solutions according to the matching data, and perform rounding processing on all the fractional solutions according to the rounding probabilities to obtain a rounding result, where the rounding methods of the fractions include rounding up and rounding down;
[0076] Step S33: Obtain a target solution according to all the integer solutions of the rounding result, optimize the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and process the service request according to the target container placement plan.
[0077] Specifically, considering the integer constraints inherent in the service request, it must be noted that the fractional solutions do not meet the conditions of these overall constraints. Therefore, it is necessary to round the fractional solutions into feasible integral solutions; first, call WPR to perform rounding on some fractional solutions. The main purpose of rounding is to select two fractional solutions and round them in a complementary manner. The entire process is as Figure 4 shown, Figure 4 In it, lines 5 to 7 refer to obtaining the values of some fractional solutions. Line 9 refers to randomly selecting two fractional solutions. Lines 12 to 13 refer to setting the probabilities of rounding up and rounding down for the selected fractional solutions and updating the values of this part of the fractional solutions. Lines 14 to 17 refer to performing rounding up and down on all the fractional solutions until the entire loop iteration ends when there is only one fractional solution or no fractional solutions. Lines 18 to 19 refer to if there is one remaining fractional solution, directly rounding up this fractional solution.
[0078] The subroutine PR process is as Figure 5 shown, Figure 5In the figure, the second line refers to constructing a bipartite graph, the fifth line refers to obtaining the subgraph of the bipartite graph from the floating-point edges in the bipartite graph, the sixth line refers to searching for the cycle or maximum path of the subgraph through depth-first search, and dividing the cycle or maximum path into two matching data, the ninth and tenth lines refer to randomly taking two floating-point numbers from the two matching data respectively, the eleventh and twelfth lines refer to setting the probability of floating-point numbers being obtained upward and downward, and the entire loop iterates until all floating-point numbers are rounded.
[0079] Afterwards, a target solution is obtained according to all integer solutions of the rounding result, the container placement scheme of the target edge cluster is optimized according to the target solution to obtain a target container placement scheme, and the service request is processed according to the target container placement scheme.
[0080] Further, in an embodiment of the present invention, taking into account various experimental configurations and using real data, the entire algorithm process is verified. In order to better compare the algorithm effects, several baseline algorithms are selected for comparison, namely Rounding algorithm, IGraedy algorithm, ILP algorithm, Greedy algorithm and LGraedy algorithm, wherein the Rounding algorithm adopts linear programming technology and obtains a feasible solution through a rounding procedure; the IGraedy algorithm adopts an iterative greedy algorithm to select a cluster to schedule requests; the ILP algorithm uses a Matlab solver to solve each single integer linear programming separately; the Greedy algorithm solves a single time period in each time slot with linear cost as the target; the LGraedy algorithm is based on the Greedy algorithm and takes into account the layer sharing structure of the container image, and then compares it in a scenario involving multiple interconnected geographically dispersed edge clusters, wherein the edge cluster supports 20 different types of services, and the corresponding container data is obtained by crawling DockerHub (public image registration service), and the average size of the layers constituting the corresponding container image is 1377MB. In addition, the bandwidth of each edge cluster is set to 200Mbps to 1800Mbps, the request processing capacity of each server is set to 10 to 90, and considering the data-intensive requests of services such as autonomous driving, the traffic required for the request is set to 12.5MB to 50MB, the communication delay between edge clusters is set to 0.1 to 0.5 seconds, and the communication delay between edge clusters and container image registration centers is set to 0.5 to 1 second. The service request tracking simulated by the user is generated using a uniform distribution with an expected value of 50 or a Poisson distribution with a parameter range of 40 to 50; the results are shown in Figure 2. Figure 6 , Figure 7 , Figure 8 , Figure 9 , Figure 10 and Figure 11 As shown, Figure 6Schematic diagram of the overall cost of each algorithm at different time sequences, Figure 7 Schematic diagram of the quality of service of each algorithm at different time sequences, Figure 8 Schematic diagram of the system consumption of each algorithm at different time sequences, Figure 9 Schematic diagram of the quality of service of each algorithm at different processing capabilities, Figure 10 Schematic diagram of the overall cost of each algorithm at different processing capabilities, Figure 11 Schematic diagram of the overall cost of each algorithm at different bandwidths. According to Figures 6 to 11 It can be shown that the present invention takes into account the comprehensive influence of multiple factors such as request scheduling, storage, container placement, server energy consumption, and server wake-up cost, solves the problem of excessive cost caused by single-factor consideration, thereby reducing the overall cost of the system; also decomposes the time-related container placement and server wake-up cost based on the regularization method, and a feasible solution that meets various system constraint conditions can be output through a step-by-step rounding process, avoiding repeated rounding attempts and a large amount of computational overhead.
[0081] Furthermore, as Figure 12 shown, based on the above-mentioned edge-computing-based container placement optimization method, the present invention also correspondingly provides an edge-computing-based container placement optimization system, and the edge-computing-based container placement optimization system includes:
[0082] A cost analysis module 51, configured to obtain a service request of a user, perform edge cluster scheduling according to the service request to obtain a target edge cluster, and perform cost analysis on the service request according to the target edge cluster to obtain a cost analysis result;
[0083] A cost information solving module 52, configured to obtain cost information of the cost analysis result, perform decomposition processing on the cost information to obtain a plurality of convex problems, and perform solving processing on all the convex problems to obtain a plurality of fractional solutions;
[0084] A container placement optimization module 53, configured to perform up and down iteration processing on all the fractional solutions to obtain a target solution, optimize the container placement scheme of the target edge cluster according to the target solution to obtain a target container placement scheme, and process the service request according to the target container placement scheme.
[0085] Furthermore, as Figure 13 shown, based on the above-mentioned edge-computing-based container placement optimization method, the present invention also correspondingly provides a terminal, and the terminal includes a processor 10, a memory 20, and a display 30. Figure 13 Only some components of the terminal are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.
[0086] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as the hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the terminal. Further, the memory 20 may also include both the internal storage unit and the external storage device of the terminal. The memory 20 is used to store application software installed on the terminal and various types of data, such as program codes for installing the terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a container placement optimization program 40 based on edge computing is stored on the memory 20, and this container placement optimization program 40 based on edge computing can be executed by the processor 10, thereby implementing the container placement optimization method based on edge computing in this application.
[0087] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chips, and is used to run program codes stored in the memory 20 or process data, such as executing the container placement optimization method based on edge computing, etc.
[0088] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10 - 30 of the terminal communicate with each other through a system bus.
[0089] In one embodiment, when the processor 10 executes the program 40 for container placement optimization based on edge computing in the memory 20, the following steps are implemented:
[0090] Obtain a service request from a user, perform edge cluster scheduling according to the service request to obtain a target edge cluster, and perform cost analysis on the service request according to the target edge cluster to obtain a cost analysis result;
[0091] Obtain cost information of the cost analysis result, perform decomposition processing on the cost information to obtain a plurality of convex problems, and perform solution processing on all the convex problems to obtain a plurality of fractional solutions;
[0092] Perform up and down iteration processing on all the fractional solutions to obtain a target solution, optimize the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and process the service request according to the target container placement plan.
[0093] Among them, obtaining the service request of the user, performing edge cluster scheduling according to the service request to obtain a target edge cluster, and performing cost analysis on the service request according to the target edge cluster to obtain a cost analysis result specifically includes:
[0094] Obtain the service request of the user, perform edge cluster scheduling according to the type of the service request to obtain a target edge cluster, and determine the container image of the target edge cluster;
[0095] Obtain the container image layer information of the target edge cluster, and judge whether the container image layer information meets the mirror requirement according to the required image layer of the container image;
[0096] If the container image layer information includes the required image layer of the container image, it is determined that the container image layer information meets the mirror requirement, and cost analysis is performed on the service request according to the number of service requests and the scheduling request number of the target edge cluster to obtain a cost analysis result.
[0097] Among them, after judging whether the container image layer information meets the mirror requirement according to the required image layer of the container image, it further includes:
[0098] If the container image layer information does not include the required image layer of the container image, it is determined that the container image layer information does not meet the mirror requirement, and a container image layer acquisition instruction is generated;
[0099] Send the container image layer acquisition instruction to the container image registry, and receive the target container image layer sent by the container image registry, where the target container image layer is obtained by the container image registry through download processing according to the container image layer acquisition instruction.
[0100] Among them, obtaining the cost information of the cost analysis result, performing decomposition processing on the cost information to obtain a plurality of convex problems, and performing solution processing on all the convex problems to obtain a plurality of fractional solutions specifically includes:
[0101] Obtain the cost information of the cost analysis result, and perform replacement processing on the cost information according to the relative entropy function to obtain a regularization problem, where the cost information includes storage cost, request scheduling cost, server energy consumption cost, container placement cost, and server wake-up cost;
[0102] Decompose the regularization problem to obtain multiple convex problems, and solve all the convex problems according to the convex optimization algorithm to obtain multiple fractional solutions.
[0103] Among them, the expression of the convex problem is:
[0104]
[0105] Among them, is a convex problem, n′ is the target edge cluster, n is the edge cluster, is a group of edge clusters, i is the service request of the user, is the container image, is the communication cost for the service request of the user arriving at the edge cluster to be scheduled to the target edge cluster, is the number of service requests of the user arriving at the edge cluster and scheduled to the target edge cluster during time slot t, l is the image layer, is the set of image layers, is the size of the image layer, is the situation of the edge cluster storing the image layer during time slot t, c n is the energy consumption of the server in the edge cluster, z n (t) is the number of servers activated on the edge cluster during time slot t, is the delay for the image layer to be downloaded to the edge cluster, η x and η z are both constants, ε and ε ′ are both positive constants, is the situation of the edge cluster storing the image layer during time slot t - 1, d n is the server wake-up delay of the edge cluster, z n (t - 1) is the number of servers activated on the edge cluster during time slot t - 1.
[0106] Among them, perform up and down iteration processing on all the fractional solutions to obtain a target solution, optimize the container placement scheme of the target edge cluster according to the target solution to obtain a target container placement scheme, and process the service request according to the target container placement scheme, specifically including:
[0107] Construct a bipartite graph, obtain the boundary value of the floating-point numbers in the bipartite graph, divide the bipartite graph according to the boundary value of the floating-point numbers to obtain the corresponding subgraph, and search for the loop of the subgraph through depth-first search to obtain the target loop;
[0108] Perform a segmentation process on the target loop to obtain a preset number of matching data. Set the rounding probability of any two fractional solutions among all the fractional solutions according to the matching data, and perform a rounding process on all the fractional solutions according to the rounding probability to obtain a rounding result, where the rounding method of the fraction includes rounding up and rounding down;
[0109] Obtain a target solution based on all the integer solutions of the rounding result, optimize the container placement plan of the target edge cluster according to the target solution to obtain a target container placement plan, and process the service request according to the target container placement plan.
[0110] Among them, after performing the rounding process on all the fractional solutions according to the rounding probability to obtain a rounding result, it further includes:
[0111] When there is one remaining fractional solution that has not been rounded, perform a rounding process on the fractional solution according to the rounding up to obtain the corresponding integer solution.
[0112] The present invention also provides a computer-readable storage medium, where the computer-readable storage medium stores a container placement optimization program based on edge computing. When the container placement optimization program based on edge computing is executed by a processor, the steps of the container placement optimization method based on edge computing as described above are implemented.
[0113] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the element.
[0114] Of course, those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by a computer program instructing related hardware (such as a processor, a controller, etc.). The program can be stored in a computer-readable storage medium that can be read by a computer. When the program is executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.
[0115] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above descriptions. All such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A container placement optimization method based on edge computing, characterized in that: The container placement optimization method based on edge computing includes: Obtaining a service request from a user, performing edge cluster scheduling according to the service request to obtain a target edge cluster, and performing cost analysis on the service request according to the target edge cluster to obtain a cost analysis result; The obtaining of the user's service request, performing edge cluster scheduling according to the service request, obtaining a target edge cluster, and performing cost analysis on the service request according to the target edge cluster to obtain a cost analysis result specifically includes: Obtain a user's service request, perform edge cluster scheduling according to the type of the service request, obtain a target edge cluster, and determine a container image of the target edge cluster; Obtaining container image layer information of the target edge cluster, and determining whether the container image layer information meets the image requirements according to the required image layer of the container image; If the container image layer information includes the required image layer of the container image, it is determined that the container image layer information meets the image requirements, and a cost analysis is performed on the service request according to the number of the service requests and the number of scheduling requests of the target edge cluster to obtain a cost analysis result; Obtaining cost information of the cost analysis result, decomposing the cost information to obtain a plurality of convex problems, and solving all the convex problems to obtain a plurality of fractional solutions; The step of obtaining cost information of the cost analysis result, decomposing the cost information to obtain a plurality of convex problems, and solving all the convex problems to obtain a plurality of fractional solutions specifically includes: Obtaining cost information of the cost analysis result, and performing replacement processing on the cost information according to a relative entropy function to obtain a regularized problem, wherein the cost information includes storage cost, request scheduling cost, server energy consumption cost, container placement cost, and server wake-up cost; Decomposing the regularization problem to obtain multiple convex problems, and solving all the convex problems according to a convex optimization algorithm to obtain multiple fractional solutions; Iterate all the score solutions up and down to obtain a target solution, optimize the container placement solution of the target edge cluster according to the target solution to obtain a target container placement solution, and process the service request according to the target container placement solution; The iterative processing of all the score solutions is performed to obtain a target solution, the container placement scheme of the target edge cluster is optimized according to the target solution to obtain a target container placement scheme, and the service request is processed according to the target container placement scheme, specifically including: Constructing a bipartite graph, obtaining boundary values of floating-point numbers in the bipartite graph, dividing the bipartite graph according to the boundary values of the floating-point numbers to obtain corresponding subgraphs, and searching the loops of the subgraphs by depth-first search to obtain target loops; The target loop is segmented to obtain a preset number of matching data, and the rounding probability of any two fractional solutions among all the fractional solutions is set according to the matching data, and all the fractional solutions are rounded according to the rounding probability to obtain a rounding result, wherein the rounding method of the fractional solution includes rounding up and rounding down; A target solution is obtained according to all integer solutions of the rounding result, a container placement scheme of the target edge cluster is optimized according to the target solution to obtain a target container placement scheme, and the service request is processed according to the target container placement scheme.
2. The container placement optimization method based on edge computing according to claim 1 is characterized in that: The step of determining whether the container image layer information meets the image requirements according to the required image layer of the container image further includes: If the container image layer information does not include the required image layer of the container image, it is determined that the container image layer information does not meet the image requirements, and a container image layer acquisition instruction is generated; The container image layer acquisition instruction is sent to a container image registration center, and a target container image layer sent by the container image registration center is received, wherein the target container image layer is obtained by the container image registration center through downloading according to the container image layer acquisition instruction.
3. The container placement optimization method based on edge computing according to claim 1 is characterized in that: The expression of the convex problem is: in, is a convex problem, n′ is the target edge cluster, n is the edge cluster, N is the edge cluster group, i is the user's service request, For container image groups, The communication cost for the service request arriving at the edge cluster to be dispatched to the target edge cluster, is the number of service requests that arrive at the edge cluster during time slot t and are scheduled to the target edge cluster, l is the image layer, is a collection of image layers, is the size of the image layer, is the case where the edge cluster stores the image layer during time slot t, c n is the energy consumption of the server in the edge cluster, z n (t) is the number of servers activated on the edge cluster during time slot t, is the delay of downloading the image layer to the edge cluster, η x and η z are all constants, ε and ε′ are both positive constants, is the case when the edge cluster stores the image layer during time slot t-1, d n is the server wake-up delay of the edge cluster, z n (t-1) is the number of servers activated on the edge cluster during time slot t-1.
4. The container placement optimization method based on edge computing according to claim 1 is characterized in that: The method further comprises: performing rounding processing on all the fractional solutions according to the rounding probability to obtain a rounding result, and then: When there is a fractional solution that has not been rounded off, the fractional solution is rounded off according to the rounding up process to obtain a corresponding integer solution.
5. A container placement optimization system based on edge computing, characterized in that: The edge computing-based container placement optimization system includes: A cost analysis module is used to obtain a user's service request, perform edge cluster scheduling according to the service request, obtain a target edge cluster, and perform cost analysis on the service request according to the target edge cluster to obtain a cost analysis result; The obtaining of the user's service request, performing edge cluster scheduling according to the service request, obtaining a target edge cluster, and performing cost analysis on the service request according to the target edge cluster to obtain a cost analysis result specifically includes: Obtain a user's service request, perform edge cluster scheduling according to the type of the service request, obtain a target edge cluster, and determine a container image of the target edge cluster; Obtaining container image layer information of the target edge cluster, and determining whether the container image layer information meets the image requirements according to the required image layer of the container image; If the container image layer information includes the required image layer of the container image, it is determined that the container image layer information meets the image requirements, and a cost analysis is performed on the service request according to the number of the service requests and the number of scheduling requests of the target edge cluster to obtain a cost analysis result; A cost information solving module, used for obtaining cost information of the cost analysis result, decomposing the cost information to obtain a plurality of convex problems, and solving all the convex problems to obtain a plurality of fractional solutions; The step of obtaining cost information of the cost analysis result, decomposing the cost information to obtain a plurality of convex problems, and solving all the convex problems to obtain a plurality of fractional solutions specifically includes: Obtaining cost information of the cost analysis result, and performing replacement processing on the cost information according to a relative entropy function to obtain a regularized problem, wherein the cost information includes storage cost, request scheduling cost, server energy consumption cost, container placement cost, and server wake-up cost; Decomposing the regularization problem to obtain multiple convex problems, and solving all the convex problems according to a convex optimization algorithm to obtain multiple fractional solutions; A container placement optimization module, configured to perform up-and-down iterative processing on all the score solutions to obtain a target solution, optimize the container placement scheme of the target edge cluster according to the target solution to obtain a target container placement scheme, and process the service request according to the target container placement scheme; The iterative processing of all the score solutions is performed to obtain a target solution, the container placement scheme of the target edge cluster is optimized according to the target solution to obtain a target container placement scheme, and the service request is processed according to the target container placement scheme, specifically including: Constructing a bipartite graph, obtaining boundary values of floating-point numbers in the bipartite graph, dividing the bipartite graph according to the boundary values of the floating-point numbers to obtain corresponding subgraphs, and searching the loops of the subgraphs by depth-first search to obtain target loops; The target loop is segmented to obtain a preset number of matching data, and the rounding probability of any two fractional solutions among all the fractional solutions is set according to the matching data, and all the fractional solutions are rounded according to the rounding probability to obtain a rounding result, wherein the fractional rounding method includes rounding up and rounding down; A target solution is obtained according to all integer solutions of the rounding result, a container placement scheme of the target edge cluster is optimized according to the target solution to obtain a target container placement scheme, and the service request is processed according to the target container placement scheme.
6. A terminal, characterized in that: The terminal includes a memory, a processor, and a program stored in the memory and executable on the processor. When the program is executed by the processor, the steps of the container placement optimization method based on edge computing as described in any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer-readable storage medium stores a container placement optimization program based on edge computing. When the container placement optimization program based on edge computing is executed by a processor, the steps of the container placement optimization method based on edge computing as described in any one of claims 1-4 are implemented.
Citation Information
Patent Citations
Task unloading method and device, electronic equipment and storage medium
CN112988285A
Edge application deployment method and device, equipment and storage medium
CN114265664A