Container placement optimization method and system based on edge calculation, and terminal
Through the container placement optimization method in edge computing, the container placement solution is decomposed and optimized through edge cluster scheduling and cost analysis, the delay and energy consumption problems caused by container placement in the prior art are solved, and more efficient resource utilization and dynamics are achieved Adaptability.
Patent Information
- Application Number
- CN202410984009.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-07-22
AI Technical Summary
The prior art container placement strategy in edge computing scenarios leads to problems such as high request scheduling delay, increased energy consumption and inability to adapt to dynamic characteristics, and relying on offline layer placement strategy cannot effectively respond to changes in the online environment.
By obtaining user service requests, performing edge cluster scheduling and cost analysis, decomposing cost information into convex problems, using convex optimization algorithm to solve and iterate up and down, optimizing container placement schemes to reduce system costs and delays.
It effectively reduces the overall cost of the system, improves the efficiency and adaptability of container placement, avoids repeated rounding and calculation overhead, and optimizes the use of request scheduling and storage resources.
Smart Images

Figure CN119088501A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data optimization technology, and in particular 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, core networks are facing increasing pressure. Edge computing solves this problem by leveraging various clusters deployed at the edge of the core network. In edge computing scenarios, containers have become a powerful tool for service development across various computing environments. Containers are characterized by lightweight, independent, executable, layer-structured images that contain all the basic components of hosted services. To run containers on edge clusters, the indispensable layers of container images must be stored locally; or if these layers are not stored locally, they must be downloaded from a cloud-based remote container image registry; 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] At present, existing technologies only focus on layer-based container placement, but ignore the additional system costs that will be incurred in reality. Driven by layer sharing, containers sharing a common layer will be placed on a specific edge cluster, resulting in too many requests corresponding to these containers being scheduled to this specific edge cluster. The excessive surge in incoming requests requires 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 the request to be scheduled to a remote edge cluster or an edge cluster with low energy efficiency, resulting in higher communication delays or high energy consumption; and the container placement strategy that relies on the offline layer assumes prior knowledge of future request patterns, and thus cannot adapt to the dynamic and unpredictable characteristics of the online edge environment.
[0004] Therefore, the prior art still needs 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 problem in the prior art that too many requests corresponding to containers are scheduled to a specific edge cluster, resulting in a large wake-up delay, and may also cause the requests to be scheduled to a remote edge cluster or an edge cluster with low energy efficiency, thereby causing higher communication delays or high energy consumption; and the container placement strategy relies on the offline layer and cannot adapt to the dynamic characteristics of the online edge environment.
[0006] To achieve the above object, the present invention provides a container placement optimization method based on edge computing, and the container placement optimization method based on edge computing comprises the following steps:
[0007] 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;
[0008] 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;
[0009] Iterate all the score solutions up and down 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.
[0010] Optionally, the container placement optimization method based on edge computing, wherein obtaining a user's service request, 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 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;
[0012] 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;
[0013] 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.
[0014] Optionally, the container placement optimization method based on edge computing, wherein the step of judging whether the container image layer information meets the image requirements according to the required image layer of the container image, further comprises:
[0015] 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;
[0016] 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.
[0017] Optionally, the container placement optimization method based on edge computing, wherein the cost information of the cost analysis result is obtained, the cost information is decomposed to obtain multiple convex problems, and all the convex problems are solved to obtain multiple fractional solutions, specifically including:
[0018] Obtaining cost information of the cost analysis result, and performing replacement processing on the cost information according to the 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;
[0019] The regularization problem is decomposed to obtain multiple convex problems, and all the convex problems are solved according to a convex optimization algorithm to obtain multiple fractional solutions.
[0020] Optionally, in the container placement optimization method based on edge computing, the expression of the convex problem is:
[0021]
[0022] in, is a convex problem, n' is the target edge cluster, n is the edge cluster, is the edge cluster group, i is the user's service request, For container images, 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.
[0023] Optionally, the container placement optimization method based on edge computing, wherein the iterative processing of all the fractional solutions is performed up and down 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:
[0024] 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;
[0025] 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;
[0026] 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.
[0027] Optionally, the container placement optimization method based on edge computing, wherein the rounding process is performed on all the fractional solutions according to the rounding probability to obtain a rounding result, and then further includes:
[0028] 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.
[0029] Optionally, in the container placement optimization method based on edge computing, the container placement optimization system based on edge computing includes:
[0030] 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;
[0031] 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;
[0032] The container placement optimization module is used to iterate all the score solutions up and down 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.
[0033] In addition, to achieve the above-mentioned purpose, the present invention also 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, wherein the edge computing-based container placement optimization program, when executed by the processor, implements the steps of the edge computing-based container placement optimization method as described above.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a container placement optimization program based on edge computing, and 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.
[0035] In the present invention, the user's service request is obtained, and the edge cluster is scheduled according to the service request to obtain the target edge cluster, and the service request is cost analyzed according to the target edge cluster to obtain the cost analysis result; the cost information of the cost analysis result is obtained, and the cost information is decomposed to obtain multiple convex problems, and all the convex problems are solved to obtain multiple fractional solutions; all the fractional solutions are iterated up and down to obtain the target solution, and the container placement scheme of the target edge cluster is optimized according to the target solution to obtain the target container placement scheme, and the service request is processed according to the target container placement scheme. The present invention performs scheduling from the granularity of the layer, taking 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; it also decomposes the time-related container placement and server wake-up costs based on the regularization method, and can output feasible solutions that meet various system constraints through a step-by-step rounding process, avoiding repeated rounding attempts and a large amount of computing overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flow chart of a preferred embodiment of the container placement optimization method based on edge computing in the present invention;
[0037] Figure 2 It 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;
[0038] Figure 3Schematic diagram of the ORR algorithm of the preferred embodiment of the present invention;
[0039] Figure 4 It is a flowchart of the WPR algorithm of the preferred embodiment of the present invention;
[0040] Figure 5 It is a flow chart of the PR algorithm of the preferred embodiment of the present invention;
[0041] Figure 6 is a schematic diagram of the overall cost of each algorithm in a preferred embodiment of the present invention at different time sequences;
[0042] Figure 7 is a schematic diagram of the service quality of each algorithm in a preferred embodiment of the present invention at different time sequences;
[0043] Figure 8 is a schematic diagram of system consumption of each algorithm in a preferred embodiment of the present invention at different time sequences;
[0044] Fig. 9 is a schematic diagram of the service quality of each algorithm under different processing capabilities in a preferred embodiment of the present invention;
[0045] Fig.10 is a schematic diagram of the overall cost of each algorithm under different processing capabilities in a preferred embodiment of the present invention;
[0046] Fig.11 is a schematic diagram of the overall cost of each algorithm under different bandwidths in a preferred embodiment of the present invention;
[0047] Fig.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;
[0048] Fig.13 It is a schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0050] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0051] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0052] The container placement optimization method based on edge computing described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the container placement optimization method based on edge computing includes the following steps:
[0053] 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.
[0054] The step S10 comprises:
[0055] Step S11: Obtain a service request from a user, 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;
[0056] Step S12: Obtain container image layer information of the target edge cluster, and determine whether the container image layer information meets the image requirements according to the required image layer of the container image;
[0057] Step S13: 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.
[0058] Specifically, the existing layer-granularity-level container placement only focuses on layer-based container placement, but ignores the additional system costs that will be incurred in reality. Driven by layer sharing, containers sharing a common layer 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 surge in incoming requests requires 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 the request to be scheduled to a remote edge cluster or an edge cluster with low energy efficiency, resulting in higher communication delays or high energy consumption; and the container placement strategy that relies on the offline layer assumes prior knowledge of future request patterns, and thus cannot adapt to the dynamic characteristics of the online edge environment; in order to solve the above-mentioned problems, the present invention considers the comprehensive impact of multiple factors such as request scheduling, storage, container placement, server energy consumption and server wake-up cost, such as Figure 2 As shown, in an embodiment of the present invention, a mathematical model of layer-aware joint resource provision, request scheduling and container placement is established to minimize multiple costs; and the edge computing network, that is, the edge cluster group is composed of a group of geographically dispersed edge clusters, for example, edge cluster 1, edge cluster 2 and edge cluster 3, etc., and N = {1,2,…,|N|} represents the edge cluster group; each edge cluster is composed of two main parts, one is a storage device responsible for storing data, and the other is a server responsible for processing service requests; Represents a time slot set. Each edge cluster in the edge cluster group can communicate with each other and work together. The central controller makes a control decision in each time slot. After receiving the corresponding control decision, the edge cluster performs corresponding operations according to the control decision and transmits the cluster state back to the central controller so that the central controller can make a decision in the next time slot.
[0059] The container image registry on the cloud stores a set of container images. Indicates that each container image is composed of multiple layers (i.e., image layers), Represents a collection of image layers. Use Indicates whether the container image contains image layers, where: Indicates that the container image contains image layers. Indicates that the container image does not contain image layers, and to deploy the container on the corresponding edge cluster, the edge cluster must store all image layers required by the corresponding container image. If there is a missing image layer, the missing image layer must be downloaded from the container image registration center; then, the service request is cost analyzed according to the number of service requests and the number of scheduling requests of the target edge cluster to obtain the cost analysis result, specifically, using represents the number of service requests arriving at the edge cluster during time slot t. The user's service request 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 target edge cluster n', and is expressed as represents the situation of edge cluster storing image layer during time slot t, where Indicates that the edge cluster stores the image layer during time slot t. indicates that the edge cluster does not store the image layer during time slot t; therefore, the corresponding constraint can be expressed as This inequality shows that the edge cluster has all the image layers required to deploy the container image, and the number of service requests dispatched to the target edge cluster cannot exceed the number of service requests sent to the original edge cluster. In addition, the storage space of the edge cluster is used to store all image layers. The servers in the edge cluster can access these image layers through the internal high-speed LAN. n (t)∈N + represents the number of servers activated on the edge cluster during time slot t.
[0060] Step S20: Obtain 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.
[0061] The step S20 comprises:
[0062] Step S21, obtaining cost information of the cost analysis result, and performing replacement processing on the cost information according to the 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;
[0063] Step S22: decompose the regularization problem to obtain multiple convex problems, and solve all the convex problems according to a convex optimization algorithm to obtain multiple fractional solutions.
[0064] Specifically, in an embodiment of the present invention, cost information of the cost analysis result is obtained, and the cost information includes storage cost, request scheduling cost, server energy consumption cost, container placement cost and server wake-up cost, wherein 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 user's service request, The communication cost of the service request of the user arriving at the edge cluster is dispatched to the target edge cluster; the expression of the server energy consumption cost is: ∑t∈T ∑ n∈N c n z n (t), c n is the energy consumption of the server in the edge cluster; the expression of the container placement cost is: is the delay of downloading the image layer to the edge cluster; the expression of the server wake-up cost is:∑ t∈T ∑ n∈N d n [z n (t)-z n (t-1)] + , d n is the server wake-up delay of the edge cluster; With these costs and constraints, we get a joint resource provision, request scheduling and container placement problem P of the joint layer awareness, and the corresponding expression is:
[0065]
[0066] in, is the case when the edge cluster stores the image layer during time slot t-1, z n (t-1) is the number of servers activated on the edge cluster during time slot t-1, and the corresponding constraint It means that the edge cluster providing the service must have the required layers, and the number of requests dispatched to the target edge cluster cannot exceed the number of requests initiated. In order to ensure stable service delivery, it is necessary to dispatch each user's service request to the corresponding edge cluster. Therefore, there is a constraint Note n (t) cannot exceed the maximum number of servers on the edge cluster. The target edge cluster must ensure that there are sufficient computing resources to process the service requests received from users. Therefore, there is a constraint Q n' is the computing resource of the target edge cluster, z n' (t) is the number of servers activated on the target edge cluster during time slot t.
[0067] In order to solve the problem P, an online algorithm is proposed in the embodiment of the present invention. Specifically, firstly, a relaxed problem is obtained by relaxing integer variables. When solving the relaxed problem, the remaining difficulty 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 relaxed problem, thereby obtaining a regularized problem, denoted by P2. The regularized problem is represented as a subproblem (i.e., a convex problem, denoted by represents the sum of The expression of the convex problem is:
[0068]
[0069] Among them, η x and η z are all constants, and ε and ε' are both positive constants. In order to prevent outliers, small positive constants ε and ε' are added to the denominator and numerator of the fraction in the relative entropy function, and the constant η x and η z It is used to normalize the regularized container placement cost and server wake-up cost.
[0070] Since the objective function is a convex function and all constraints are linear, the subproblem is a convex problem for each time slot. In addition, the subproblem only requires current information and previous decisions in the time slot; therefore, the subproblem can be solved efficiently in polynomial time complexity using standard convex optimization algorithms (e.g., interior point methods), i.e., the fractional solution can be obtained by processing the problem separately for each time slot using the subroutine ORR (Online Regularization and Rounding, based on online regularization). The ORR algorithm flow is as follows Figure 3 As shown, Figure 3 In the figure, line 4 refers to calling the subroutine ORR to obtain a fractional solution, and lines 5 to 9 refer to calling the subroutines WPR (Weighted Pairwise Rounding) and PR (Pairwise Rounding) to obtain integer solutions. Specifically, first, WPR is called in line 5 to obtain a partial integer solution, and then this partial integer solution is fixed, and PR is called in line 7 to obtain an integer solution, and then this partial integer solution is fixed, and WPR is called in line 9 to obtain the final fractional solution.
[0071] Step S30: perform up and down iterative processing on all the score 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.
[0072] The step S30 comprises:
[0073] Step S31, constructing a bipartite graph, obtaining the boundary value of the floating-point number in the bipartite graph, dividing the bipartite graph according to the boundary value of the floating-point number to obtain corresponding subgraphs, and searching the loop of the subgraph by depth-first search to obtain a target loop;
[0074] Step S32, dividing the target loop to obtain a preset number of matching data, setting rounding probabilities of any two fractional solutions among all the fractional solutions according to the matching data, and performing rounding processing on all the fractional solutions according to the rounding probability to obtain a rounding result, wherein the rounding method of the fraction includes rounding up and rounding down;
[0075] Step S33: Obtain a target solution according to all 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.
[0076] Specifically, considering the integer constraints inherent in the service request, it must be noted that the fractional solution does not satisfy the conditions of these overall constraints. Therefore, it is necessary to round the fractional solution to a feasible integral solution. First, call WPR to round the partial fractional solution. The main purpose of rounding is to select two fractional solutions and round them in a complementary manner. The whole process is as follows: Figure 4 As shown, Figure 4 In the example, 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 probability of rounding up and rounding down the selected fractional solutions, and updating the values of these fractional solutions, lines 14 to 17 refer to rounding up and rounding down all fractional solutions until there is only one fractional solution or no fractional solution in the entire loop iteration, and lines 18 to 19 refer to rounding up directly for this fractional solution if there is only one fractional solution left.
[0077] The subroutine PR process is as follows Figure 5 As shown, Figure 5 In 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.
[0078] 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.
[0079] 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 , Fig. 9 , Fig.10 and Fig.11 As shown, Figure 6 A schematic diagram of the overall cost of each algorithm at different timings, Figure 7 A schematic diagram of the service quality of each algorithm at different timings. Figure 8 A schematic diagram of the system consumption at different timings for each algorithm. Fig. 9 A schematic diagram of the service quality of each algorithm under different processing capabilities. Fig.10 A schematic diagram of the overall cost of each algorithm at different processing power. Fig.11 A schematic diagram of the overall cost of each algorithm at different bandwidths, according to Figures 6 to 11It can be shown that the present invention takes into account the combined impact 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, and thus reduces the overall cost of the system; it also decomposes the time-related container placement and server wake-up costs based on a regularized method, and outputs feasible solutions that meet various system constraints through a step-by-step rounding process, avoiding repeated rounding attempts and a large amount of computational overhead.
[0080] Furthermore, if Fig.12 As shown, based on the above-mentioned container placement optimization method based on edge computing, the present invention also provides a container placement optimization system based on edge computing, and the container placement optimization system based on edge computing includes:
[0081] The data identification module 51 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;
[0082] A data processing module 52 is used to obtain 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;
[0083] The frequency point identification module 53 is used to perform up and down iterative 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.
[0084] Furthermore, if Fig.13 As shown, based on the above-mentioned container placement optimization method based on edge computing, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Fig.13 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0085] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a 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 memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Furthermore, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation 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 the container placement optimization program 40 based on edge computing can be executed by the processor 10, thereby realizing the container placement optimization method based on edge computing in the present application.
[0086] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the edge computing-based container placement optimization method.
[0087] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, 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 via a system bus.
[0088] In one embodiment, when the processor 10 executes the program 40 for optimizing container placement based on edge computing in the memory 20, the following steps are implemented:
[0089] 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;
[0090] 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;
[0091] Iterate all the score solutions up and down 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.
[0092] The acquiring 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:
[0093] 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;
[0094] 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;
[0095] 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.
[0096] The step of judging whether the container image layer information meets the image requirements according to the required image layer of the container image further includes:
[0097] 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;
[0098] 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.
[0099] The step of 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:
[0100] Obtaining cost information of the cost analysis result, and performing replacement processing on the cost information according to the 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;
[0101] The regularization problem is decomposed to obtain multiple convex problems, and all the convex problems are solved according to a convex optimization algorithm to obtain multiple fractional solutions.
[0102] The expression of the convex problem is:
[0103]
[0104] in, is a convex problem, n' is the target edge cluster, n is the edge cluster, is the edge cluster group, i is the user's service request, For container images, The communication cost for the service request of the user arriving at the edge cluster to be dispatched to the target edge cluster, is the number of service requests from users 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.
[0105] The iterative processing of all the score solutions to obtain a target solution is performed, 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:
[0106] 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;
[0107] 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;
[0108] 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.
[0109] The method further comprises the following steps: performing rounding processing on all the fractional solutions according to the rounding probability to obtain a rounding result; and then:
[0110] 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.
[0111] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a container placement optimization program based on edge computing, and 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.
[0112] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0113] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0114] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to 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; 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; Iterate all the score solutions up and down 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.
2. The container placement optimization method based on edge computing according to claim 1 is characterized in that: 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.
3. The container placement optimization method based on edge computing according to claim 2 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.
4. The container placement optimization method based on edge computing according to claim 1 is characterized in that: 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; The regularization problem is decomposed to obtain multiple convex problems, and all the convex problems are solved according to a convex optimization algorithm to obtain multiple fractional solutions.
5. 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, 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.
6. The container placement optimization method based on edge computing according to claim 1 is characterized in that: The iterative processing of all the fractional 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.
7. The container placement optimization method based on edge computing according to claim 6 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.
8. 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; 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 container placement optimization module is used to iterate all the score solutions up and down 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.
9. 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 7 are implemented.
10. 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-7 are implemented.
Citation Information
Patent Citations
Task unloading method and device, electronic equipment and storage medium
CN112988285A
Robust service supply method for multi-access edge computing environment
CN113032146A
Edge application deployment method and device, equipment and storage medium
CN114265664A
Dynamic arrangement and task scheduling method and system for edge cloud mixed operation
CN115756772A
Unmanned aerial vehicle cluster grouping assisted air-ground cooperative computing network resource allocation method
CN116761217A
