Micro-service deployment method for joint request routing in edge environment
By jointly modeling the deployment and request routing in the edge environment, and using the improved zebra optimization algorithm, the problem of micro -service deployment in existing technology cannot make full use of the edge computing resources, and achieve more efficient and accurate accurate and accurate. Deployment and route strategy.
Patent Information
- Application Number
- CN202411712404.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing microservice deployment methods cannot fully utilize computing resources in edge environments, resulting in limited request routing and inability to achieve optimal performance.
By combining service deployment and request routing, the improved zebra optimization algorithm is used to optimize the micro -service deployment strategy and routing strategy to improve system performance.
The joint optimization of microservices deployment and request routing has broken the limitations of the request routing scheme to be limited by the micro -service deployment scheme, and improve the efficiency and accuracy of the deployment plan.
Smart Images

Figure CN119363583A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of microservice deployment optimization under edge computing, and in particular relates to a microservice deployment method for joint request routing in an edge environment. Background Art
[0002] With the rapid development of Internet technology, especially the rise of emerging technologies such as the Internet of Things (IoT), augmented reality (AR), and self-driving cars, the real-time requirements for computing resources and data processing are becoming increasingly higher. In order to meet these requirements, edge computing has been introduced as an emerging computing paradigm. Edge computing moves computing resources and data storage to the edge of the network, that is, close to the data source and user, thereby reducing the delay of data transmission and improving the response speed of applications.
[0003] However, edge environments usually have limited and heterogeneous computing resources and storage capabilities, which brings more challenges to the deployment of microservices in edge environments. Most of the current microservice deployment methods are designed for cloud computing environments and cannot fully adapt to the characteristics and needs of edge environments. Of course, there are also some deployment solutions designed for edge environments, but these solutions are more concerned with the resources of edge nodes and choose to model and optimize deployment and routing separately, which makes the request routing solution limited to the microservice deployment solution, so that the final deployment solution cannot achieve the optimal performance. Therefore, in order to give full play to the advantages of edge computing, a new microservice deployment method is needed that can jointly optimize service deployment and request routing to improve system performance. Summary of the invention
[0004] In view of the problems raised in the background technology, the present invention provides a microservice deployment method for joint request routing in an edge environment. The method jointly models service deployment and request routing, thereby eliminating the impact of service deployment on request routing to the greatest extent, thereby improving system performance.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A microservice deployment method for joint request routing in an edge environment, the method comprising the following steps:
[0007] S1: According to the trace data structure recorded in the microservice log, the calling direction and data volume between microservices are obtained, and then the service calling chain in the system is obtained;
[0008] S2: Determine the number of instances to deploy for each microservice based on the request load of the microservice;
[0009] S3: construct an objective function based on the latency of microservice request processing, microservice call propagation latency, and routing probability;
[0010] S4: Taking the minimum objective function as the optimization goal, the improved zebra optimization algorithm is used to solve and obtain the optimal microservice deployment strategy;
[0011] Further, the step S1 specifically includes the following steps:
[0012] S11: Initialize a completely directed graph with an initial edge weight of 0. Each node in the graph represents a microservice in the system. The direction of the edge represents the call direction between microservices, and the weight of the edge represents the amount of data transmitted between microservices.
[0013] S12: Update the edge weights of the complete directed graph in step S11 according to the traceid, request initiating service, requested service, data volume, and other information in the microservice log data set, and delete the edges with edge weights of 0;
[0014] S13: Take each microservice that can be directly called by the user as the root node in turn, perform DFS traversal, and the microservice sequence of each traversal path is regarded as a service call chain;
[0015] Further, the step S2 specifically includes the following steps:
[0016] S21: Obtain the request load of the microservice based on the request arrival rate of each microservice and the average service time of a single request;
[0017] S22: The load calculated by microservice S21 is used as the initial number of microservice deployment instances according to the ratio;
[0018] S23: The instance quantity ratio obtained in S22 is increased proportionally until the occupied server resources exceed the total resources of the edge server, and the last instance quantity is taken as the final number of deployed microservice instances;
[0019] Further, the step S3 specifically includes the following steps:
[0020] S31: For each microservice node of each service call chain obtained in step S1, the delay is calculated respectively, and then the call propagation delay and routing probability between microservice instances are further integrated to calculate the delay of each service call chain;
[0021] S32: construct a target optimization function based on the latency of the service call chain obtained in S31, with the goal of minimizing the overall request latency of the system;
[0022] Further, the step S4 specifically includes the following steps:
[0023] S41: Input the system's edge node set, microservice set, service call chain obtained in S1, number of deployment instances obtained in S2, objective function constructed in S3, and model basic parameter information into the zebra optimization model;
[0024] S42: A two-stage update strategy is used to update the individual solutions in the model, and finally the optimal deployment strategy and routing strategy are output. The distance calculation between individuals and the individual deployment strategy are updated in a discretized manner.
[0025] S43: Deploy each microservice instance using the deployment strategy and routing strategy obtained in S42.
[0026] Further, in step S31, the routing probability between microservice instances is calculated by weighted calculation of the resource occupancy rate of the node where the microservice instance is located in the deployment scheme and the propagation delay of the microservice call.
[0027] The present invention has at least the following beneficial effects:
[0028] 1) The present invention breaks the limitation that the request routing scheme is restricted by the microservice deployment scheme by jointly modeling and optimizing the microservice deployment and request routing, thereby improving the efficiency of the deployment scheme.
[0029] 2) The present invention utilizes an improved zebra optimization algorithm and performs detailed modeling of the latency of microservice requests to improve the accuracy of the deployment solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0031] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0032] Figure 2 A schematic diagram of the microservice deployment strategy solution process of the present invention; DETAILED DESCRIPTION
[0033] In this embodiment, each microservice request call chain consists of multiple microservices, each microservice performs a corresponding specific task, and after a microservice is executed, it will pass its results to the next microservice node in the call chain. After receiving the data, the next microservice node will perform the corresponding task processing until all microservices in the call chain are executed and the final result is returned to the user. This microservice architecture helps to better organize and optimize complex business processes by improving the scalability and flexibility of the system and reducing maintenance complexity.
[0034] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0035] The present invention provides a microservice deployment method for joint request routing in an edge environment, such as Figure 1 As shown, the method mainly includes the following steps:
[0036] Step 1: According to the trace data structure recorded in the microservice log, the calling direction and data volume between microservices are obtained, and then the service calling chain in the system is obtained;
[0037] Step 2: Determine the number of instances to deploy for each microservice based on the request load of the microservice;
[0038] Step 3: Construct the objective function based on the latency of microservice request processing, microservice call propagation latency, and routing probability;
[0039] Step 4: Taking the minimum objective function as the optimization goal, the improved zebra optimization algorithm is used to solve and obtain the optimal microservice deployment strategy.
[0040] Preferably, the steps of obtaining the calling direction and the amount of data transmitted between microservices according to the trace data structure recorded in the microservice log, and then obtaining the service calling chain in the system include:
[0041] (1) Initialize a completely directed graph with an initial edge weight of 0. Each node in the graph represents a microservice in the system. The direction of the edge represents the call direction between microservices, and the edge weight represents the amount of data transmitted between microservices.
[0042] (2) According to the traceid, request initiating service, requested service, data transmission volume and other information in the microservice log data set, the edge weights of the complete directed graph in step S11 are updated, and the edges with edge weights of 0 are deleted;
[0043] (3) Take each microservice that can be directly called by the user as the root node in turn and perform DFS traversal. The microservice sequence of each traversal path is regarded as a service call chain.
[0044] Preferably, the step of determining the number of instances of each microservice to be deployed according to the request load of the microservice includes:
[0045] (1) Obtain the request load of each microservice based on the request arrival rate of each microservice and the average service time of a single request;
[0046] (2) The load calculated by microservice S21 is used as the initial number of microservice deployment instances according to the ratio;
[0047] (3) The instance quantity ratio obtained in S22 is increased proportionally until the occupied server resources exceed the total resources of the edge server, and the last instance quantity is taken as the final number of deployed microservice instances;
[0048] Preferably, the request load is calculated as follows:
[0049] load=μ·t avg , where μ is the request arrival rate of the microservice, t avg is the average service time for a single request;
[0050] Preferably, the step of constructing the objective function according to the delay of microservice processing request and the microservice call propagation delay and routing probability includes:
[0051] (1) For each microservice node in each service call chain, calculate its latency respectively, and then further integrate the call propagation latency and routing probability between microservice instances to calculate the latency of each service call chain;
[0052] (2) The latency of the service call chain builds the target optimization function;
[0053] The delay calculation method of the service call chain is as follows:
[0054] (1) Calculation delay
[0055] After the request reaches microservice i deployed in edge server k, the formula for calculating the latency is:
[0056]
[0057] in, Represents the deployment variable of the microservice. The value represents the number of deployed service containers of the i-th microservice on the k-th edge node. This means that the i-th microservice is not deployed on the k-th edge node; represents the service efficiency of microservice i for requests, Represents the request arrival rate of the i-th microservice at the k-th edge node.
[0058] (2) Queuing Delay
[0059] After the request reaches microservice i deployed in edge server k, the formula for calculating the latency is:
[0060]
[0061] in, Represents the deployment variable of the microservice. The value represents the number of deployed service containers of the i-th microservice on the k-th edge node. This means that the i-th microservice is not deployed on the k-th edge node; represents the service efficiency of microservice i for requests, Represents the request arrival rate of the i-th microservice at the k-th edge node.
[0062] (3) Propagation delay
[0063] When a request is transmitted from edge server k to edge server l, the formula for calculating the transmission delay is:
[0064]
[0065] Among them, d (k,l) represents the propagation distance from edge server k to edge server l, speed (k,l) It represents the propagation speed of the medium between edge server k and edge server l.
[0066] (4) Routing probability
[0067] The formula for calculating the routing probability of a request from microservice i on edge server k to microservice j on edge server l is:
[0068]
[0069] (5) Service Call Chain Delay
[0070] The delay of the service call chain is obtained by combining the delay and routing probability, and its calculation formula is:
[0071]
[0072] Among them, |PATH| represents the number of routes for microservice requests; path represents the set of microservice instances that a specific request path passes through, and ms (i,k) represents microservice i deployed on edge node k; ms (j,l) represents microservice j on edge node l, which is the next microservice after microservice i completes the computing task; P represents the probability of calling between two microservice instances.
[0073] Preferably, if Figure 2 As shown in the figure, the steps to solve the optimal microservice deployment strategy using the improved zebra optimization algorithm are as follows:
[0074] (1) Input the service call chain set, edge node set, microservice set, population size, maximum number of iterations, and fitness value threshold;
[0075] (2) Initialize the zebra population Q, where each individual represents a possible deployment scheme and routing probability matrix, denoted as X;
[0076] (3) Calculate the fitness value fitness(X), i.e., the system delay, for each individual, and mark the individual with the lowest fitness value as the pioneer zebra PZ;
[0077] (4) Execute a one-stage foraging strategy, and all individuals move closer to the optimal solution. The update formula is:
[0078] X′=X+r·(PZ-X)
[0079] Here, r is a random number between [0,1].
[0080] (5) Generate a random number R to select the second-stage update strategy; if R < 0.5, execute (6), otherwise execute (7);
[0081] (6) Execute the escape strategy, all individuals explore the unknown area, and the update formula is:
[0082]
[0083] Wherein, R is the update weight coefficient, which is 0.01 in this embodiment; t is the current iteration number; T is the maximum iteration number; and r is a random number between [0, 1].
[0084] (7) Execute the attack strategy, all individuals move closer to the attacked individual, and the update formula is:
[0085] X′=X+r·(AZ-X)
[0086] Where r is a random number between [0,1], and AZ represents the attacked individual.
[0087] (8) Recalculate the routing probability and fitness value of each individual, and select the one with the lowest fitness value as the new pioneer zebra;
[0088] (9) Multiple condition judgment: Check whether the Pioneer Zebra AZ fitness value is lower than the threshold. If it is lower than the threshold, the requirement is met and the result is returned directly; otherwise, check whether the maximum number of iterations has been reached. If not, return to step (4), otherwise return the result;
[0089] Finally, the microservices are deployed on the edge nodes according to the output deployment plan and routing probability.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A microservice deployment method for joint request routing in an edge environment, characterized in that: The following steps are involved: S1: According to the trace data structure recorded in the microservice log, the calling direction and data volume between microservices are obtained, and then the service calling chain in the system is obtained; S2: Determine the number of instances to deploy for each microservice based on the request load of the microservice; S3: construct an objective function based on the latency of microservice request processing, microservice call propagation latency, and routing probability; S4: Taking the minimum objective function as the optimization goal, the improved zebra optimization algorithm is used to solve and obtain the optimal microservice deployment strategy.
2. According to the microservice deployment method for joint request routing in an edge environment according to claim 1, it is characterized in that: In step S1, it specifically includes: S11: Initialize a completely directed graph with an initial edge weight of 0. Each node in the graph represents a microservice in the system. The direction of the edge represents the call direction between microservices, and the weight of the edge represents the amount of data transmitted between microservices. S12: Update the edge weights of the complete directed graph in step S11 according to the traceid, request initiating service, requested service, data volume, and other information in the microservice log data set, and delete the edges with edge weights of 0; S13: Take each microservice that can be directly called by the user as the root node in turn, perform DFS traversal, and the microservice sequence of each traversal path is regarded as a service call chain.
3. According to the microservice deployment method for joint request routing in an edge environment according to claim 1, it is characterized in that: In step S2, it specifically includes: S21: Obtain the request load of the microservice based on the request arrival rate of each microservice and the average service time of a single request; S22: The load calculated by microservice S21 is used as the initial number of microservice deployment instances according to the ratio; S23: The instance quantity ratio obtained in S22 is increased proportionally until the occupied server resources exceed the total resources of the edge server, and the last instance quantity is taken as the final number of deployed microservice instances.
4. According to the microservice deployment method for joint request routing in an edge environment according to claim 1, it is characterized in that: In step S3, it specifically includes: S31: For each microservice node of each service call chain obtained in step S1, the delay is calculated respectively, and then the call propagation delay and routing probability between microservice instances are further integrated to calculate the delay of each service call chain; S32: Build a target optimization function based on the latency of the service call chain obtained in S31, with the goal of minimizing the overall request latency of the system.
5. According to the microservice deployment method for joint request routing in an edge environment in claim 1, it is characterized in that: In step S4, it specifically includes: S41: Input the system's edge node set, microservice set, service call chain obtained in S1, number of deployment instances obtained in S2, objective function constructed in S3, and model basic parameter information into the zebra optimization model; S42: A two-stage update strategy is used to update the individual solutions in the model, and finally the optimal deployment strategy and routing strategy are output. The distance calculation between individuals and the individual deployment strategy are updated in a discretized manner. S43: Deploy each microservice instance using the deployment strategy and routing strategy obtained in S42.
6. According to the microservice deployment method for joint request routing in an edge environment of claim 4, it is characterized in that: In step S31, the routing probability between microservice instances is calculated by the load of the microservice instances in the deployment solution.
Citation Information
Patent Citations
Mobile sensing micro-service deployment method
CN115802372A
Heterogeneous multi-edge cloud collaborative micro-service deployment and routing joint optimization method and system
CN116915686A
Micro-service dynamic adaptive client load balancing method and system
CN117155942A
Micro-service and database joint deployment method based on reinforcement learning in fog computing
CN117640413A
Micro-service deployment method based on interaction weight in edge computing environment
CN117768317A
Cited By
Micro-service elastic telescopic arrangement method and arrangement device
CN121078133A
A micro-service elasticity scaling method and orchestrator
CN121078133B