A fast and efficient micro-service migration method in an intelligent manufacturing scene
By constructing a microservice migration strategy in a smart manufacturing scenario and optimizing microservice migration using variable dimensionality reduction and convex approximation methods, the problems of rapid decision-making and dependency relationships are solved, achieving efficient microservice migration and production continuity.
Patent Information
- Application Number
- CN202311286758.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-07
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-10-07
AI Technical Summary
In smart manufacturing scenarios, existing technologies struggle to consider the dependencies between microservices while making rapid decisions, reducing communication and image retrieval costs, minimizing frequent service interruptions, and improving the continuity of microservices.
By modeling scenarios, constructing constraints, and optimizing problem-solving, and by using variable dimensionality reduction, penalty functions, and successive convex approximation methods, a microservice migration strategy is constructed to reduce the number of microservice migrations and the frequency of interruptions, and to optimize resource sharing and communication overhead.
It enables rapid and efficient microservice migration in dynamic production environments, reduces communication and image retrieval costs, minimizes service interruptions, and improves production continuity and efficiency.
Smart Images

Figure CN117311940B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge computing microservices, and more particularly to a fast and efficient microservice migration method in intelligent manufacturing scenarios. Background Technology
[0002] With the development of edge computing, microservice architecture has been widely applied in smart manufacturing. By integrating multiple microservices, production tasks can be completed collaboratively. Meanwhile, the production environment of smart factories is becoming increasingly complex and dynamic, with frequent changes in production equipment and orders. Due to the limited coverage of edge servers, if production equipment is in motion, data interaction delays caused by multi-hop transmission can degrade service quality. Therefore, microservice migration is necessary to ensure production quality and service efficiency, thereby adapting to the needs of dynamic production.
[0003] Microservice migration refers to the movement of microservice images and runtime data between edge servers, thereby reducing the overhead between microservices and the devices requesting services and improving production efficiency. However, the decision-making process for microservice migration faces many challenges. First, complex dependencies exist between microservices, such as layered and chained structures. An industrial application typically consists of multiple microservices, which can be called a microservice chain. Microservices in the chain provide industrial services through communication, incurring communication costs. Container-based microservices also have a layered structure, where multiple image layers form a microservice image, and microservices on the same server can share the same layers when the image is pulled. These dependencies between microservices lead to coupling and nonlinearity between decision variables, making it difficult to quickly determine the optimal migration strategy. Second, large-scale production involves a large number of edge servers, production equipment, and microservices. The resulting high-dimensional decision variables significantly increase the computational complexity of the problem. Migration strategies based on global optimal solutions require a long time to reach a migration decision, making it difficult to meet the real-time requirements of dynamic production processes. Third, microservice migration can cause microservice interruptions, so careful selection of microservices to be migrated is necessary to minimize production downtime caused by interruptions.
[0004] Existing research rarely considers complex dependencies in dynamic environments for microservice migration. Current findings primarily focus on providing feasible microservice migration strategies for mobility, or on deploying or sharing microservices with complex dependencies. A stable, efficient, and low-cost migration solution for complex dependencies is still lacking in the field of microservice migration.
[0005] Therefore, a reasonable and efficient microservice migration algorithm is needed to address the following issues: 1) How to consider the dependencies between microservices while making rapid decisions and reducing the communication and image retrieval costs of microservices? 2) How to quickly obtain migration strategies that meet production needs in large-scale production scenarios? 3) How to reduce frequent service interruptions and increase the continuity of microservices?
[0006] Therefore, those skilled in the art are dedicated to developing a fast and efficient microservice migration method for smart manufacturing scenarios. Summary of the Invention
[0007] In view of the above-mentioned deficiencies of the prior art, the technical problem to be solved by the present invention is how to consider the dependencies between microservices while making rapid decisions, reduce the communication and image retrieval costs of microservices, reduce frequent service interruptions, and increase the continuity of microservices.
[0008] To achieve the above objectives, this invention provides a fast and efficient microservice migration method in intelligent manufacturing scenarios, characterized by the following steps:
[0009] S101: Scene Modeling: Modeling the edge servers, production equipment, applications, and microservices in the intelligent manufacturing scene;
[0010] S103: Constraint Construction: Construct constraints for the deployment and migration of microservices in the intelligent manufacturing scenario. The constraints include microservice uniqueness constraints, computing and storage resource constraints, and initial deployment location constraints for microservices.
[0011] S105: Optimization Problem Construction: During the microservice migration process, calculate the migration cost of sending the microservice's runtime data from the original server to the new server. The objective of the optimization problem is to minimize the total migration cost of the microservice.
[0012] S107: Optimization problem solving: The optimization problem is solved more quickly by using variable dimensionality reduction, penalty function, parameter vectorization and successive convex approximation methods to obtain the migration strategy of the microservice;
[0013] S109: Migrate the microservice according to the microservice migration strategy.
[0014] Furthermore, the scene modeling includes:
[0015] Each of the edge servers is connected to multiple of the production devices, and the different edge servers are connected via a wired multi-hop network with sufficient bandwidth between them;
[0016] Each of the production devices is covered by only one edge server at a time, each production device is under the network coverage of one edge server, and each production device will generate a request for a production application, which will be deployed on the appropriate edge server and provided with services.
[0017] Each of the applications consists of multiple microservices, and different applications can use the same microservice image layer;
[0018] Each microservice occupies a certain amount of storage space and computing resources. Multiple identical microservice image layers can share the storage space on the same edge server, but cannot share the computing resources on the same edge server.
[0019] Furthermore, the microservice uniqueness constraint includes: the microservice corresponding to the application requested by each production device exists in only one edge server at any given time;
[0020] The computing and storage resource constraints include: the sum of the computing resources already occupied in the edge server to be migrated and the computing resources required by the microservice cannot exceed the total computing resources on the edge server; the sum of the storage resources already occupied in the edge server to be migrated and the layer size that the microservice needs to download cannot exceed the total computing resources on the edge server; and the same image layer can share storage space.
[0021] The initial deployment location constraint for the microservice is: the initial deployment location of the microservice is the edge server connected to the production device that initiated the application request.
[0022] Furthermore, the total cost of the microservice migration includes: service interruption cost, image retrieval cost, and communication overhead difference, namely:
[0023]
[0024] The service interruption cost is as follows:
[0025]
[0026] The cost of pulling the image is:
[0027]
[0028] The difference in communication overhead is:
[0029]
[0030]
[0031]
[0032] In the formula, E m,k (t) represents the communication overhead before the migration. The communication overhead after migration is given, m represents the production equipment, k represents the application, t represents a certain moment, i and i' represent microservices, and the set is given. Let θ1, θ2, θ3 be the set of microservices used by application k, θ1, θ2, θ3 be the weight coefficients, and n, n' be the edge servers. It is a set of N edge servers. For ms m,k,i Deployment status on server n at time t. This represents the initial microservice deployment on server n at time t, in milliseconds. m,k,i For device m, the microservice i, ms in application k requests m,k,0 For initial microservices, I i,n→n′ For the downtime cost of migrating microservice i from server n to server n', l i Storage space occupied by microservice i The bandwidth between the cloud server and the edge server n, and the set of M production devices. Set A m (t) represents the set of applications requested by production device m, where ∈ is a very small positive number. For the set of microservices of application k Data transfer volume between microservices i and j in D nn′ Let n be the number of hops between edge servers n and n'.
[0033] Furthermore, based on the constraints established in step S103 and the total cost of microservice migration, the objective function of the optimization problem is constructed as follows:
[0034]
[0035] st
[0036]
[0037]
[0038]
[0039]
[0040]
[0041] Among them, u iThe computing resources used by microservice i For the computing resources of edge server n, For the storage of edge server n, set The set of production devices covered by edge server n*.
[0042] Furthermore, in step S107, the variable dimensionality reduction partitions the application and the microservices and assigns them to different sets, thereby decomposing the original optimization problem into an ordered migration problem of individual microservices:
[0043]
[0044] The division of the application and the microservice is performed using the following formula:
[0045]
[0046] If C m,k If (t)>0, then the production equipment m enters the equipment set. The application k enters the set For the set and The parameters in the text correspond to the production equipment and the application program, which are divided according to their actual movement sequence. app
[0047] Furthermore, in step S107, the penalty function makes the relaxed solution of the variables closer to the true optimal solution. The penalty function is:
[0048]
[0049] Then the problem P1 is transformed into:
[0050]
[0051] st
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058] Furthermore, problem P2 is a non-convex quadratic programming problem. Specifically, problem P2 is vectorized into parameters as follows:
[0059] For any m and k,
[0060]
[0061]
[0062]
[0063] in,
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073] Among them, S k for The largest element in the matrix, where I is the identity matrix, 1 1×N It is a 1-row, N-column vector in which all elements are 1.
[0074] Furthermore, problem P2 is transformed into:
[0075]
[0076] The constraints of problem P3 are the same as those of problem P2.
[0077] Applying a successive convex approximation transformation to problem P3, problem P3 becomes:
[0078]
[0079] st
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086] in,
[0087]
[0088] Its largest eigenvalue is λ max R = Q k (t)+λ max I, Y = λ max I, where I is the identity matrix.
[0089] Furthermore, the problem P4 is solved using a successive convex approximation method, and the solution process includes the following steps:
[0090] S1: Choose any feasible solution x 0 Choose a step size α∈(0,1] and set r=0;
[0091] S2: Another y r+1 =arg min F(x) r Use a solver that supports solving convex quadratic programming problems;
[0092] S3: Another x r+1 =x r +α(y r+1 -x r );
[0093] S4: Replace r with r+1;
[0094] S5: If ||x r -x r-1 If ||≤∈, then the solution process ends and the migration strategy is obtained; otherwise, repeat steps S2 to S4 to complete the solution process and obtain the migration strategy.
[0095] In a preferred embodiment of the present invention, the present invention has the following advantages over the prior art:
[0096] 1. This invention utilizes the transformation of the original complex optimization problem to achieve rapid solution. For the given non-convex integer quadratic programming problem, it uses variable dimensionality reduction, penalty function and successive convex approximation method to accelerate the solution and achieve rapid deployment decision, which can adapt to the rapid changes in dynamic processes.
[0097] 2. This invention utilizes variable dimensionality reduction to migrate only the affected microservices, reducing the number of microservice migrations and thus reducing microservice interruptions during each migration, thereby improving production continuity.
[0098] The following will further explain the concept, specific structure, and technical effects of the present invention in conjunction with the accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Attached Figure Description
[0099] Figure 1 This is a flowchart illustrating a preferred embodiment of the present invention;
[0100] Figure 2 This is a schematic diagram of the overall process of a migration scheme according to a preferred embodiment of the present invention. Detailed Implementation
[0101] The following description, with reference to the accompanying drawings, illustrates several preferred embodiments of the present invention to make its technical content clearer and easier to understand. The present invention can be embodied in many different forms, and the scope of protection of the present invention is not limited to the embodiments mentioned herein.
[0102] In the accompanying drawings, components with the same structure are indicated by the same numerical designation, and components with similar structures or functions are indicated by similar numerical designations. The dimensions and thicknesses of each component shown in the drawings are arbitrary, and the present invention does not limit the dimensions and thicknesses of each component. To make the illustrations clearer, the thickness of some components has been appropriately exaggerated in the drawings.
[0103] like Figure 1 As shown in the embodiments of the present invention, a fast and efficient microservice migration method in intelligent manufacturing scenarios can achieve on-demand and efficient migration of microservices for dynamic and large-scale production scenarios. The method includes the following steps:
[0104] S101: Scene Modeling: Modeling edge servers, production equipment, applications, and microservices in smart manufacturing scenarios.
[0105] Scenario modeling in smart manufacturing includes:
[0106] Edge server modeling: Each edge server is connected to multiple production devices, and these different edge servers are connected through a wired multi-hop network with sufficient bandwidth between them;
[0107] Production equipment modeling: Each production equipment is covered by only one edge server at the same time, each production equipment is under the network coverage of one edge server, each production equipment will generate a request for the production application, and the requested application will be deployed on the appropriate edge server and provide services.
[0108] Application modeling: Each application consists of multiple microservices, and different applications can use the same microservice image layer;
[0109] Microservice modeling: Each microservice occupies a certain amount of storage space and computing resources. Multiple identical microservice image layers can share the storage space on the same edge server, but cannot share the computing resources on the same edge server.
[0110] S103: Constraint Construction: Construct constraints for the deployment and migration of microservices in intelligent manufacturing scenarios. Constraints include microservice uniqueness constraints, computing and storage resource constraints, and initial deployment location constraints for microservices.
[0111] in:
[0112] The microservice uniqueness constraint includes: the microservice corresponding to the application requested by each production device exists in only one edge server at any given time;
[0113] The constraints on computing and storage resources include: the sum of the computing resources already occupied in the edge server to be migrated and the computing resources required by the microservice cannot exceed the total computing resources on the edge server; the sum of the storage resources already occupied in the edge server to be migrated and the layer size that the microservice needs to download cannot exceed the total computing resources on the edge server; and the same image layer can share storage space.
[0114] Initial deployment location constraints for microservices: The initial deployment location for microservices is the edge server connected to the production device that initiated the application request.
[0115] S105: Optimization Problem Construction: During the microservice migration process, calculate the migration cost of sending the microservice's runtime data from the original server to the new server. The goal of this optimization problem is to minimize the total cost of microservice migration.
[0116] The total cost of the microservice migration mentioned above includes: service interruption cost, image retrieval cost, and communication overhead difference, namely:
[0117]
[0118] The service interruption cost is as follows:
[0119]
[0120] The cost of mirror fetching is:
[0121]
[0122] The difference in communication overhead is as follows:
[0123]
[0124]
[0125]
[0126] In the formula, E m,k (t) represents the communication overhead before the migration. The communication overhead after migration is given, m represents the production equipment, k represents the application, t represents a certain moment, i and i' represent microservices, and the set is given. Let θ1, θ2, θ3 be the set of microservices used by application k, θ1, θ2, θ3 be the weight coefficients, and n, n' be the edge servers. It is a set of N edge servers. For ms m,k,i Deployment status on server n at time t. This represents the initial microservice deployment on server n at time t, in milliseconds. m,k,i For device m, the microservice i, ms in application k requests m,k,0 For initial microservices, I i,n→n′ For the downtime cost of migrating microservice i from server n to server n', l i The storage space occupied by microservice i The bandwidth between the cloud server and the edge server n, and the set of M production devices. Set A m (t) represents the set of applications requested by production device m, where ∈ is a very small positive number. For the set of microservices of application k Data transfer volume between microservices i and j in D nn′ Let n be the number of hops between edge servers n and n'.
[0127] Based on the constraints established in step S103 and the total cost of microservice migration, the objective function for the above optimization problem is constructed as follows:
[0128]
[0129] st
[0130]
[0131]
[0132]
[0133]
[0134]
[0135] Among them, u i The computing resources used by microservice i For the computing resources of edge server n, For the storage of edge server n, set The set of production devices covered by edge server n*.
[0136] S107: Optimization Problem Solving: Accelerate the solution of optimization problems by using variable dimensionality reduction, penalty functions, parameter vectorization, and successive convex approximation methods to obtain microservice migration strategies.
[0137] In this process, variable dimensionality reduction partitions the application and microservices and assigns them to different sets, thereby decomposing the original optimization problem into an ordered migration problem of individual microservices.
[0138]
[0139] The division between applications and microservices is performed using the following formula:
[0140]
[0141] If C m,k If (t)>0, then production equipment m enters the equipment set. Application k enters the set For sets and The parameters in the data are divided into production equipment and application programs according to their actual movement sequence. app
[0142] The penalty function makes the solution after variable relaxation closer to the true optimal solution. The penalty function is:
[0143]
[0144] Problem P1 then becomes:
[0145]
[0146] st
[0147]
[0148]
[0149]
[0150]
[0151]
[0152]
[0153] Problem P2 above is a non-convex quadratic programming problem. The parameters of problem P2 are vectorized as follows:
[0154] For any m and k,
[0155]
[0156]
[0157]
[0158] in,
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166]
[0167]
[0168] Among them, S k for The largest element in the matrix, where I is the identity matrix, 1 1×N It is a 1-row, N-column vector in which all elements are 1.
[0169] Problem P2 is transformed into:
[0170]
[0171] Among them, the constraints of problem P3 are the same as those of problem P2;
[0172] Applying a successive convex approximation transformation to problem P3, problem P3 becomes:
[0173]
[0174] st
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181] in,
[0182]
[0183] Its largest eigenvalue is λ max R = Q k (t)+λ max I, Y = λ max I, where I is the identity matrix.
[0184] Problem P4 is solved using a successive convex approximation method. The specific solution process includes the following steps:
[0185] S1: Choose any feasible solution x 0 Choose a step size α∈(0,1] and set r=0;
[0186] S2: Another y r+1 =arg min F(x) r Use a solver that supports solving convex quadratic programming problems;
[0187] S3: Another x r+1 =x r +α(y t+1 -x r );
[0188] S4: Replace r with r+1;
[0189] S5: If ||x r -x r-1If ||≤∈, then the solution process ends and the transfer strategy is obtained; otherwise, repeat steps S2 to S4 to complete the solution process and obtain the transfer strategy.
[0190] S109: Migrate the microservice according to the microservice migration strategy.
[0191] In a preferred embodiment of the present invention, the present invention has the following advantages over the prior art:
[0192] 1) To address the slow decision-making problem of migration strategies in existing technologies, this invention utilizes the transformation of the original complex optimization problem to achieve a fast solution. For the given non-convex integer quadratic programming problem, variable dimensionality reduction, penalty function and successive convex approximation method are used to accelerate the process and achieve a rapid deployment decision, which can adapt to the rapid changes in dynamic processes.
[0193] 2) To address the frequent microservice outages, this invention utilizes variable dimensionality reduction to migrate only the affected microservices, reducing the number of microservices to migrate and thus minimizing microservice outages during each migration. Through variable dimensionality reduction, microservices that do not increase communication overhead are excluded from the optimization problem; only affected microservices are included in the calculation, reducing the number of microservice outages and improving production continuity.
[0194] 3) To address the problem of resource consumption caused by complex dependencies such as layered and chained structures, this invention models complex dependencies to achieve resource sharing between the image layer and the microservice chain, thereby reducing service operating costs.
[0195] The present invention will now be described in detail with reference to preferred embodiments.
[0196] like Figure 1 , Figure 2 The preferred embodiment of the present invention provides a fast and efficient microservice migration method in a smart manufacturing scenario, with the following main steps:
[0197] Step 1: Scene modeling and optimization problem construction.
[0198] S1.1: Scene modeling.
[0199] S1.1.1: Modeling of edge servers and production equipment.
[0200] Suppose there are N edge servers in a smart manufacturing system, and these servers can be represented by a set. Describe the following. The storage and computing resources of edge server n are denoted as follows: and The bandwidth between the cloud server and the edge server n is denoted as . The system has M production devices, which can be used Description. At different times, each edge server connects to multiple production devices. These different edge servers are connected via a wired multi-hop network, whose bandwidth can be considered sufficiently large. nn′ D represents the number of hops between edge server n and edge server n', where n = n'. nn′ =0. At time t, each production device will be under the network coverage of an edge server, and the production devices covered by each edge server are defined as a set. This set contains the number of production devices covered and satisfies... In other words, each device will be covered by only one edge server at a time. At any given time *t*, for any production device *m*, we assign it to the coverage area of only one edge server.
[0201] S1.1.2: Application Modeling.
[0202] Each production device will generate a request for the production application. Assume all applications used in production constitute a set. The number of applications running at any given moment is uncertain. The number of applications at time t can be defined as follows: Each production device's requesting application can be constructed as a set A. m (t), and A m The elements in (t) are The application number in it. Then we can get... The requested application will be deployed on the appropriate edge server and provided with services.
[0203] S1.1.3: Microservice modeling.
[0204] Each application consists of multiple microservices, and all microservices in the service registry can be described as a set of microservices. Each microservice It will occupy a certain amount of storage space. i And requires certain computing resources u i For application k, the microservices it uses can form a set. The elements in are The corresponding microservice serial number. ms m,k,i The microservices i and ms in application k that describe the request from device m m,k,0 Describe the initial microservice, which occupies 0 storage space and computing resources. use Description msm,k,i This represents the deployment status on server n at time t, where 1 indicates deployment to n and 0 indicates deployment to n. We will... The largest element in S is defined as k Each application's microservices form a chain structure through data transmission. For the set of microservices in application k... The amount of data transferred between microservices i and j in the request can be used This means that different applications can use the same microservice image layer. If the same microservice is deployed on the same edge server, multiple identical microservice image layers can share storage space, but compute resources cannot be shared.
[0205] S1.2: Constraint Construction.
[0206] S1.2.1 Microservice uniqueness constraint.
[0207] The microservice corresponding to the application requested by each device can only exist on one server at any given time, thus subject to the following constraint:
[0208]
[0209] S1.2.2 Computational and storage resource constraints.
[0210] Because server computing resources are limited, the sum of the computing resources already used on the server to be migrated and the computing resources required by the microservice cannot exceed the total computing resources on the server. Therefore, the following constraint exists:
[0211]
[0212] Because server storage resources are limited, the sum of the storage resources already occupied on the migrated server and the size of the layers that the microservice needs to download cannot exceed the total computing resources on the server, and identical image layers can share storage space. Therefore, the following constraints exist, where ∈ is a very small positive number:
[0213]
[0214] S1.2.3 Initial Microservices.
[0215] The initial microservice deployment location is the edge server connected to the production device that initiates the application request, which can be described as follows:
[0216]
[0217] S1.3: Construction of the objective function.
[0218] S1.3.1 Service interruption cost.
[0219] When migrating microservices, the runtime data of the microservices needs to be sent from the original server to the new server, and then they need to be re-run. Therefore, each microservice migration corresponds to a service interruption. The interruption cost of any microservice migrated from server n to server n' can be defined as I. i,n→n′ It represents the duration of the service interruption. Therefore, the interruption cost I... i (t) can be represented as
[0220]
[0221] S1.3.2 Mirror fetch cost.
[0222] When migrating a microservice from n to n', if it has already been deployed on n', the image pull cost is 0; otherwise, it is 0. Then the cost of mirror retrieval is P i (t) is shown below, where ∈ is a very small positive number:
[0223]
[0224] S1.3.3 Differences in communication overhead.
[0225] Due to the existence of the inter-service chain structure, the application communication overhead changes after service migration, thus affecting the cost of microservice migration. For any application k requested by production device m, its total communication overhead at time t can be calculated as:
[0226]
[0227] The communication overhead after migration is
[0228]
[0229] The difference in communication overhead before and after the migration is:
[0230]
[0231] S1.3.4 Microservice migration costs.
[0232] The total cost consists of the three costs mentioned above, and can be expressed by the following formula, where θ1, θ2, and θ3 are weights:
[0233]
[0234] S1.3.5 Problem Construction for Target Optimization.
[0235] Based on the constraints and the microservice migration cost of S3.4, the objective optimization problem can be constructed as follows:
[0236]
[0237] st
[0238]
[0239]
[0240]
[0241]
[0242]
[0243] Step 2: Optimize Problem Solving
[0244] S2.1: Dimensionality reduction of variables.
[0245] For each time step, the application and microservices are partitioned according to the following formula.
[0246]
[0247] If C m,k If (t)>0, then the corresponding production equipment m enters the equipment set. Application enters collection For sets and The parameters in the algorithm are divided according to their actual migration sequence, and the original optimization problem is decomposed into ordered individual microservice migration problems.
[0248]
[0249] in,
[0250] S2.2: Penalty function.
[0251] We use a penalty function to make the solution after variable relaxation closer to the true optimal solution. Let the penalty function be:
[0252]
[0253] Problem P1 then becomes:
[0254]
[0255] st
[0256]
[0257]
[0258]
[0259]
[0260]
[0261]
[0262] S2.3: Parameter vectorization.
[0263] Problem P2 is a non-convex quadratic programming problem. First, we need to vectorize this problem to facilitate its solution.
[0264] For any m, k,
[0265]
[0266]
[0267]
[0268] in,
[0269]
[0270]
[0271]
[0272]
[0273]
[0274]
[0275]
[0276]
[0277] make:
[0278]
[0279]
[0280] Among them, S k for The largest element in the matrix, where I is the identity matrix, 1 1×N It is a 1-row, N-column vector in which all elements are 1.
[0281] S2.4: Problem Transformation.
[0282] After step S3, problem P2 is transformed into:
[0283]
[0284] The constraints are still those in problem P2.
[0285] S2.5: Successive Convex Approximation (SCA) Transformation.
[0286] make Its largest eigenvalue is λ max ,
[0287] Let: R = Q k (t)+λ max I, Y = λ max I, where I is the identity matrix.
[0288] The problem then becomes:
[0289]
[0290] st
[0291]
[0292]
[0293]
[0294]
[0295]
[0296]
[0297] S2.6: Problem Solving.
[0298] To solve for P4, the SCA method is used, and the steps are as follows:
[0299] S2.6.1: Choose any feasible solution x 0 Choose a step size α∈(0,1], and let r=0
[0300] S2.6.2: y r+1 =arg min F(x) r The solution can be any solver that supports solving convex quadratic programming problems.
[0301] S2.6.3: x r+1 =x r +α(y r+1 -x r )
[0302] S2.6.4: Replace r with r+1
[0303] S2.6.5: If ||x r -x r-1 If ||≤∈, then the process ends and the migration strategy is obtained; otherwise, repeat S2.6.2 to S2.6.4.
[0304] S2.7: Migrate the microservices according to the derived migration strategy.
[0305] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A fast and efficient microservice migration method in an intelligent manufacturing scene, characterized in that, The method includes the following steps: S101: Scene Modeling: Modeling the edge servers, production equipment, applications, and microservices in the intelligent manufacturing scene; S103: Constraint Construction: Construct constraints for the deployment and migration of microservices in the intelligent manufacturing scenario. The constraints include microservice uniqueness constraints, computing and storage resource constraints, and initial deployment location constraints for microservices. S105: Optimization Problem Construction: During the microservice migration process, calculate the migration cost of sending the microservice's runtime data from the original server to the new server. The objective of the optimization problem is to minimize the total migration cost of the microservice. S107: Optimization problem solving: The optimization problem is solved more quickly by using variable dimensionality reduction, penalty function, parameter vectorization and successive convex approximation methods to obtain the migration strategy of the microservice; S109: Migrate the microservice according to the microservice migration strategy; in, In step S105, the total cost of the microservice migration includes: service interruption cost, image pull cost, and communication overhead difference, namely: The service interruption cost is as follows: The cost of pulling the image is: The difference in communication overhead is: In the formula, For communication costs before migration, For communication overhead after migration, m For production equipment, k For applications, t At a certain moment, i, i' For microservices, collection For the application k The collection of microservices used These are the weighting coefficients. n, n' For edge servers, collection for N A collection of edge servers for At any moment t On the server n The deployment status on the platform, For a moment t On the server n Initial microservice deployment status on the platform. For equipment m Requested application k microservices in i , For initial microservices, For microservices i From server n Migrate to server n The cost of interruption For microservices i Storage space occupied For cloud servers and edge servers n Bandwidth between M A collection of production equipment ,gather For production equipment m The requested set of applications, It is a very small positive number. , For the application k microservices microservices in i and j Data transfer volume between them For edge servers n and n The number of jumps between '; Based on the constraints established in step S103 and the total cost of microservice migration, the objective function of the optimization problem is constructed as follows: P1: st in, For microservices i The computing resources used For edge servers n Computing resources For edge servers n Storage, collection For edge servers n The set of production equipment covered; In step S107, the variable dimensionality reduction partitions the application and the microservices and assigns them to different sets, thereby decomposing the original optimization problem into an ordered migration problem of individual microservices: The division of the application and the microservice is performed using the following formula: like Then the production equipment m Enter the device collection The application k Enter the set For the set and The parameters in the text correspond to the production equipment and the application program, which are divided according to their actual movement sequence. ,app .
2. The method as described in claim 1, characterized in that, In step S101, the scene modeling includes: Each of the edge servers is connected to multiple of the production devices, and the different edge servers are connected through a wired multi-hop network with sufficient bandwidth between them; Each of the production devices is covered by only one edge server at a time, each production device is under the network coverage of one edge server, and each production device will generate a request for a production application, which will be deployed on the appropriate edge server and provided with services. Each of the applications consists of multiple microservices, and different applications can use the same microservice image layer; Each microservice occupies a certain amount of storage space and computing resources. Multiple identical microservice image layers can share the storage space on the same edge server, but cannot share the computing resources on the same edge server.
3. The method as described in claim 1, characterized in that, In step S103, the microservice uniqueness constraint includes: the microservice corresponding to the application requested by each production device exists in only one edge server at any given time; The computing and storage resource constraints include: the sum of the computing resources already occupied in the edge server to be migrated and the computing resources required by the microservice cannot exceed the total computing resources on the edge server; the sum of the storage resources already occupied in the edge server to be migrated and the layer size that the microservice needs to download cannot exceed the total computing resources on the edge server; and the same image layer can share storage space. The initial deployment location constraint for the microservice is: the initial deployment location of the microservice is the edge server connected to the production device that initiated the application request.
4. The method as described in claim 1, characterized in that, In step S107, the penalty function makes the solution after variable relaxation closer to the true optimal solution. The penalty function is: , Then the problem P1 is transformed into: P2: st or 。 5. The method as described in claim 4, characterized in that, Problem P2 is a non-convex quadratic programming problem. The parameter vectorization of problem P2 is as follows: For any m and k , , , , in, , , , , , , , , in, for The largest element in, I For identity matrix, 1 1×N For a single row N A vector of columns, in which all elements are 1.
6. The method as described in claim 5, characterized in that, Problem P2 is transformed into: P3: , The constraints of problem P3 are the same as those of problem P2. Applying a successive convex approximation transformation to problem P3, problem P3 becomes: P4: st or in, , Its largest eigenvalue is , = , I It is an identity matrix.
7. The method as described in claim 6, characterized in that, The problem P4 is solved using a successive convex approximation method, and the solution process includes the following steps: S1: Choose any feasible solution x 0 Select a step size ,set up r =0; S2: Another Use a solver that supports solving convex quadratic programming problems; S3: Another ; S4: Use r +1 Replace r ; S5: If If the solution is obtained, the solution process ends and the migration strategy is obtained. Otherwise, repeat steps S2 to S4 to complete the solution process and obtain the migration strategy.
