Topology-aware dynamic microservice migration and route redirection method and system
By acquiring resource and request flow characteristics in cloud computing data centers and combining topology awareness and proportional probability routing models, the migration and routing strategies of microservices are optimized, solving the problems of uneven resource utilization and increased communication latency, and achieving more efficient resource utilization and service quality.
Patent Information
- Application Number
- CN202411582164.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-11-07
AI Technical Summary
In cloud computing data centers, existing technologies lack awareness of network topology, leading to the deployment and migration of microservices based on static strategies. This results in uneven resource utilization, increased communication latency, and decreased service quality, especially when there is a dynamic request flow, making it impossible to quickly respond to and adjust deployment locations and routing schemes.
By acquiring cloud computing data center resource information and request flow characteristics in dynamic scenarios, and combining proportional probability routing models and topology awareness, we can optimize microservice migration and routing strategies, including joint decision-making on multi-image initial deployment, migration operations, and request routing, to achieve optimal microservice deployment and request routing.
It optimizes the resource utilization of cloud computing data centers, reduces communication load, improves service quality and request success rate, and solves the problems of bandwidth bottlenecks and resource waste.
Smart Images

Figure CN119676150B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of edge computing, and particularly relates to a dynamic micro-service migration and routing redirection method and system based on topology awareness. BACKGROUND
[0002] In modern cloud computing data centers, micro-service architecture has become the main way of application development and deployment due to its high flexibility and scalability. As a lightweight and loosely coupled architecture, services decouple Internet applications into a series of small components or modules with single responsibility. This modular architecture is beneficial to development and management due to its flexibility, superior scalability and easy reusability. However, with the increase of the number of micro-services, how to efficiently manage these services and their communication between them becomes a key problem. Migration and routing management of micro-services have a direct impact on system performance, resource utilization and service quality.
[0003] In cloud computing data centers, micro-service-based applications receive a large number of user requests per second, resulting in recursive call dependencies and frequent data communication. In addition, high-concurrency communication, complex call dependency relationships and strict delay constraints pose serious challenges to image-level orchestration. Due to complex data communication and call dependency relationships, deployment, migration and routing are tightly coupled and dependent. On the one hand, if the routing strategy is not determined, the effectiveness of the deployment and migration scheme cannot be evaluated; on the other hand, if the deployment and migration scheme is not determined, the request routing cannot be carefully planned. However, most of the work is to investigate service deployment, migration and routing separately, ignoring the complex service topology dependency relationship, and the existing deployment and migration of micro-services are often based on static strategies, lacking awareness of network topology, resulting in unbalanced resource utilization, increased communication delay and decreased service quality. Especially in the face of dynamic request flow, how to quickly respond and adjust the deployment location and routing scheme of micro-services has become a problem to be solved. SUMMARY
[0004] The present application aims to overcome the problems in the prior art and provides a dynamic micro-service migration and routing redirection method and system based on topology awareness, which realizes the optimal migration and routing strategy of micro-services by comprehensively considering the request flow characteristics, server node resource state and network topology structure, solves the problems of bandwidth bottleneck, server resource waste and service response time increase associated with the existing micro-service orchestration scheme in dynamic scenarios, and improves the overall operation efficiency and service quality of cloud computing data centers.
[0005] To achieve the above purpose, the technical solution of the present application is:
[0006] In a first aspect, the application provides a topology-aware dynamic microservice migration and routing redirection method, comprising the following steps:
[0007] S1, obtaining cloud computing data center and edge server resource information, application request stream set and initial image deployment matrix under dynamic scene, and dividing time slot-based input request stream characteristics;
[0008] S2, in each time slot divided, obtaining a multi-image preliminary deployment scheme of microservice through marginal gain optimization based on the characteristics of the input request stream, and redirecting the node routing scheme based on the proportion probability routing model according to the image deployment matrix of the physical server node;
[0009] S3, according to the resource cost of the cloud computing data center and the multi-image preliminary deployment scheme and the node routing scheme, screening out the topology-dependent pair with abnormal bandwidth in the request stream, performing migration operation on the microservice image of the server node connected by the link with abnormal bandwidth based on topology awareness, and obtaining the optimal joint decision of microservice deployment and request routing of all requests.
[0010] S11, obtaining cloud computing data network and edge server resource information G=(V, E), wherein V={v1, v2, …, v |V|} represents the set of edge server nodes, E represents the set of links connecting two edge servers v i , v j , and represents the maximum bandwidth capacity between v i , v j , obtaining microservice type set For the i-th microservice A core on a server can only containerize one corresponding microservice image, and due to the heterogeneity of microservices, the core of the same server has different processing capabilities for different types of microservice task requests, and the unit processing capability is represented as
[0011] S12, input user request stream into different time slots, each time slot has the same duration, and the scheduler of the cloud computing data center deploys and migrates microservice images at the beginning of each time slot, and obtains all microservice-based request stream sets accepted by the cloud computing data center under different time slots Wherein, represents the set of time slots; in time slot t, the microservice-based application request stream is characterized by four parameters to obtain time slot-based input request stream characteristics: Wherein represents the time when the microservice-based application request stream f(t) arrives at the data center, λ f(t) is the average request arrival rate of the request stream f(t) in real time, is the topology of the microservice request stream f(t), represents a set of directed dependencies in the microservice request stream f(t), is the maximum request response time threshold of the request stream f(t) predefined according to user requirements, and in addition, C(t) v represents the current remaining computing resources of the physical server v∈V, represents the current remaining bandwidth resources of the link .
[0012] S13, initialize the microservice mirror deployment matrix Y(t) in the time slot t, represents the number of microservice mirrors occupied by the microservice on the physical server v∈V, which is used to execute user requests during the time slot t; in order to ensure that the total number of microservice mirrors deployed in each time slot cannot exceed the total computing resources of the physical server, the following computing resource constraints are defined:
[0013]
[0014] wherein, is a decision variable, represents the number of mirrors allocated to the microservice on the server node v∈V in the time slot t.
[0015] S21, build a proportional probability routing model, in each time slot t, according to the number of microservice mirrors deployed on each physical node, allocate a probability routing scheme:
[0016]
[0017] wherein, represents the probability that, in the execution process of the request stream f(t), a request is routed from the predecessor microservice m i deployed on the node v p to the successor microservice m j deployed on the node v s .
[0018] S22, in each time slot t, statistics the log information of the cloud data center, calculate the average data transmission delay, and according to the topology of all real-time changing microservice-based request streams sort all request streams in descending order according to the size of the equivalent average request arrival rate, recalculate the transmission delay and tolerance delay, and allocate the number of mirrors to each microservice according to the service intensity;
[0019] The calculation formula of the transmission delay is:
[0020] where D f(t) denotes the average data size for a unit request arrival rate of request stream f(t); denotes the residual bandwidth resource between node v i and node v j ; denotes the transmission delay between node v i and node v j ; is the real-time average request arrival rate of microservice m s in request stream f(t);
[0021] The bandwidth constraint formula is:
[0022] The formula for tolerating delay and mirror updating is:
[0023]
[0024] where, denotes the number of mirrors allocated to microservice m j in request stream f(t); denotes the average arrival rate of microservice m j in request stream f(t); denotes the unit processing capacity of microservice m j in request stream f(t); denotes the updated request stream tolerance delay, and are the average communication delay and average transmission bandwidth between data center server nodes, respectively;
[0025] S23, for each required microservice, adopt the round-robin placement method to distribute the microservice mirror on U server nodes, form U request queues according to the topology order of the request stream, and calculate the probability p u∈U of each request service path; then, add one mirror for each microservice under the condition of meeting the time constraint, update the probability synchronously and calculate the time gain, re-calculate the response delay after each round of mirror number update, select the lowest delay as the optimal multi-mirror preliminary deployment scheme with marginal gain, update the microservice mirror deployment matrix Y(t), and simultaneously redirect the node routing scheme according to the updated microservice mirror deployment matrix Y(t) by the method described in S21.
[0026] S31, first, count the resource cost consumption of the data center, calculate the resource utilization rate of all active nodes at the current time in the preliminary deployment scheme and update the residual bandwidth resource according to activating server node V active ascending order, while according to ascending order The calculation formula is as follows:
[0027]
[0028] wherein, represents the resource utilization of node v, C v represents the total computing resources of node v;
[0029] S32, screening out abnormal links in the set , and initializing an abnormal link set in ascending order of the negative part For abnormal links, i.e. links with negative residual bandwidth resources, find a minimum-cost-based microservice image migration scheme for service images and topology-dependent pairs on the server nodes connected by the links. Once the topology-dependent pairs and the number of images to be migrated are determined, all containerized images corresponding to the pairs need to be found to meet the requirements. The first adaptive greedy scheme is used to migrate microservice images, and the global deployment scheme is updated to complete the migration of all topology link pairs that do not meet the bandwidth constraints.
[0030] S321, for bandwidth resource optimization, request flow level tracking analysis is performed, when For each link with abnormal bandwidth resources, i.e. Through a probabilistic routing scheme determine all possible request flows f(t) through the link and the corresponding topology-dependent pairs (m p ,m s ), calculate the sum of the cumulative data traffic of all microservice applications contained in each topology-dependent pair D(m p ,v i ,m s ,v j ), and sort each topology-dependent pair in ascending order according to the data traffic increasesort(D(m p ,v i ,m s ,v j ));
[0031] S322, initialize the migration list Migration_List for the microservice images that need to be migrated, and loop through each topology-dependent pair (m p ,m s) determine the maximum number of migratable images and determine the migration object set, update the above list; traverse the list of objects to be migrated, for each microservice m p , according to the F(t) topology dependency relationship, count all the predecessor microservice node set p and the successor microservice node set of the microservice image m p , and calculate the data traffic set from the predecessor microservice and the data traffic set forwarded to the successor microservice Calculate the sum of the number of all predecessor and successor microservice images on each active server node According to the weighted sum of communication delay and the number of images with topology dependency relationship with m p , the server nodes are arranged in descending order, thereby obtaining the active server node set V p sorted by dependency degree active ;
[0032] S323, loop each topology dependency pair (m p , m s ) for migration, where m p represents the source end and m s represents the destination end in the dependency relationship, which is equivalent to determining the migration object that must be migrated. The migration method is to migrate the source (priority, low cost) or migrate the source + destination (lag, high cost). Here, on-demand migration of the corresponding microservice image source is considered;
[0033] Initialize the pre-migration image number , which represents the actual number of images that need to be migrated out on the node v i about microservice m p , initialize , which represents the bandwidth resource consumption that needs to be reduced in this abnormal link, and when , the pre-migration image number is increased Calculate the data communication change amount ΔD(m p , v i , m s , v j ) caused by migrating this image number, subtract the corresponding data communication change amount ΔD(m p , v i , m s , v j ), and update Stop until , update the remaining bandwidth resource Thus For topologically dependent pairs (m p ,m s The number of images to be migrated;
[0034] Once the topological dependency pairs to be migrated (m) are determined p ,m s ) and number of mirrors It is necessary to find suitable destination server nodes for all containerized images, and determine the actual migration plan for the image objects to be migrated based on the aforementioned topology dependency pairs:
[0035] For topological dependency pairs (m) p ,m s The source-side microservice m in ) p The set of active server nodes V, sorted by dependency, is obtained by the method described in S322. active ;
[0036] First, iterate through V. active ,initialization Indicates from node v i to node v j Regarding microservices m p The actual number of images to be migrated, and the setting of computing resource constraints. in and Representing node v respectively j The number of cores and the number of remaining cores; This represents the upper limit of average network resource utilization; when the constraint is met, an additional mirror to be migrated is added. According to the mirror ratio Computational predecessor microservices and subsequent microservices Topology-dependent changes in data communication volume and Repeat the above process until the number of migrated mirrors causes insufficient bandwidth link communication resources or node computing resources, then reduce the number of mirrors to be migrated by one. The number of mirrors, and the destination nodes that meet the requirements. Add it to the Migration_Destination_List;
[0037] Next, for each migration destination in the Migration_Destination_List Calculate the path through node v i and v j microservices on m p The sum of the average response times of all routing paths Will A mirror image from node v i Migrate to node v j Update node v i and v j microservices m p The number, and only in microservice m p Perform global proportional probability-based redirection request routing and calculate the path taken through node v after migration. i and v j microservices on m p The sum of the average response times of all routing paths Calculate the latency gain caused by unit migration mirroring. according to The value is used to sort the server nodes in Migration_Destination_List in descending order to obtain Decrease_Migration_Destination_List;
[0038] S324 uses a first-fit greedy algorithm to migrate microservice images and updates the global deployment scheme. And for m p The system redirects predecessor and successor microservice dependencies by adhering to resource-proportion-aware routing principles to determine a global probabilistic routing scheme.
[0039] Migrate microservice images using a first-fit greedy approach and update the global deployment scheme. For each migration destination in Decrease_Migration_Destination_List Perform the migration operation directly and update the number of pre-migration images, using the following formula:
[0040]
[0041] Once all images to be migrated have been migrated, Afterwards, update the migrated microservice m. p Image deployment solution And for m p Redirecting routes are performed on predecessor and successor microservice dependency pairs, and a global probabilistic routing scheme is determined based on the routing principle of resource proportion.
[0042] S325, if the network resources of the existing active server nodes are insufficient and there are still remaining microservice images that have not been migrated in a timely manner, select a new server node as the destination migration node based on the principles of minimum latency and maximum bandwidth capacity; update the decision variables that need to be determined. and recalculate the bandwidth of each link, update the heterogeneous link set Return to S321 to repeat the above process until there is no abnormal link in the data center system, and the dynamic microservice migration process is completed.
[0043] In a second aspect, the application provides a topology-aware dynamic microservice migration and routing redirection system, which is used to execute the topology-aware dynamic microservice migration and routing redirection method described above, and specifically includes a dynamic information acquisition and initialization module, a microservice deployment and routing redirection module, and a microservice migration module.
[0044] The dynamic information acquisition and initialization module is used to acquire cloud computing data center and edge server resource information, application request stream sets, and initialize image deployment matrices in a dynamic scenario, and divide time slot-based input request stream features.
[0045] The microservice deployment and routing redirection module is used to obtain a multi-image preliminary deployment scheme of microservices in each time slot divided based on the features of the input request stream by the marginal gain optimization method, and to redirect the node routing scheme based on the proportional probability routing model according to the image deployment matrix of the physical server node.
[0046] The microservice migration module is used to filter out topology-dependent pairs with abnormal bandwidth in the request stream based on the resource cost of the cloud computing data center and the multi-image preliminary deployment scheme and the node routing scheme, perform migration operations on the microservice images on the server nodes connected by the links with abnormal bandwidth based on topology awareness, and obtain the optimal joint decision of microservice deployment and request routing for all requests.
[0047] The microservice migration module includes a resource-aware unit and an image migration unit.
[0048] The resource-aware unit is used to first count the resource cost consumption of the data center, calculate the resource utilization rate of all active nodes at the current time in the preliminary deployment scheme and update the remaining bandwidth resources According to sort the active server nodes V active in ascending order, and sort the physical link set in ascending order according to The calculation formula is as follows:
[0049]
[0050] wherein, represents the resource utilization rate of node v, C v represents the total computing resources of node v.
[0051] The mirror migration unit is configured to: screen out abnormal links in the set, sort the negative part in ascending order, and initialize an abnormal link set For the service mirror topology pair of the abnormal link, that is, the link whose residual bandwidth resource is negative, find a minimum-cost-based microservice mirror migration scheme, once the topology-dependent pair to be migrated and the number of mirrors are determined, find all containerized mirrors that meet the requirements for the corresponding server nodes, use the first adaptive greedy scheme to migrate the microservice mirror, and update the global deployment scheme to complete the migration of all topology link pairs that do not meet the bandwidth constraint.
[0052] In a third aspect, the present application provides a dynamic microservice migration and routing redirection device based on topology awareness, comprising a memory and a processor, the memory is used to store computer program code and transmit the computer program code to the processor;
[0053] The processor is used to execute the preceding dynamic microservice migration and routing redirection method based on topology awareness according to the instructions in the computer program code.
[0054] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the preceding dynamic microservice migration and routing redirection method based on topology awareness.
[0055] Compared with the prior art, the present application has the following beneficial effects:
[0056] 1、In the dynamic microservice migration and routing redirection method based on topology awareness, all microservice mirrors in the dynamic cloud computing center can automatically select the optimal deployment scheme according to the actual resource situation, and can perform mirror migration based on topology awareness at each time slot, optimize the occupation of bandwidth resources, improve the success rate of request services, further reduce the end-to-end average response time of each microservice-based application, and more fully utilize the fine-grained fragmented resources between server clusters in mirror migration due to the topology relationship level analysis of the request flow, thereby achieving higher resource utilization while reducing the communication load between servers, effectively solving the problems of high data migration cost and network congestion of the service network of the cloud computing center.
[0057] 2, The application is a kind of dynamic micro-service migration and routing redirection system based on topology perception, comprising: a dynamic information acquisition and initialization module: for acquiring cloud computing data center and edge server resource information in dynamic scene, application request stream set and initializing mirror image deployment matrix, and dividing input request stream characteristics based on time slot;Micro-service deployment and routing redirection module: for obtaining a multi-mirror preliminary deployment scheme of micro-service in each time slot divided based on the characteristics of the input request stream by the marginal gain optimization method, and redirecting the node routing scheme based on the proportional probability routing model according to the mirror image deployment matrix of the physical server node;Micro-service migration module: for screening out the topology dependent pair with abnormal bandwidth in the request stream based on the resource cost of the cloud computing data center and the multi-mirror preliminary deployment scheme and the node routing scheme, performing migration operation on the micro-service mirror image on the server node connected by the link with abnormal bandwidth based on topology perception, and obtaining the optimal joint decision of micro-service deployment and request routing of all requests. The system is used to realize the steps of the dynamic micro-service migration and routing redirection method based on topology perception provided in any of the above technical solutions. Therefore, the system also includes all the beneficial effects of the dynamic micro-service migration and routing redirection method based on topology perception provided in any of the above technical solutions, which will not be repeated here.
[0058] 3, The application is a kind of dynamic micro-service migration and routing redirection equipment based on topology perception, comprising a processor and a memory, the memory is used to store computer program code and transmit the computer program code to the processor, and the processor is used to execute the dynamic micro-service migration and routing redirection method based on topology perception provided in any of the above technical solutions according to the instructions in the computer program code. Therefore, the equipment also includes all the beneficial effects of the dynamic micro-service migration and routing redirection method based on topology perception provided in any of the above technical solutions, which will not be repeated here.
[0059] 4, The application is a kind of computer readable storage medium, which stores a computer program, the computer program is executed by a processor to realize the steps of the dynamic micro-service migration and routing redirection method based on topology perception provided in any of the above technical solutions. Therefore, the computer readable storage medium also includes all the beneficial effects of the dynamic micro-service migration and routing redirection method based on topology perception provided in any of the above technical solutions, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0060] Figure 1 is a flowchart of the method of the application.
[0061] Figure 2 is a schematic diagram of the network structure of the cloud computing data center in example 1.
[0062] Figure 3is a step flow chart of S32 in the application.
[0063] Figure 4 is a comparison chart of average latency optimization performance of example 1 and comparative example 1 under different request arrival rates.
[0064] Figure 5 is a comparison chart of average latency optimization performance of example 1 and comparative example 1 under different request stream quantities.
[0065] Figure 6 is a structural schematic diagram of the system of the application.
[0066] Figure 7 is a schematic diagram of the device of the application. DETAILED DESCRIPTION
[0067] The application is further described in detail in the following description and specific embodiments in conjunction with the accompanying drawings.
[0068] Comparative Example 1:
[0069] S1, obtain cloud computing data center and edge server resource information, application request stream set and initialize mirror deployment matrix in dynamic scene, and divide input request stream features based on time slots;
[0070] S2, in each time slot divided, carry out preliminary deployment of microservice multiple mirrors based on simple greedy method, and place microservice mirrors called by user request in the same edge server node as far as possible. In the deployment process, if the total resource demand required by the user request exceeds the server node provided, then the microservice will be split and deployed to the adjacent server node with the shortest communication delay until all microservice mirrors are deployed, and the node routing scheme is redirected based on the mirror deployment matrix of the physical server node according to the proportional probability routing model;
[0071] S3, on the basis of the preliminary deployment scheme, cluster the same type of microservice in a greedy way and allocate them on the same or nearby server to reduce the communication cost between adjacent microservices, and check whether the computing resource and bandwidth constraint is met, if not, randomly select a candidate node in the remaining nodes of the cloud computing data center as a migration target, and continuously migrate the microservice mirror on the current node to the target node until the computing resource and bandwidth constraint is met.
[0072] Example 1:
[0073] Referring to Figure 1 , Figure 2 A dynamic microservice migration and routing redirection method based on topology awareness, comprising the following steps:
[0074] S1: Obtain cloud computing data center and edge server resource information, application request stream set, and initial image deployment matrix in dynamic scenarios, and classify input request stream features based on time slots;
[0075] S11, Obtain cloud computing data network and edge server resource information G = (V, E), where V = {v1, v2, ..., v |V|} represents the set of edge server nodes, and E represents the connection between two edge servers v. i v j The set of links, Indicates v i v j The maximum bandwidth capacity between them, to obtain the set of microservice types. For the i-th type of microservice One core on a server can only containerize one corresponding microservice image. Furthermore, due to the heterogeneity of microservices, the same server core has different processing capabilities for different types of microservice task requests. Unit processing capacity is expressed as…
[0076] Get the maximum computing resource capacity of the physical server The computing resources are represented by the number of server cores. Each core can only be mirrored into one container, and one container can only hold one microservice image. In other words, the core is the smallest resource granularity. This patent only considers single-dimensional resource constraints. Other resource constraints, such as storage, can also be considered, but they will not affect the difficulty of the problem or the solution, because multi-dimensional resource constraints are linear.
[0077] S12: Based on the Alibaba service tracing dataset, a user request flow is constructed. The user request flow consists of a microservice chain. Forty types of microservices with significant differences in characteristics are selected from the Alibaba dataset. Different microservices have different computational resource consumption. A random [100, 1000] request flow is constructed. These request flows arrive at the cloud computing data center with arrival rates of varying magnitudes ([1, 9]) following a Poisson distribution. The user request flow inputs are scheduled into different time slots, with each time slot lasting the same duration. At the beginning of each time slot, the cloud computing data center scheduler deploys and migrates microservice images, obtaining the set of all microservice-based request flows received by the cloud computing data center in different time slots. in, This represents the set of time slots; in time slot t, the microservice-based application request flow is characterized by four parameters, resulting in the time slot-based input request flow characteristics: in λ represents the time when the request flow f(t) of a microservice-based application arrives at the data center. f(t)is the average request arrival rate of the request stream f(t) in real time, is the topology of the microservice request stream f(t), denotes the set of directed dependencies in the microservice request stream f(t), is the maximum request response time threshold of the request stream f(t) predefined according to user requirements, and in addition, C(t) v denotes the current remaining computing resources of the physical server v∈V, denotes the current remaining bandwidth resources of the link .
[0078] The present patent uses M / M / C queuing network to analyze the average response delay and capture the complex microservice dependencies in the instantaneous steady state. In a continuous time period , the requests arriving at the data center are dynamically changing, in order not to lose generality, the user arrival process within the time slot t is modeled as a Poisson process, therefore the request stream of the microservice-based application f(t) is a Poisson stream, and the average request arrival rate is λ f(t) ; in order to meet the real-time user requirements, the microservice orchestration strategy is updated at the beginning of each time slot, and the service mirror migration and probability routing redirection are performed based on the constraint conditions and optimization objectives every interval.
[0079] S13, initialize the microservice mirror deployment matrix Y(t) in the time slot t, denotes the number of microservice mirrors occupying the physical server v∈V, which are used to execute user requests during the time slot t; in order to ensure that the total number of deployed microservice mirrors in each time slot does not exceed the total computing resources of the physical server, the following computing resource constraints are defined:
[0080]
[0081] wherein, is the decision variable, denotes the number of mirrors allocated to the microservice on the server node v∈V in the time slot t.
[0082] S2, in each time slot divided, the multi-mirror preliminary deployment scheme of the microservice is obtained by the marginal gain optimal method based on the characteristics of the input request stream, and the node routing scheme is redirected based on the mirror deployment matrix of the physical server node according to the proportional probability routing model;
[0083] For the dynamic data center G(t) and the time-varying microservice application set F(t), it is necessary to find the optimal multi-mirroring deployment scheme and refined probability routing strategy in each time slot to maximize the utilization of computing resources and the success rate of requests. Due to the high dynamicity and randomness of data centers and user requests, service deployment and request routing must be dynamically performed, and the long-term performance of the optimization system is optimized under the premise of a given long-term cost budget. Specifically, in the face of dynamic user requests, especially when the average request arrival rate and the type and number of microservice applications change, the total number of required microservice images and their corresponding increments are quickly determined, and user demand is met under the premise of minimizing ideal deployment cost.
[0084] S21, a proportional probability routing model is constructed, and in each time slot t, a probability routing scheme is allocated according to the number of microservice images deployed on each physical node:
[0085]
[0086] In the formula, represents the probability that, in the execution process of the request stream f(t), the preceding microservice m i on node v p is routed to the succeeding microservice m j deployed on node v s ;
[0087] S22, in each time slot t, the log information of the cloud data center is counted, the average data transmission delay is calculated, and the topology of all real-time changing microservice-based request streams are sorted in descending order according to the equivalent average request arrival rate, the transmission delay and the tolerance delay are recalculated, and the number of images is allocated to each microservice according to the service intensity;
[0088] The calculation formula of the transmission delay is:
[0089] Where D f(t) represents the average data size under the unit request arrival rate of the request stream f(t); represents the residual bandwidth resource between node v i and node v j ; represents the transmission delay between node v i and node v j ; is the real-time average request arrival rate of microservice m s in the request stream f(t);
[0090] The bandwidth constraint formula is:
[0091] The formula for tolerating latency and mirror updating is:
[0092]
[0093] wherein, represents the number of mirrors allocated to the microservice m j in the request flow f(t); represents the average arrival rate of the microservice m j in the request flow f(t); represents the unit processing capacity of the microservice m j in the request flow f(t); represents the updated request flow tolerance latency, and are the average communication latency and average transmission bandwidth between the server nodes in the data center, respectively;
[0094] S23, for each required microservice, the microservice mirror is distributed and placed on U server nodes in a round-robin manner, U request queues are formed according to the topology order of the request flow, and the probability p u∈U of each request service path is calculated; then, one mirror is added for each microservice under the condition of meeting the time constraint, the probability is updated synchronously, and the time gain is calculated, after the number of mirrors is updated in each round, the response latency is recalculated, the lowest latency is selected as the optimal multi-mirror preliminary deployment scheme with marginal gain, the microservice mirror deployment matrix Y(t) is updated, and the node routing scheme is redirected according to the updated microservice mirror deployment matrix Y(t) by the method described in S21.
[0095] S3, according to the resource cost of the cloud computing data center and the multi-mirror preliminary deployment scheme and the node routing scheme, the topology dependent pairs with abnormal bandwidth in the request flow are screened out, the migration operation is performed on the microservice mirrors on the server nodes connected by the link with abnormal bandwidth based on topology awareness, and the optimal joint decision of microservice deployment and request routing for all requests is obtained.
[0096] Specifically, although the marginal gain scheme can quickly realize microservice deployment and request routing, eliminate the influence of high dynamics and high concurrency requests on the environment, but the deployment scheme based on the lowest response latency may cause the bandwidth constraint to be unable to be met, and the congested physical link in turn affects the total processing time of the request flow, therefore, the migration operation is performed on the server mirrors on the server nodes connected by the link with abnormal bandwidth, the abnormal microservice topology mirror pair is eliminated, the success rate of request service is improved, and the end-to-end average response is further reduced for each microservice-based application.
[0097] S31, first, calculate the resource cost consumption of the data center and then calculate the resource utilization rate of all activated nodes in the initial deployment plan at the current moment. And update the remaining bandwidth resources according to Activate server node V active Sort in ascending order, and at the same time based on Sort the physical link set in ascending order The calculation formula is as follows:
[0098]
[0099] in, C represents the resource utilization rate of node v. v This represents the total computing resources of node v;
[0100] S32, see S32. Figure 3 Filter out the set For abnormal links, initialize an abnormal link set by sorting the negative values in ascending order. For abnormal links (links with negative remaining bandwidth resources) and the service images and topology dependency pairs connected to the server nodes, a microservice image migration scheme based on minimum cost is sought. Once the topology dependency pairs and the number of images to be migrated are determined, a suitable destination server node needs to be found for all the corresponding containerized images. A first-fit greedy scheme is used to migrate the microservice images, and the global deployment scheme is updated to complete the migration of all topology link pairs that do not meet the bandwidth constraints.
[0101] S321 performs request flow-level tracing analysis to achieve fine-grained bandwidth resource optimization. For each link with abnormal bandwidth resources Through probabilistic routing schemes Determine the link All possible request flows f(t) and their corresponding topological dependency pairs (m p ,m s For each topology dependency, the sum of data traffic D(m) is used to calculate the cumulative arrival rate of all included microservice applications. p ,v i ,m s ,v j Based on data communication volume, sort each topology dependency pair in ascending order: increasesort(D(m p ,v i ,m s ,v j ));
[0102] S322, initialize the migration list Migration_List for the microservice image that needs to be migrated, loop each topology dependency pair (m p , s ) to determine the maximum number of migratable images, determine the migration object set, and update the above list; traverse the migration object list, for each microservice m p that needs to be migrated, according to the F(t) topology dependency relationship, count all the predecessor microservice node set p and successor microservice node set of the microservice image m p , and calculate the data traffic set from the predecessor microservice and the data traffic set forwarded to the successor microservice p , respectively, calculate the sum of the number of all predecessor and successor microservice images on each active server node , and sort the active server nodes in descending order according to the weighted sum of the communication delay and the number of images with topology dependency relationship with m p , thereby obtaining the active server node set V active sorted according to the dependency degree for m p ;
[0103] S323, loop each topology dependency pair (m s , p ) to perform migration, where m s represents the source end and m i represents the destination end in the dependency relationship, which is equivalent to determining the migration objects that must be migrated, and the migration method is migration source (priority, low cost) or migration source + destination (lag, high cost), here the on-demand migration of the corresponding microservice image source is considered;
[0104] initialize the pre-migration image number , which represents the actual number of images that need to be migrated out on node v p for microservice m p , initialize , which represents the bandwidth resource consumption that needs to be reduced in this abnormal link, when , continuously increase the pre-migration image number , calculate the data communication change amount ΔD(m i , v s , m j , v p ) that will be generated by migrating this image number, subtract the corresponding data communication change amount ΔD(m i , v s , m j , v p ), and update until not satisfied stop, update the remaining bandwidth resources so far topology-dependent pair (m p ,m s ) to be migrated;
[0105] Once the topology-dependent pair (m p ,m s ) to be migrated and the number of images Need to find the required destination server nodes for all containerized images corresponding to the image objects to be migrated in the topology-dependent pair, and determine the actual migration scheme:
[0106] For the source microservice m p in the topology-dependent pair (m s ,m p ), get the activated server node set V active sorted by dependency degree by the method described in S322;
[0107] First, loop through V active , initialize to represent the number of images to be migrated from node v i to node v j about microservice m p , set the computing resource constraints where and represent the core number and the remaining core number of node v j , respectively; represents the upper limit of the average network resource utilization; when the constraints are met, increase one image to be migrated According to the proportion of the image , calculate the data communication volume of the predecessor microservice and the successor microservice topology-dependent pair and Loop the above process until the number of migrated images causes the bandwidth link communication resources or node computing resources to not meet the requirements, then decrease one image to be migrated , and add the destination node that meets the requirements to the list Migration_Destination_List;
[0108] Next, for each migration target in Migration_Destination_List, calculate the node vi and v j the sum of average response latency of all routing paths of microservice m p on node v migrate one image from node v i to node v j , update the number of microservice m i on node v j and v p , and only perform global proportion probability-based redirection request routing for microservice m p , and calculate the sum of average response latency of all routing paths of microservice m i on node v j and v p calculate the latency gain caused by unit migration image sort the server nodes in Migration_Destination_List in descending order according to the value of , to obtain Decrease_Migration_Destination_List
[0109] S324, migrate microservice images using the first-fit greedy scheme, and update the global deployment scheme and perform redirection routing for the predecessor and successor microservice dependency pairs of m p , which determines the global probability routing scheme according to the resource proportion-aware routing principle
[0110] migrate microservice images using the first-fit greedy scheme, and update the global deployment scheme for each migration target in Decrease_Migration_Destination_List directly perform migration operations and update the pre-migration image number, as follows:
[0111]
[0112] When all the to-be-migrated images are migrated, i.e. , update the image deployment scheme of microservice m p after migration and perform redirection routing for the predecessor and successor microservice dependency pairs of m p , which determines the global probability routing scheme according to the resource proportion routing principle
[0113] S325, if the network resources of the existing active server node are insufficient, and there are still remaining microservice images that have not completed timely migration, select a newly added server node as the destination migration node according to the principles of minimum latency and maximum bandwidth capacity; update the decision variables to be determined and recalculate the bandwidth of each link, update the heterogeneous link set Return to S321 to repeat the above process until there are no abnormal links in the data center system, and the dynamic microservice migration process is completed.
[0114] Compared with the coarse-grained greedy and random-based microservice migration method, the present patent is based on the analysis of the topological relationship level, and quantifies the microservice migration cost in a fine-grained manner, realizes the elimination of abnormal microservice topology dependence pairs with lower cost, improves the success rate of request service, and further optimizes the end-to-end experiment of request flow. Cloud computing data center can be regarded as an autonomous network system, in which node resources and link bandwidth are shared, so congestion control is a crucial factor to maintain the long-term stability of system performance. When the deployment location of the microservice image is changed, the link connecting the predecessor microservice node and the successor microservice node will change. The microservice migration algorithm of the present patent realizes a more fair link allocation scheme through the analysis and sorting of the dependence degree, effectively reduces the degree of network congestion, and improves the quality of user requests.
[0115] Through simulation experiments, the optimization performance of the algorithm of the present patent under different scales is tested. Based on the Alibaba service tracking data set, different user request flows are constructed, and two algorithms are used to test the performance of the control variable. One is the average request processing delay of the cloud computing data center under different sizes of request arrival rate (see Figure 4 ), and the other is the average request processing delay of the cloud computing data center under different sizes of user request quantity (see Figure 5 ).
[0116] Figure 4 and Figure 5 The optimization performance of the two algorithms under different sizes of user requests is shown. It can be seen that the algorithm of the present patent always maintains a lower average request processing delay under different sizes of user requests. This is because the algorithm of the present patent has a more fine-grained modeling and analysis compared with the existing method of microservice deployment and modeling, and as the size of the input request increases, the gap between the optimization effects of the two algorithms gradually increases.
[0117] Example 2:
[0118] See Figure 6The application discloses a topology-aware dynamic micro-service migration and routing redirection system, and relates to the technical field of cloud computing.
[0119] The dynamic information acquisition and initialization module is used for acquiring cloud computing data center and edge server resource information, application request stream sets and initializing mirror image deployment matrices in a dynamic scene, and dividing time slot-based input request stream features.
[0120] Firstly, cloud computing data network and edge server resource information G=(V, E) are acquired, wherein V={v1, v2, …, vn} represents a set of edge server nodes, E represents a set of links connecting two edge server nodes v |V| , v i , v j , and C(v , v i ) represents the maximum bandwidth capacity between v j , v i , a set of micro-service types is acquired For the ith micro-service A core of a server can only containerize one corresponding micro-service mirror image, and due to the heterogeneity of micro-services, the core of the same server has different processing capacities for different types of micro-service task requests, and the unit processing capacity is represented as
[0121] Then, a large number of user request streams are input into different time slots, each time slot has the same duration, and a micro-service mirror image is deployed and migrated by a scheduler of the cloud computing data center at the beginning of each time slot, and all micro-service-based request stream sets accepted by the cloud computing data center in different time slots are acquired Wherein, t represents a set of time slots; in time slot t, micro-service-based application request stream features are characterized by four parameters, and time slot-based input request stream features are obtained: Wherein f(t) represents the time when the micro-service-based application request stream f(t) arrives at the data center, λ f(t) is the real-time average request arrival rate of the request stream f(t), is the topology structure of the micro-service request stream f(t), represents a set of directed dependency relationships in the micro-service request stream f(t), is the maximum request response time threshold of the request stream f(t) defined according to user demand, and C(t) v represents the current remaining computing resource of the physical server v represents the link ei,j the current residual bandwidth resource of ∈E;
[0122] Finally, initialize the microservice image deployment matrix Y(t) in time slot t, denotes the microservice the number of microservice images occupying on physical server v∈V, which are used to execute user requests during time slot t; To ensure that the total number of microservice images deployed in each time slot cannot exceed the total computing resources of the physical server, the following computing resource constraints are defined:
[0123]
[0124] wherein, is a decision variable, denotes the number of images allocated to microservice on server node v∈V in time slot t.
[0125] Microservice deployment and routing redirection module: used to obtain a multi-image preliminary deployment scheme of microservices in each time slot divided based on the characteristics of the input request stream by the marginal gain optimal method, and to redirect the node routing scheme according to the image deployment matrix of the physical server node based on the proportional probability routing model;
[0126] First, construct the proportional probability routing model, and according to the number of microservice images deployed on each physical node, allocate a probability routing scheme within each time slot t:
[0127]
[0128] wherein, denotes the probability of routing from the predecessor microservice m i deployed on node v p to the successor microservice m j deployed on node v s during the execution process of request stream f(t);
[0129] Then, within each time slot t, statistics the log information of the cloud data center, calculates the average data transmission delay, and according to the topology structure of all real-time changing microservice-based request streams sorts all request streams in descending order according to the equivalent average request arrival rate, recalculates the transmission delay and tolerance delay, and allocates the number of images to each microservice according to the service intensity;
[0130] The calculation formula of the transmission delay is:
[0131] wherein, D f(t) denotes the average data size under the unit request arrival rate of request stream f(t); denotes the residual bandwidth resource between node v i and node v j ; denotes the transmission delay between node v i and node v j ; is the real-time average request arrival rate of microservice m s in request flow f(t);
[0132] The bandwidth constraint formula is:
[0133] The formula for tolerating delay and mirror updating is:
[0134]
[0135] wherein, denotes the number of mirrors allocated to microservice m j in request flow f(t); denotes the average arrival rate of microservice m j in request flow f(t); denotes the unit processing capacity of microservice m j in request flow f(t); denotes the updated request flow tolerance delay, and are the average communication delay and average transmission bandwidth between data center server nodes, respectively;
[0136] Finally, for each required microservice, the microservice mirror is distributed and placed on U server nodes in a round-robin manner, U request queues are formed according to the topology order of the request flow, and the probability p u∈U of each request service path is calculated; then, one mirror is added for each microservice under the condition of meeting the time constraint, the probability is updated synchronously, and the time gain is calculated, after each round of mirror number updating, the response delay is recalculated, the lowest delay is selected as the marginal gain optimal multi-mirror preliminary deployment scheme, the microservice mirror deployment matrix Y(t) is updated, and the node routing scheme is redirected according to the updated microservice mirror deployment matrix Y(t) by the method described in the proportional probability routing model.
[0137] Microservice migration module: used for screening the topology dependent pairs with abnormal bandwidth in the request flow according to the resource cost of the cloud computing data center and the multi-mirror preliminary deployment scheme and the node routing scheme, performing migration operation on the microservice mirror on the server node connected by the link with abnormal bandwidth based on topology awareness, and obtaining the optimal joint decision of microservice deployment and request routing of all requests.
[0138] The microservice migration module comprises a resource perception unit and an image migration unit.
[0139] The resource perception unit is configured to first count resource cost consumption of the data center, calculate resource utilization of all active nodes at the current time in the preliminary deployment scheme and update the remaining bandwidth resources According to active server nodes V active are sorted in ascending order, and the physical link set is sorted in ascending order according to The calculation formula is as follows:
[0140]
[0141] wherein, represents the resource utilization of node v, C v represents the total computing resources of node v;
[0142] The image migration unit is configured to screen out abnormal links in the set , sort the negative part in ascending order to initialize an abnormal link set For the service image topology pair of the server node connected by the abnormal link, i.e., the link with negative remaining bandwidth resources, find a microservice image migration scheme based on the minimum cost, once the topology dependent pair to be migrated and the number of images are determined, find all containerized images that meet the requirements for the corresponding server nodes, migrate the microservice images by using the first adaptive greedy scheme, and update the global deployment scheme to complete the migration of all topology link pairs that do not meet the bandwidth constraints.
[0143] a, request flow level tracking analysis is performed, and when For each link with abnormal bandwidth resources, i.e., all possible request flows f(t) through the link and the corresponding topology dependent pair (m p ,m s ) are determined through a probability routing scheme For each topology dependent pair, the sum D(m p ,v i ,m s ,v j ) of the cumulative arrival rate data traffic of all microservice applications contained therein is calculated, and each topology dependent pair is sorted in ascending order according to the data traffic p ,v i ,m s ,v j ).
[0144] b, initialize Migration_List for the microservice images that need to be migrated, loop each topology dependent pair (m p ,m s ) to determine the maximum number of migratable images and determine the migration object set, update the above list; traverse the Migration_List, for each microservice m p that needs to be migrated, according to the F(t) topology dependency relationship, count all the predecessor microservice node set p and successor microservice node set that pass through the microservice image m p , and calculate the data traffic set from the predecessor microservice and the data traffic set forwarded to the successor microservice p respectively, calculate the sum of the number of all predecessor and successor microservice images on each active server node , and arrange the server nodes in descending order according to the weighted sum of the communication delay and the number of images that have a topology dependency relationship with m p , thereby obtaining the active server node set V active sorted according to the dependency degree for m p ;
[0145] c, loop each topology dependent pair (m s ,m p ) to perform migration, where m s represents the source end and m i represents the destination end in the dependency relationship, which is equivalent to determining the migration objects that must be migrated, and the migration method is migration source (priority, low cost) or migration source + destination (lag, high cost), where on-demand migration of the corresponding microservice image source is considered;
[0146] initialize the pre-migration image number , which represents the actual number of images that need to be migrated out on the node v p for the microservice m p , initialize , which represents the bandwidth resource consumption that needs to be reduced in this abnormal link, and constantly increase the pre-migration image number when ; calculate the data communication change amount ΔD(m s ,v j ,m p ,v i ) that will be generated by migrating the image number, and subtract the corresponding data communication change amount ΔD(m s ,v j ,m p ,vj ), update until not satisfied stop, update the remaining bandwidth resources so far for the topology-dependent pair (m p , m s ) to be migrated, the number of images to be migrated;
[0147] Once the topology-dependent pair (m p , m s ) to be migrated and the number of images need to find the required destination server nodes for all containerized images corresponding to the image objects to be migrated in the topology-dependent pair, and determine the actual migration scheme:
[0148] For the source microservice m p in the topology-dependent pair (m s , m p ), obtain the activated server node set V active sorted by dependency degree by the method described in step b;
[0149] First, loop through V active , initialize denotes the number of images to be migrated from node v i to node v j about microservice m p , set the computing resource constraints where and represent the number of cores and the remaining cores of node v j , respectively; denotes the upper limit of the average network resource utilization; when the constraints are satisfied, increase one image to be migrated According to the proportion of the image , calculate the data communication volume of the predecessor microservice and the successor microservice topology-dependent pair and Loop the above process until the number of images to be migrated causes the bandwidth link communication resources or node computing resources to be unsatisfied, then decrease the number of images to be migrated , and add the destination node that meets the requirements to the list Migration_Destination_List;
[0150] Next, for each migration target in Migration_Destination_List Compute the sum of average response latency of all routing paths of microservice m i on nodes v j p Migrate mirrors from node v i to node v j , update the number of microservice m i on nodes v j and v p , and only perform global proportion probability-based redirection request routing on microservice m p , and compute the sum of average response latency of all routing paths of microservice m i on nodes v j and v j p Compute the latency gain caused by unit migration mirror According to the value of , sort the server nodes in Migration_Destination_List in descending order to obtain Decrease_Migration_Destination_List;
[0151] d, migrate microservice mirrors using the first-fit greedy scheme, and update the global deployment scheme and perform redirection routing on the predecessor and successor microservice dependency pairs of m p , which determines the global probability routing scheme according to the resource proportion-aware routing principle
[0152] Migrate microservice mirrors using the first-fit greedy scheme, and update the global deployment scheme For each migration target in Decrease_Migration_Destination_List Directly perform migration operations and update the pre-migration mirror number, as follows:
[0153]
[0154] After all the to-be-migrated mirrors are migrated, i.e. , update the mirror deployment scheme of microservice m p after migration and perform redirection routing on the predecessor and successor microservice dependency pairs of m p , which determines the global probability routing scheme according to the resource proportion-aware routing principle
[0155] e. If the network resources of the existing active server nodes are insufficient, and there are still remaining microservice images that have not completed timely migration, select a newly added server node as the destination migration node according to the principle of minimum latency and maximum bandwidth capacity; update the decision variables to be determined and recalculate the bandwidth of each link, and update the heterogeneous link set Return to step a to repeat the above process until there are no abnormal links in the data center system, and the dynamic microservice migration process is completed.
[0156] Embodiment 3:
[0157] Referring to Figure 7 A dynamic microservice migration and routing redirection device based on topology awareness, comprising a memory and a processor, the memory is used to store computer program code and transmit the computer program code to the processor;
[0158] The processor is used to execute the dynamic microservice migration and routing redirection method based on topology awareness according to the instructions in the computer program code.
[0159] Embodiment 4:
[0160] A computer readable storage medium, the computer readable storage medium has a computer program stored thereon, the computer program is executed by a processor to realize the dynamic microservice migration and routing redirection method based on topology awareness of the embodiment 1.
[0161] Generally, the computer instructions used to implement the method of the present application can be carried by any combination of one or more computer readable storage media. Non-transitory computer readable storage media can include any computer readable medium except a signal propagating in a transitory manner.
[0162] The computer readable storage medium, for example, can be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of computer readable storage media include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.
[0163] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an
[0164] Although the embodiments of the present application have been shown and described above, it should be understood by those skilled in the art that the above embodiments are exemplary, and cannot be interpreted as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A topology-aware dynamic microservice migration and route redirection method, characterized in that, Includes the following steps: S1, obtain cloud computing data center and edge server resource information, application request flow set and initial image deployment matrix in dynamic scenarios, and divide the input request flow characteristics based on time slots, including: the time when the request flow of microservice-based applications arrives at the data center, the real-time average request arrival rate of the request flow, the topology of the microservice request flow, and the maximum request response time threshold predefined by the user according to the user's needs. S2, In each time slot, based on the characteristics of the input request flow, a preliminary multi-image deployment scheme for microservices is obtained through the marginal gain optimization method. Based on the proportional probability routing model, the node routing scheme is redirected according to the image deployment matrix of the physical server nodes. The proportional probability routing model represents the probability model of routing from the predecessor microservice deployed on the current node to the successor microservice deployed on another node during the execution of the request flow. S3. Based on the resource cost of the cloud computing data center and the preliminary multi-image deployment scheme and node routing scheme, filter out the topology dependency pairs with abnormal bandwidth in the request flow, and perform migration operations on the microservice images on the server nodes connected by the links with abnormal bandwidth based on topology awareness, and obtain the joint decision of optimal microservice deployment and request routing for all requests. Topology awareness refers to filtering out the service images and topology dependency pairs deployed on each server node in an abnormal link, i.e., a link with negative remaining bandwidth resources; the topology dependency pair represents the topology pair of directed dependencies from the source to the target in the microservice request flow.
2. The method for dynamic microservice migration and route redirection based on topology awareness according to claim 1, characterized in that, S1 includes, S11, Obtain cloud computing data network and edge server resource information G = (V, E), where V = {v1, v2, ..., v |V| } represents the set of edge server nodes, and E represents the connection between two edge servers v. i v j The set of links, Indicates v i ,v j The maximum bandwidth capacity between them, to obtain the set of microservice types. For the i-th type of microservice One core on a server can only containerize one corresponding microservice image. Furthermore, due to the heterogeneity of microservices, the same server core has different processing capabilities for different types of microservice task requests. Unit processing capacity is expressed as… S12, the user request stream input is planned into different time slots, with each time slot lasting the same duration. At the beginning of each time slot, the scheduler of the cloud computing data center deploys and migrates microservice images, obtaining the set F(t) = {f1(t), f2(t), ..., f...} of all microservice-based request streams received by the cloud computing data center in different time slots. |F(t)| (t)}, in, This represents the set of time slots; in time slot t, the microservice-based application request flow is characterized by four parameters, resulting in the time slot-based input request flow characteristics: in λ represents the time when the request flow f(t) of a microservice-based application arrives at the data center. f(t) It is the real-time average request arrival rate of the request stream f(t). It is the topology of the microservice request flow f(t). Let f(t) represent the set of directed dependencies in the microservice request flow. It is the maximum request response time threshold predefined by the user's needs for the request flow f(t). Additionally, C(t) is used. v This represents the current remaining computing resources of physical servers v∈V. Indicates link The current remaining bandwidth resources; S13, Initialize the microservice image deployment matrix Y(t) under time slot t. microservices The number of microservice images occupied on physical servers v∈V, wherein the microservice images are used to execute user requests during time slot t; to ensure that the total number of microservice images deployed in each time slot does not exceed the total computing resources of the physical servers, the following computing resource constraints are defined: In the formula, As decision variables, This indicates that time slot t is assigned to a microservice on server node v∈V. The number of mirrors.
3. The method for dynamic microservice migration and route redirection based on topology awareness according to claim 1, characterized in that, S2 includes, S21, Construct a proportional probabilistic routing model, and within each time slot t, allocate probabilistic routing schemes based on the number of microservice images deployed on each physical node: In the formula, This indicates that during the execution of the request flow f(t), data is generated from the node deployed on node v. i The predecessor microservice m p Routing to the node deployed on node v j Subsequent microservices on m s The probability of; S22, within each time slot t, collect log information from the cloud data center, calculate the average data transmission latency, and analyze the topology of all real-time changing microservice-based request flows. All request streams are sorted in descending order based on the equivalent average request arrival rate, the transmission latency and tolerance latency are recalculated, and the number of images is allocated to each microservice based on the service intensity. The formula for calculating transmission delay is: Among them, D f(t) This represents the average data size per unit request arrival rate for the request stream f(t); Represents node v i and node v j The remaining bandwidth resources between; Represents node v i and node v j Transmission delay between; It is the microservice m in the request flow f(t) s Real-time average request delivery rate; The bandwidth constraint formula is: The formulas for tolerance latency and mirror update are: in, This represents the microservice m assigned to the request stream f(t). j The number of mirrors; In the request flow f(t), the microservice m represents the microservice m. j Average arrival rate; In the request flow f(t), the microservice m represents the microservice m. j Unit processing capacity; This indicates the latency tolerance of the updated request stream. and These represent the average communication latency and average transmission bandwidth between data center server nodes, respectively. S23, for each required microservice, a round-robin placement method is used to distribute the microservice images across U server nodes. Based on the topological order of the request flow, U request queues are formed, and the probability p of each request service path is calculated. u∈U Next, under the condition of satisfying the time constraint, add an image for each microservice, update the probability synchronously and calculate the time gain. After each round of image number update, recalculate the response latency, select the lowest latency as the initial multi-image deployment scheme with the best marginal gain, update the microservice image deployment matrix Y(t), and at the same time, according to the updated microservice image deployment matrix Y(t), redirect the node routing scheme through the method described in S21.
4. The method for dynamic microservice migration and route redirection based on topology awareness according to claim 1, characterized in that, S3 includes, S31, first, calculate the resource cost consumption of the data center and then calculate the resource utilization rate of all activated nodes in the initial deployment plan at the current moment. And update the remaining bandwidth resources according to Activate server node V active Sort in ascending order, and at the same time based on Sort the physical link set in ascending order The calculation formula is as follows: in, C represents the resource utilization rate of node v. v This represents the total computing resources of node v; S32, filter out the set For abnormal links, initialize an abnormal link set by sorting the negative values in ascending order. For abnormal links (links with negative remaining bandwidth resources) and the service images and topology dependency pairs connected to the server nodes, a microservice image migration scheme based on minimum cost is sought. Once the topology dependency pairs and the number of images to be migrated are determined, a suitable destination server node needs to be found for all the corresponding containerized images. A first-fit greedy scheme is used to migrate the microservice images, and the global deployment scheme is updated to complete the migration of all topology link pairs that do not meet the bandwidth constraints.
5. The topology-aware dynamic microservice migration and route redirection method according to claim 4, characterized in that, S3 includes, S321 performs request flow-level tracing analysis to optimize bandwidth resources. For each link with abnormal bandwidth resources Through probabilistic routing schemes Determine the link All possible request flows f(t) and their corresponding topological dependency pairs (m p ,m s For each topology dependency, the sum of data traffic D(m) is used to calculate the cumulative arrival rate of all included microservice applications. p ,v i ,m s ,v j Based on data communication volume, sort each topology dependency pair in ascending order: increasesort(D(m p ,v i ,m s ,v j )), This shows a connection between two edge servers v i v j The link; S322, initialize the migration list Migration_List for the microservice images that need to be migrated, and loop through each topology dependency pair (m p ,m s Determine the maximum number of migrated images and the set of objects to migrate, and update the list above. Iterate through the list of objects to be migrated, and for each microservice m that needs to be migrated... p Based on the topological dependencies of F(t), the statistics show that the route passes through the microservice image m. p All predecessor microservice nodes and subsequent microservice node sets And calculate m respectively p Data communication volume from predecessor microservices and the set of data communication volumes forwarded to subsequent microservices Calculate the sum of the number of all predecessor and successor microservice images on each active server node. According to communication delay and m p The weighted sum of the number of mirrors with topological dependencies, sorted in descending order of server nodes, yields the result for m. p The set of active server nodes V sorted by dependency level active ; S323, loop through each topological dependency pair (m p ,m s Migration is performed in the dependency relationship m p The source end represented by m s Representing the destination, this is equivalent to determining the migration objects that must be migrated. The migration methods include migration source (preferred, low cost) or migration source + destination (lagging, high cost). Here, we consider the on-demand migration of the corresponding microservice image source. Initialize the number of pre-migration images Represents node v i The above is about microservices m p The actual number of images that need to be migrated out, initialization This indicates the bandwidth resource consumption that needs to be reduced in this abnormal link. The number of pre-migrated images is continuously increased. Calculate the change in data communication ΔD(m) that will result from migrating this number of mirrors. p ,v i ,m s ,v j Subtract the corresponding change in data communication ΔD(m) p ,v i ,m s ,v j ),renew Until not satisfied Stop at this time and update the calculation of remaining bandwidth resources. At this point For topologically dependent pairs (m p ,m s The number of images to be migrated; Once the topological dependency pairs to be migrated (m) are determined p ,m s ) and number of mirrors It is necessary to find suitable destination server nodes for all containerized images, and determine the actual migration plan for the image objects to be migrated based on the aforementioned topology dependency pairs: For topological dependency pairs (m) p ,m s The source-side microservice m in ) p The set of active server nodes V, sorted by dependency, is obtained by the method described in S322. active ; First, iterate through V. active ,initialization Indicates from node v i to node v j Regarding microservices m p The actual number of images to be migrated, and the setting of computing resource constraints. in and They represent nodes v respectively j The number of cores and the number of remaining cores; This represents the upper limit of average network resource utilization; when the constraint is met, an additional mirror to be migrated is added. According to the mirror ratio Computational predecessor microservices and subsequent microservices Topology-dependent changes in data communication volume and Repeat the above process until the number of migrated mirrors causes insufficient bandwidth link communication resources or node computing resources, then reduce the number of mirrors to be migrated by one. The number of mirrors, and the destination nodes that meet the requirements. Add it to the Migration_Destination_List; Next, for each migration destination in the Migration_Destination_List Calculate the path through node v i and v j microservices on m p The sum of the average response times of all routing paths Will A mirror image from node v i Migrate to node v j Update node v i and v j microservices m p The number, and only in microservice m p Perform global proportional probability-based redirection request routing and calculate the path taken through node v after migration. i and v j microservices on m p The sum of the average response times of all routing paths Calculate the latency gain caused by unit migration mirroring. according to The value is used to sort the server nodes in Migration_Destination_List in descending order to obtain Decrease_Migration_Destination_List; S324 uses a first-fit greedy algorithm to migrate microservice images and updates the global deployment scheme. And for m p The system redirects predecessor and successor microservice dependencies by adhering to resource-proportion-aware routing principles to determine a global probabilistic routing scheme. Migrate microservice images using a first-fit greedy approach and update the global deployment scheme. For each migration destination in Decrease_Migration_Destination_List Perform the migration operation directly and update the number of pre-migration images, using the following formula: Once all images to be migrated have been migrated, Afterwards, update the migrated microservice m. p Image deployment solution And for m p Redirecting routes are performed on predecessor and successor microservice dependency pairs, and a global probabilistic routing scheme is determined based on the routing principle of resource proportion. S325. If the network resources of the existing active server node are insufficient and there are still remaining microservice images that have not been migrated in a timely manner, select the newly added server node as the destination migration node based on the principle of minimum latency and maximum bandwidth capacity. Update the decision variables that need to be determined It also recalculates the bandwidth of each link and updates the heterogeneous link set. Return to S321 and repeat the above process until there are no abnormal links in the data center system, thus completing the entire dynamic microservice migration process.
6. A topology-aware dynamic microservice migration and route redirection system, characterized in that, The system is used to execute the topology-aware dynamic microservice migration and route redirection method as described in any one of claims 1 to 5, specifically including: a dynamic information acquisition and initialization module, a microservice deployment and route redirection module, and a microservice migration module; The dynamic information acquisition and initialization module is used to acquire cloud computing data center and edge server resource information, application request stream sets, and initialize image deployment matrix in dynamic scenarios, and to classify the input request stream characteristics based on time slots. The microservice deployment and route redirection module is used to obtain a preliminary multi-image deployment scheme for microservices in each time slot based on the characteristics of the input request flow and in a marginal gain-optimal manner, and to redirect the node routing scheme based on the proportional probability routing model and the image deployment matrix of the physical server nodes. The microservice migration module is used to filter out topology dependency pairs with abnormal bandwidth in the request flow based on the resource cost of the cloud computing data center and the initial deployment scheme and node routing scheme of the multi-image system. Based on topology awareness, it performs migration operations on the microservice images on the server nodes connected by the links with abnormal bandwidth, and obtains a joint decision on the optimal microservice deployment and request routing for all requests.
7. A topology-aware dynamic microservice migration and route redirection system according to claim 6, characterized in that, The microservice migration module includes: a resource awareness unit and an image migration unit; The resource awareness unit is used to: first, collect data on the resource cost consumption of the data center, and then calculate the resource utilization rate of all active nodes in the initial deployment plan at the current moment. And update the remaining bandwidth resources according to Activate server node V active Sort in ascending order, and at the same time based on Sort the physical link set in ascending order The calculation formula is as follows: in, C represents the resource utilization rate of node v. v This represents the total computing resources of node v; The mirror migration unit is used to: filter out items from the collection. For abnormal links, initialize an abnormal link set by sorting the negative values in ascending order. For service image topology pairs connected to server nodes on abnormal links (links with negative remaining bandwidth resources), a microservice image migration scheme based on minimum cost is sought. Once the topology dependency pairs and the number of images to be migrated are determined, a suitable destination server node needs to be found for all corresponding containerized images. A first-fit greedy scheme is used to migrate the microservice images, and the global deployment scheme is updated to complete the migration of all topology link pairs that do not meet bandwidth constraints.
8. A topology-aware dynamic microservice migration and route redirection device, characterized in that: It includes a memory and a processor, wherein the memory is used to store computer program code and transfer the computer program code to the processor; The processor is configured to execute the topology-aware dynamic microservice migration and route redirection method as described in any one of claims 1 to 5, according to instructions in the computer program code.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the topology-aware dynamic microservice migration and route redirection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Mobile edge computing-oriented multi-instance micro-service migration method
CN113037805A
Heterogeneous multi-edge cloud collaborative micro-service deployment and routing joint optimization method and system
CN116915686A