CN115118748B - Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method - Google Patents

Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method Download PDF

Info

Publication number
CN115118748B
CN115118748B CN202210705743.3A CN202210705743A CN115118748B CN 115118748 B CN115118748 B CN 115118748B CN 202210705743 A CN202210705743 A CN 202210705743A CN 115118748 B CN115118748 B CN 115118748B
Authority
CN
China
Prior art keywords
micro
service
server
deployment
services
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210705743.3A
Other languages
Chinese (zh)
Other versions
CN115118748A (en
Inventor
刘宇翔
杨博
吴雨
郑忠斌
陈彩莲
关新平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Jiaotong University
Original Assignee
Shanghai Jiaotong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jiaotong University filed Critical Shanghai Jiaotong University
Priority to CN202210705743.3A priority Critical patent/CN115118748B/en
Publication of CN115118748A publication Critical patent/CN115118748A/en
Application granted granted Critical
Publication of CN115118748B publication Critical patent/CN115118748B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses an intelligent manufacturing scene micro-service deployment scheme and a resource redistribution method, which relate to the field of industrial Internet of things and comprise the following steps: the scene modeling and optimizing problem construction comprises modeling of resources of edge servers, communication bandwidth and the number of deployed micro services, and objective function construction comprises the sum of micro service downloading time on all the edge servers and the sum of communication overhead among all the micro services on all the edge servers; converting the multi-objective optimization problem into a single-objective optimization problem according to the utility function, and converting the problem into the single-objective problem with the pareto optimal solution by adopting an additive weighting model; solving an approximate optimal solution of the single-objective optimization problem through a micro-service deployment algorithm to obtain a micro-service deployment strategy based on weight sequencing; and reallocating resources to the micro-service deployment strategy. The invention fully utilizes the computing resources of the edge server, and the obtained micro-service deployment strategy can be directly applied.

Description

Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method
Technical Field
The invention relates to the field of industrial Internet of things, in particular to an intelligent manufacturing scene micro-service deployment scheme and a resource allocation method.
Background
With the development of flexible production, the production environment becomes more and more complex and variable, and industrial applications based on micro-service architecture are also faced with the need of timely responding to order changes and rapidly performing service deployment. The edge micro-service deployment refers to the process that in an edge computing environment, a decision system judges which servers the micro-services need to be deployed in according to the space-time distribution of different server resources and service requests. In complex factory environments, microservice deployment problems are often modeled as high-dimensional mixed integer nonlinear programming problems or integer nonlinear programming problems, for which solving is very difficult. The related research is usually solved by adopting an iteration-based method such as an augmented Lagrangian method, an alternate direction multiplier method and the like or an artificial intelligence-based method such as deep learning, deep reinforcement learning and the like. Since the micro-service deployment problem is typically a non-convex problem, the process of successive approximation to an optimal solution by iteration is slow; related methods based on artificial intelligence also require a significant amount of time for the training process because of the need to feed back the learning network gradient through multiple forward propagates.
Because of the high dynamic nature of the production environment, if the service deployment decision requires high calculation power and long running time, the timeliness of the deployment strategy is difficult to be ensured, and the service response efficiency is also difficult to be improved. Therefore, there is a need for an algorithm that can quickly derive deployment policies, enabling fast and accurate microservice deployment decisions.
In the process of edge micro-service deployment, each micro-service requests certain computing resources, and the running environment of the micro-service occupies certain storage space. Because the computing and storage resources of the edge server are limited, after the preliminary micro-service deployment decision is obtained, the situation that the computing resources of the edge server are not fully utilized can occur, so that the computing resources are idle. Therefore, an algorithm capable of reasonably distributing the computing resources is needed to achieve the maximum utilization of the computing resources.
Accordingly, those skilled in the art are working to develop an intelligent manufacturing scenario micro-service deployment scheme and resource allocation method.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the present invention aims to obtain an approximately optimal solution of a micro-service deployment scheme in a very short time, fully utilize computing resources of an edge server, and improve the processing speed of the micro-service.
In order to achieve the above purpose, the present invention provides a method for intelligently allocating micro-service resources in a manufacturing scene, which comprises the following steps:
s101: modeling the microservice deployed on a server, the modeling comprising computing resources of server nDeploying J micro services on the server n, wherein the computing resource requested by the micro services J is u j The computing resource actually allocated to the micro service j is f j
S103: determining constraint conditions: the computing resources allocated to the micro-services satisfy constraint f j ≥u j I.e. the computing resources allocated to the micro-service must be no smaller than the computing resources it requests; all of the allocated computing resources satisfy constraintsI.e. all allocated computing resources cannot exceed the total computing resources owned by the server n;
s105: construction optimization problem: setting an evaluation function e j =u j /f j The evaluation function is used for evaluating the proportion of the calculation time of the micro service to the original calculation time, and the optimization problem is constructed as follows:
s.t.f j ≥u j
s107: solving the optimization problem, and carrying out resource redistribution on the micro-service according to a solving result, wherein the Lagrange function of the optimization problem is as follows:
wherein ,λi And μ is the Lagrangian multiplier;
the KKT conditions of the optimization problem are:
λ i (u j -f j )=0,
λ i ≥0,
μ≥0
solving the KKT condition to obtain a computing resource f actually allocated to the micro service j j
On the other hand, the invention also provides an intelligent manufacturing scene micro-service deployment scheme, which comprises the following steps:
s201: scene modeling and optimization problem building, wherein,
the scene modeling comprises resources of an edge server in an edge computing system, communication bandwidth between the edge server and a cloud server, the number of micro services deployed in the edge server and a deployment strategy;
the optimization problem construction comprises constraint construction and objective function construction, wherein the constraint construction comprises constraint conditions for deploying the micro-services to the edge servers, and the objective function construction comprises the sum of the downloading time of the micro-services on all the edge servers and the sum of communication overheads among all the micro-services on all the edge servers;
s203: converting the multi-objective optimization problem into a single-objective optimization problem according to a utility function, and converting the problem into the single-objective problem with a pareto optimal solution by adopting an additive weighting model, wherein the utility function is as follows:
wherein U1min ,U 1max Is an optimization target U 1 Minimum and maximum of (U) 2min ,U 2max Is an optimization target U 2 θ is a weighting coefficient, and θ is 0.ltoreq.θ.ltoreq.1;
s205: solving an approximate optimal solution of the single-objective optimization problem through a micro-service deployment algorithm to obtain a micro-service deployment strategy based on weight sequencing;
s207: and applying a resource reallocation method to reallocate the request resources of the micro services allocated by the micro service deployment strategy based on the weight ordering.
Further, the scene modeling includes: the computing and storage resources on the edge server n are and />The bandwidth between each edge server and the cloud server is +>The saidThe number of hops between edge servers n and n' is D nn′ The mth application program contains the micro-service number A m ,MS mi For the ith micro-service in the application program m, the computing resource of the micro-service request is c mi Two of said microservices MS mi With MS (MS) mj The communication data volume between them is->The micro service layer has L layer and S layer l Indicating the size of the first layer, E mil E {0,1} represents MS mi Whether or not to contain the layer I, the deployment policy of the micro-service is +.>Representing the microservice MS mi Is deployed on the edge server n,representing the download situation of said micro service layer,/->Indicating that layer i is deployed to the edge server n.
Further, the constraint construction includes deployment uniqueness constraints, constraints between the micro-service deployment variables and tier deployment variables, wherein,
the deployment uniqueness constraint that each micro-service can be deployed on only one of the edge servers, i.eThe following constraints are satisfied:
constraints between the micro-service deployment variables and the layer deployment variables, i.e. and />The following constraints are satisfied:
further, the constraint building further comprises a computing resource constraint and a storage resource constraint, wherein,
the computing resource constraint is that the total demand for computing resources for all of the micro-services deployed on the server is less than the computing power of the server,
the storage resources are constrained such that the size of all layers of the micro-service deployed on the server is smaller than the storage resources of the server,
further, the objective function construction includes a download delay minimization construction and a communication overhead minimization construction, wherein,
the download delay minimizes the build, i.e. the sum of download times on all the edge servers is minimal,
wherein ,Tn At download of all the micro-service layers deployed on the edge server nIn the middle of the process, the process comprises the steps of,
the communication overhead minimization construction, i.e. the construction of the sum of the communication overheads between all the application programs is minimal,
wherein ,Rm For the communication overhead of the application program corresponding to any industrial equipment m, hop (m, i, j) is any two micro-service MS mi With MS (MS) mj Number of hops between the edge servers deployed.
Further, the objective function construction further comprises a multi-objective optimization construction, the multi-objective optimization construction being:
P1:minU 1 ,U 2
wherein P1 is a built multi-objective optimization.
Further, in the step S203, the single-objective optimization problem of converting the multi-objective optimization problem according to the utility function is:
P2:minF(x,z)
the optimal solution of the optimization problem P2 is the weak pareto optimal solution of the optimization problem P1, and when θ is more than or equal to 0 and less than or equal to 1, the optimal solution of the optimization problem P2 is the pareto optimal solution of the optimization problem P1.
Further, the step S205 includes the steps of:
s1: weighting the communication data volume between the micro services and the micro service layer size according to the utility function,
wherein ,for the size of the micro-service layer of the first layer after the authority is given, S min and Smax Is the minimum and maximum of all said micro-service layer sizes, +.>For the two said microservices MS after the empowerment mi With MS (MS) mj Data volume of communication between, w min and wmax Is the minimum value and the maximum value of the communication data volume among all the micro services;
s2: according to the weighted and />Sorting the micro service groups from large to small, wherein the sorted micro service group list is Sort, and the micro service group comprises a first micro service set { MS } mi |E mil =1 } and a second set of microservices { MS mi ,MS mj The first microservice set is a containing layer S l The second micro service set is all the micro service setsA corresponding set of micro services;
s3: acquiring the micro service Group in the micro service Group list Sort, checking the deployment condition of the micro service in the Group, and continuing the deployment of the next Group of the micro service if all the micro services are already deployed to S3; if all the micro services are not deployed, turning to S4; if part of the micro services are deployed, turning to S10; if all the micro service groups have been deployed S14;
s4: if the micro service group belongs to the first micro service set, turning to S5, otherwise turning to S8;
s5: generating a candidate server list by all the edge servers according to the candidate server generation mode 2, starting service deployment from the header, if the deployment is successful, turning to S6, otherwise turning to S7;
s6: if a single split micro service list exists, generating a candidate server list by all the edge servers in the scene according to a candidate server generation mode 2, starting service deployment from the head of the list, and turning to S3;
s7: splitting the micro service group into a single micro service 1 and a micro service group 2, wherein the splitting principle is that the space occupied by the split micro service is minimum, storing the single micro service 1 into a single micro service list, and switching the micro service group 2 to S5;
s8: for the micro service group, searching the server n where the micro service is deployed closest to the micro service group, generating a candidate server list for the server n according to the candidate server generation mode 1, starting service deployment from the head of the list, if the deployment is successful, turning to S3, otherwise turning to S9;
s9: splitting the micro service group into two micro services 3 and 4; for the micro-service 3, generating the candidate server list by the server n in the S8 according to the candidate server generation mode 1, and starting service deployment from the header to obtain a deployment server n'; for the micro-service 4, generating the candidate server list by the server n' according to the candidate server generation mode 1, starting service deployment from the header, and turning to S3;
s10: if the micro service group meets the first micro service set, turning to S11, otherwise turning to S13;
s11: for the micro service group, acquiring all the server lists n_list where the micro services are deployed in the group, generating the candidate server list according to the candidate server generation mode 2 by the n_list, starting from a table head, deploying the micro services which are not deployed in the micro service group, if the deployment is successful, turning to S3, otherwise turning to S12;
s12: forming a new micro service group by all undeployed micro services in the micro service group, and turning to S5;
s13: for the micro service group, searching the server n 'where the deployed micro service in the micro service group is located, and for the micro service which is not deployed in the group, generating the candidate server list by the server n' according to the candidate server generation mode 1, starting service deployment from a header, and turning to S3;
s14: and after deployment is completed, outputting the obtained micro-service deployment strategy.
Further, the candidate server generation method 1 includes: querying the server list given the server n, where n' satisfies D nn′ =hop, hop= {0,..;
the candidate server generation method 2 includes: given the list of servers n_list, for all the servers in the list, according toAnd performing descending order sorting to obtain the candidate server list.
In the preferred embodiment of the present invention, the present invention has the following beneficial effects over the prior art:
1. the invention can obtain the approximate optimal solution in a very short time through a heuristic algorithm, and can adapt to the high dynamic scene of industrial production.
2. The invention considers the problem of low utilization rate caused by idle computing resources after micro-service deployment, and reallocates the idle computing resources by the resource reallocation method, so that the computing resources of the server can be fully utilized.
The conception, specific structure, and technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, features, and effects of the present invention.
Drawings
FIG. 1 is a flow chart of a micro service deployment scenario in accordance with a preferred embodiment of the present invention;
FIG. 2 is a flow chart of a micro service resource allocation method according to a preferred embodiment of the present invention;
FIG. 3 is a flow chart of a micro-service deployment based on weight ranking in accordance with a preferred embodiment of the present invention.
Detailed Description
The following description of the preferred embodiments of the present invention refers to the accompanying drawings, which make the technical contents thereof more clear and easy to understand. The present invention may be embodied in many different forms of embodiments and the scope of the present invention is not limited to only the embodiments described herein.
In the drawings, like structural elements are referred to by like reference numerals and components having similar structure or function are referred to by like reference numerals. The dimensions and thickness of each component shown in the drawings are arbitrarily shown, and the present invention is not limited to the dimensions and thickness of each component. The thickness of the components is exaggerated in some places in the drawings for clarity of illustration.
As shown in fig. 1, an embodiment of the present invention provides an intelligent manufacturing scenario micro-service deployment scheme, which includes the following steps:
s201: scene modeling and optimization problem building, wherein,
the scene modeling comprises resources of an edge server in an edge computing system, communication bandwidth between the edge server and a cloud server, the number of micro services deployed in the edge server and a deployment strategy;
the optimization problem construction comprises constraint construction and objective function construction, wherein the constraint construction comprises constraint conditions for deploying the micro-services to the edge servers, and the objective function construction comprises the sum of the downloading time of the micro-services on all the edge servers and the sum of communication overheads among all the micro-services on all the edge servers;
s203: converting the multi-objective optimization problem into a single-objective optimization problem according to a utility function, and converting the problem into the single-objective problem with a pareto optimal solution by adopting an additive weighting model, wherein the utility function is as follows:
wherein U1min ,U 1max Is an optimization target U 1 Minimum and maximum of (U) 2min ,U 2max Is an optimization target U 2 θ is a weighting coefficient, and θ is 0.ltoreq.θ.ltoreq.1;
s205: solving an approximate optimal solution of the single-objective optimization problem through a micro-service deployment algorithm to obtain a micro-service deployment strategy based on weight sequencing;
s207: and applying a resource reallocation method to reallocate the request resources of the micro services allocated by the micro service deployment strategy based on the weight ordering.
According to the micro-service deployment scheme based on weight sequencing in the edge computing scene, utility functions are used for balancing two optimization targets to obtain the pareto optimal solution, a heuristic method based on weight sequencing is used for obtaining the micro-service deployment scheme, and computing resources are redistributed to the obtained micro-service deployment scheme through a resource redistribution algorithm, so that computing resources of an edge server are fully utilized, and the obtained micro-service deployment strategy can be directly applied to the edge server for deployment. Compared with the prior art, the deployment strategy is obtained by solving the multiple optimization problems through iteration, or is obtained through long-time network training by using algorithms such as a neural network, deep reinforcement learning and the like, the solution time of the prior art scheme is long, the structure is complex, the near-optimal solution can be obtained in a very short time through a heuristic algorithm, and the method can be suitable for the high-dynamic scene of industrial production.
As shown in fig. 2, an embodiment of the present invention provides a method for intelligently manufacturing a micro-service resource allocation method in a scene, where the method includes the following steps:
s101: modeling the microservice deployed on a server, the modeling comprising computing resources of server nAt the saidDeploying J micro services on a server n, wherein the computing resource requested by the micro services J is u j The computing resource actually allocated to the micro service j is f j
S103: determining constraint conditions: the computing resources allocated to the micro-services satisfy constraint f j ≥u j I.e. the computing resources allocated to the micro-service must be no smaller than the computing resources it requests; all of the allocated computing resources satisfy constraintsI.e. all allocated computing resources cannot exceed the total computing resources owned by the server n;
s105: construction optimization problem: setting an evaluation function e j =u j /f j The evaluation function is used for evaluating the proportion of the calculation time of the micro service to the original calculation time, and the optimization problem is constructed as follows:
s.t.f j ≥u j
s107: solving the optimization problem, and carrying out resource redistribution on the micro-service according to a solving result, wherein the Lagrange function of the optimization problem is as follows:
wherein ,λi And μ is the Lagrangian multiplier;
the KKT conditions of the optimization problem are:
λ i (u j -f j )=0,
λ i ≥0,
μ≥0
solving the KKT condition to obtain a computing resource f actually allocated to the micro service j j
By the resource allocation method, the allocated resources of the micro service can be allocated, and the computing resources of the edge server are fully utilized by reallocating the micro service request resources, so that on one hand, the problem of idle computing resources caused by resource constraint can be avoided, the computing resources of the edge server are fully utilized, on the other hand, the computing resources of the micro service request can be met as much as possible, and the processing speed of the micro service is improved.
The intelligent manufacturing scene micro-service deployment scheme provided by the embodiment of the invention solves the approximate optimal solution of the single-objective optimization problem through a micro-service deployment algorithm to obtain a micro-service deployment strategy based on weight ordering, and the deployment scheme comprises the following steps:
s1: weighting the communication data volume between the micro services and the micro service layer size according to the utility function,
wherein ,for the size of the micro-service layer of the first layer after the authority is given, S min and Smax Is the minimum and maximum of all said micro-service layer sizes, +.>For the two said microservices MS after the empowerment mi With MS (MS) mj Data volume of communication between, w min and wmax Is the minimum value and the maximum value of the communication data volume among all the micro services;
s2: according to the weighted and />Sorting the micro service groups from large to small, wherein the sorted micro service group list is Sort, and the micro service group comprises a first micro service set { MS } mi |E mil =1 } and a second set of microservices { MS mi ,MS mj The first microservice set is a containing layer S l The second micro service set is all the micro service setsA micro-service set of inch responses;
s3: acquiring the micro service Group in the micro service Group list Sort, checking the deployment condition of the micro service in the Group, and continuing the deployment of the next Group of the micro service if all the micro services are already deployed to S3; if all the micro services are not deployed, turning to S4; if part of the micro services are deployed, turning to S10; if all the micro service groups have been deployed S14;
s4: if the micro service group belongs to the first micro service set, turning to S5, otherwise turning to S8;
s5: generating a candidate server list by all the edge servers according to the candidate server generation mode 2, starting service deployment from the header, if the deployment is successful, turning to S6, otherwise turning to S7;
s6: if a single split micro service list exists, generating a candidate server list by all the edge servers in the scene according to a candidate server generation mode 2, starting service deployment from the head of the list, and turning to S3;
s7: splitting the micro service group into a single micro service 1 and a micro service group 2, wherein the splitting principle is that the space occupied by the split micro service is minimum, storing the single micro service 1 into a single micro service list, and switching the micro service group 2 to S5;
s8: for the micro service group, searching the server n where the micro service is deployed closest to the micro service group, generating a candidate server list for the server n according to the candidate server generation mode 1, starting service deployment from the head of the list, if the deployment is successful, turning to S3, otherwise turning to S9;
s9: splitting the micro service group into two micro services 3 and 4; for the micro-service 3, generating the candidate server list by the server n in the S8 according to the candidate server generation mode 1, and starting service deployment from the header to obtain a deployment server n'; for the micro-service 4, generating the candidate server list by the server n' according to the candidate server generation mode 1, starting service deployment from the header, and turning to S3;
s10: if the micro service group meets the first micro service set, turning to S11, otherwise turning to S13;
s11: for the micro service group, acquiring all the server lists n_list where the micro services are deployed in the group, generating the candidate server list according to the candidate server generation mode 2 by the n_list, starting from a table head, deploying the micro services which are not deployed in the micro service group, if the deployment is successful, turning to S3, otherwise turning to S12;
s12: forming a new micro service group by all undeployed micro services in the micro service group, and turning to S5;
s13: for the micro service group, searching the server n 'where the deployed micro service in the micro service group is located, and for the micro service which is not deployed in the group, generating the candidate server list by the server n' according to the candidate server generation mode 1, starting service deployment from a header, and turning to S3;
s14: and after deployment is completed, outputting the obtained micro-service deployment strategy.
The micro-service deployment scheme based on weight ordering can quickly obtain an approximate optimal solution.
The present invention will be described in detail with reference to a preferred embodiment thereof.
In order to meet the high requirements on algorithm running time in the highly dynamic industrial production, the invention provides a micro-service deployment scheme and a resource allocation method based on weight ordering in an intelligent manufacturing scene. According to the method, the micro-service deployment is constructed as a multi-objective optimization problem, the balance among a plurality of optimization objectives is carried out through a utility function, a heuristic scheme based on weight sequencing is used for obtaining a micro-service deployment strategy, and the obtained deployment strategy is subjected to resource redistribution through a resource redistribution algorithm, so that the computing resources of the edge server can be fully utilized.
The micro-service deployment scheme and the resource allocation method based on the weight ordering in the intelligent manufacturing scene mainly comprise the following steps:
step one: and (5) scene modeling and optimization problem construction.
S1: and (5) modeling a scene.
Consider an edge computing system in which there are N edge servers, M industrial devices, each with some computing and storage resources on each edge server, the computing and storage resources on edge server N being used and />And (3) representing. Each edge server is connected with a remote cloud server for downloading and deploying micro services, and bandwidth between the edge server and the cloud server can be used for +.>And (3) representing. Communication between servers is completed through multi-hop transmission, and D can be used nn′ Representing the number of hops between edge servers n and n'.
Each of the industrial devices corresponds to an industrial application for data processing in the production process. Each industrial application program is composed of a plurality of micro-services, and the mth industrial application contains the micro-services with the number A m Can be usedRepresenting these micro-services. For the ith microservice MS in application m mi Can be c mi Representing the computing resources it is requesting. The micro-services in each industrial application interact with the adjacent micro-services, and can use +.>To measure two micro-service MSs mi With MS (MS) mj The amount of data communicated between them.
The micro services are usually stored in a cloud server in a micro service mirror mode, and deployed in a Docker container mode when deployment is needed. The micro service image is composed of different layers, and the same layers can be shared in the same edge server. All micro-service layers are stored in a cloud server, and L layers and S are shared l Indicating the size of the first layer therein. Thus can use E mil E {0,1} represents MS mi Whether or not the first layer is included.
Deployment policy for micro servicesIndicating (I)>Representing micro-service MS mi Is deployed at the edge server n. Since the microservice mirror is made up of different layers, once a microservice is deployed at an edge server, all microservice layers contained by the microservice need to be downloaded to the server. We use->Representing download situation of micro service layer, +.>Indicating that the first layer is deployed to edge server n.
S2: constraint construction
S2.1 deploy a uniqueness constraint. Since each micro-service can only be deployed at one edge server, there are the following constraints:
s2.2 constraints between the micro-service deployment variables and the layer deployment variables. Because the same micro-service layer can be shared among one edge server, the same layer only needs to be downloaded once in the same edge server, so and />The following constraints are satisfied:
/>
s2.3, calculating resource constraint. Because of the limited computing resources of edge servers, the total computing resource requirements of all micro-services deployed on one server need to be less than the computing power of the server, i.e., the following constraints:
s2.4 storage resource constraints. Since the storage resources of the edge servers are limited, the size of all layers of deployed micro services needs to be smaller than the storage resources of the servers, i.e. the following constraints are satisfied
S2.5 initial position constraint of micro service request. Since each industrial application originates from one production facility, the location of the production facility is generally fixed during the production process. We therefore define a virtual micro-service MS m0 At the beginning of each industrial application, its set is changed toFor MS m0 It does not contain any micro-service layer, requests computing resource c mi =0. And its deployment location satisfies:
wherein nm0 An edge server corresponding to the location is generated for the request of industrial application m.
S3: objective function construction
S3.1 download delay minimization problem. The micro service deployment needs to perform an operation environment, that is, downloading of the micro service layer, and the downloading delay can significantly affect the efficiency of the micro service response. For edge server n, the download time of all micro-service layers deployed on that server can be calculated as
The optimization objective is thus the sum of download times on all edge servers, which can be expressed as
And S3.2, minimizing the communication overhead. The interaction between the micro services can generate a large amount of communication data, and if the two micro services with the interaction are deployed on the same edge server, the communication data can be directly accessed through a hard disk or a memory; if they are deployed on different edge servers, the communication data needs to be transmitted to the corresponding servers via multi-hops. We can useTo calculate any two micro-services MS mi With MS (MS) mj Hop count between deployed edge servers. Therefore, for any industrial application corresponding to any industrial equipment m, the communication overhead can be expressed as
The optimization goal is the sum of industrial application communication overheads of all industrial equipment, and can be expressed as
/>
S3.3 construction of Multi-objective optimization problem
From S2, S3.1, S3.2 can build a multi-objective optimization problem:
P1:min U 1 ,U 2
step two: and converting the multi-objective optimization problem into a single-objective optimization problem according to the utility function. To obtain the optimal solution to the above problem, an additive weighted model may be used to transform the problem into a single-objective problem with pareto optimal solution, with the utility function as follows:
wherein U1min ,U 2min and U1max ,U 2max Respectively the minimum value and the maximum value of the corresponding optimization targets, and θ is more than or equal to 0 and less than or equal to 1. The optimization problem can be expressed as follows
P2:min F(x,z)
The optimal solution of the optimization problem P2 is the weak pareto optimal solution of the optimization problem P1, and when 0 < theta < 1, the optimal solution of the optimization problem P2 is the pareto optimal solution of the optimization problem P1.
Step three: a micro-service deployment algorithm based on weight ranking. According to the single-objective optimization problem converted in the second step, a micro-service deployment algorithm is provided to obtain an approximate optimal solution, and the specific steps are as shown in fig. 3:
s1: and weighting the communication data volume among the micro services and the size of the micro service layer according to the utility function.
wherein For the size of the micro-service layer of the first layer after the authority is given, S min and Smax Is the minimum and maximum of all said micro-service layer sizes, +.>For the two said microservices MS after the empowerment mi With MS (MS) mj Data volume of communication between, w min and wmax Is the minimum value and the maximum value of the communication data volume among all the micro services;
s2: two candidate server list generation approaches are defined. Generating mode 1: given a server n, querying a server list from small to large according to hop numbers, wherein each queried server n' satisfies D nn′ =hop, where hop= {0,..Sequencing the remaining storage space of the server from large to small to obtain a candidate server list sequenced according to the hop count and the remaining storage space; generating mode 2: given a list of servers n_list, all servers in the list are in accordance withAnd performing descending order sorting to obtain a candidate server list.
S3: according to the weighted and />The micro-service groups are ordered from big to small. The definition of the micro-service group is (1) containing layer S l All microservices set { MS ] mi |E mil =1 } or (2)/(1)>Corresponding microservice set { MS mi ,MS mj }. Corresponding weighting->Or->The larger the micro-service group is, the more forward, the ordered list of micro-service groups Sort is derived, let k=1.
S4: and selecting a micro service Group with the order of k in the Sort, and checking the deployment condition of the micro service in the Group. k=k+1. If all micro-services have been deployed, go to S4. If all micro-services are not deployed, go to S5. If part of the micro services are deployed, go to S11. If all the micro service groups have been selected, the process goes to S15.
S5: if the micro service group meets (1), turning to S6, otherwise turning to S9.
S6: and for the micro service group, generating a candidate server list by all edge servers in the scene according to the generation mode 2 in the S2, and attempting to perform service deployment from the head of the table. If the deployment is successful, turning to S7, otherwise turning to S8.
S7: if the split single micro-service list exists, generating a candidate server list by all edge servers in the scene according to the generation mode 2 in the S2, and attempting to perform service deployment from the head of the list. And S4, turning to S4.
S8: the micro service group is split into a single micro service 1 and a micro service group 2, and the splitting principle is that the space occupied by the split micro service group is minimum. The single micro service 1 is stored in a single micro service list. For microservices group 2, go to S6.
S9: and for the micro service group, searching a server n where the deployed micro service closest to the micro service group is located, generating a candidate server list for the server n according to the generation mode 1 in the S2, and attempting service deployment from the head of the list. If the deployment is successful, turning to S4, otherwise turning to S10.
S10: splitting the micro service group into two micro services 1 and 2, generating a candidate server list for the micro services 1 according to the generation mode 1 in S2 by the server n in S9, and attempting service deployment from the head of the list to obtain a deployment server n'. For the micro service 2, the server n' generates a candidate server list according to the generation mode 1 in the S2, and service deployment is attempted from the head of the list. And S4, turning to S4.
S11: if the micro service group meets (1), turning to S12, otherwise turning to S14.
S12: and for the micro service group, acquiring a server list n_list of all deployed micro services in the group, generating a candidate server list according to the generation mode 2 in the S2 by the n_list, and attempting to deploy the undeployed micro services in the micro service group from the head of the list. If the deployment is successful, turning to S4, otherwise turning to S13.
S13: and (6) forming a new micro service group by all undeployed micro services in the micro service group, and turning to S6.
S14: and for the micro service group, searching a server n 'where the micro service is deployed in the micro service group, and for the micro service which is not deployed in the group, generating a candidate server list by the server n' according to the generation mode 1 in S2, and attempting to deploy the service from the head of the list. And S4, turning to S4.
S15: and after deployment is completed, outputting the obtained deployment strategy.
Step four: resource reallocation algorithm. And (3) for the deployment strategy obtained in the step three, adopting a resource reassignment algorithm to reassign the service request resources. The specific steps are as follows:
s1: the microservices deployed on the servers are modeled. The computing resources of server n areJ micro services are deployed on the server, and the computing resource requested by the micro services J is c j The computing resource actually allocated to microservice j is f j
S2: and constructing resource constraints. The computing resources allocated to the microservices must be no smaller than the computing resources they request, so there is a constraint f j ≥u j . All computing resources allocated cannot exceed the total computing resources owned by the server, so there are constraints
S3: and (5) constructing an optimization problem. Defining an evaluation function e j =u j /f j The calculation time for evaluating the micro service is a proportion of the original calculation time. Then the optimization problem can be constructed as
s.t.f j ≥u j
S4: solving the above problem. The Lagrangian function that constructs the above-described optimization problem is
Under the KKT condition of
λ i (u j -f j )=
λ i ≥0,
μ≥0
Solving it to obtain
By applying the calculated f j And carrying out resource allocation on the deployed micro-services and carrying out actual micro-service deployment.
The foregoing describes in detail preferred embodiments of the present invention. It should be understood that numerous modifications and variations can be made in accordance with the concepts of the invention without requiring creative effort by one of ordinary skill in the art. Therefore, all technical solutions which can be obtained by logic analysis, reasoning or limited experiments based on the prior art by the person skilled in the art according to the inventive concept shall be within the scope of protection defined by the claims.

Claims (10)

1. An intelligent manufacturing scene microservice resource allocation method is characterized by comprising the following steps:
s101: modeling the microservice deployed on a server, the modeling comprising computing resources of server nDeploying J micro services on the server n, wherein the computing resource requested by the micro services J is u j The computing resource actually allocated to the micro service j is f j
S103: determining constraint conditions: the computing resources allocated to the micro-services satisfy constraint f j ≥u j I.e. the computing resources allocated to the micro-service must be no smaller than the computing resources it requests; all of the allocated computing resources satisfy constraintsI.e. all allocated computing resources cannot exceed the total computing resources owned by the server n;
s105: construction optimization problem: setting an evaluation function e j =u j /f j The evaluation function is used for evaluating the proportion of the calculation time of the micro service to the original calculation time, and the optimization problem is constructed as follows:
s107: solving the optimization problem, and carrying out resource redistribution on the micro-service according to a solving result, wherein the Lagrange function of the optimization problem is as follows:
wherein ,λi And μ is the Lagrangian multiplier;
the KKT conditions of the optimization problem are:
μ≥0
solving the KKT condition to obtain a computing resource f actually allocated to the micro service j j
2. An intelligent manufacturing scene micro-service deployment method is characterized by comprising the following steps:
s201: scene modeling and optimization problem building, wherein,
the scene modeling comprises resources of an edge server in an edge computing system, communication bandwidth between the edge server and a cloud server, the number of micro services deployed in the edge server and a deployment strategy;
the optimization problem construction comprises constraint construction and objective function construction, wherein the constraint construction comprises constraint conditions for deploying the micro-services to the edge servers, and the objective function construction comprises the sum of the downloading time of the micro-services on all the edge servers and the sum of communication overheads among all the micro-services on all the edge servers;
s203: converting the multi-objective optimization problem into a single-objective optimization problem according to a utility function, and converting the problem into the single-objective problem with a pareto optimal solution by adopting an additive weighting model, wherein the utility function is as follows:
wherein U1min ,U 1max Is an optimization target U 1 Minimum and maximum of (U) 2min ,U 2max Is an optimization target U 2 θ is a weighting coefficient, and θ is 0.ltoreq.θ.ltoreq.1;
s205: solving an approximate optimal solution of the single-objective optimization problem through a micro-service deployment algorithm to obtain a micro-service deployment strategy based on weight sequencing;
s207: applying the resource allocation method according to claim 1, requesting resource reallocation of the micro-services allocated to the micro-service deployment policy based on the weight ranking.
3. The deployment method of claim 2, wherein the scene modeling comprises: the computing and storage resources on the edge server n are and />The bandwidth between each edge server and the cloud server is +>The edge servers n and n'The number of hops between is D nn′ The mth application program contains the micro-service number A m ,MS mi For the ith micro-service in the application program m, the computing resource of the micro-service request is c mi Two of said microservices MS mi With MS (MS) mj The communication data volume between them is->The micro service layer has L layer and S l Indicating the size of the first layer, E mil E {0,1} represents MS mi Whether or not to contain the layer I, the deployment policy of the micro-service is +.> Representing the microservice MS mi Is deployed on the edge server n, < >>Representing the download situation of said micro service layer,/->Indicating that layer i is deployed to the edge server n.
4. The deployment method of claim 3 wherein the constraint construction comprises deployment uniqueness constraints, constraints between the micro-service deployment variables and layer deployment variables, wherein,
the deployment uniqueness constraint that each micro-service can be deployed on only one of the edge servers, i.eThe following constraints are satisfied:
constraints between the micro-service deployment variables and the layer deployment variables, i.e. and />The following constraints are satisfied:
5. the deployment method of claim 4 wherein the constraint building further comprises a computing resource constraint and a storage resource constraint, wherein,
the computing resource constraint is that the total demand for computing resources for all of the micro-services deployed on the server is less than the computing power of the server,
the storage resources are constrained such that the size of all layers of the micro-service deployed on the server is smaller than the storage resources of the server,
6. the deployment method of claim 5 wherein the objective function construction comprises a download delay minimization construction and a communication overhead minimization construction, wherein,
the download delay minimizes the build, i.e. the sum of download times on all the edge servers is minimal,
wherein ,Tn For the download time of all the micro-service layers deployed on the edge server n,
the communication overhead minimization construction, i.e. the construction of the sum of the communication overheads between all the application programs is minimal,
wherein ,Rm For the communication overhead of the application program corresponding to any industrial equipment m, hop (m, i, j) is any two micro-service MS mi With MS (MS) mj Number of hops between the edge servers deployed.
7. The deployment method of claim 6, wherein the objective function build further comprises a multi-objective optimization build, the multi-objective optimization build being:
P1:minU 1 ,U 2
wherein P1 is a built multi-objective optimization.
8. The deployment method of claim 7 wherein in step S203, the single-objective optimization problem for transforming the multi-objective optimization problem according to the utility function is:
P2:minF(x,z)
the optimal solution of the optimization problem P2 is the weak pareto optimal solution of the optimization problem P1, and when θ is more than or equal to 0 and less than or equal to 1, the optimal solution of the optimization problem P2 is the pareto optimal solution of the optimization problem P1.
9. The deployment method of claim 8 wherein the step S205 comprises the steps of:
s1: weighting the communication data volume between the micro services and the micro service layer size according to the utility function,
wherein ,for the size of the micro-service layer of the first layer after the authority is given, S min and Smax Is the minimum and maximum of all said micro-service layer sizes, +.>For the two said microservices MS after the empowerment mi With MS (MS) mj Data volume of communication between, w min and wmax Is the minimum value and the maximum value of the communication data volume among all the micro services;
s2: according to the weighted and />Sorting the micro service groups from large to small, wherein the sorted micro service group list is Sort, and the micro service group comprises a first micro service set { MS } mi |E mil =1 } and a second set of microservices { MS mi ,MS mj The first microservice set is a containing layer S l Is a second set of micro-services +.>A corresponding set of micro services;
s3: acquiring the micro service Group in the micro service Group list Sort, checking the deployment condition of the micro service in the Group, and continuing the deployment of the next Group of the micro service if all the micro services are already deployed to S3; if all the micro services are not deployed, turning to S4; if part of the micro services are deployed, turning to S10; if all the micro service groups have been deployed S14;
s4: if the micro service group belongs to the first micro service set, turning to S5, otherwise turning to S8;
s5: generating a candidate server list by all the edge servers according to the candidate server generation mode 2, starting service deployment from the header, if the deployment is successful, turning to S6, otherwise turning to S7;
s6: if a single split micro service list exists, generating a candidate server list by all the edge servers in the scene according to a candidate server generation mode 2, starting service deployment from the head of the list, and turning to S3;
s7: splitting the micro service group into a single micro service 1 and a micro service group 2, wherein the splitting principle is that the space occupied by the split micro service is minimum, storing the single micro service 1 into a single micro service list, and switching the micro service group 2 to S5;
s8: for the micro service group, searching the server n where the micro service is deployed closest to the micro service group, generating a candidate server list for the server n according to the candidate server generation mode 1, starting service deployment from the head of the list, if the deployment is successful, turning to S3, otherwise turning to S9;
s9: splitting the micro service group into two micro services 3 and 4; for the micro-service 3, generating the candidate server list by the server n in the S8 according to the candidate server generation mode 1, and starting service deployment from the header to obtain a deployment server n'; for the micro-service 4, generating the candidate server list by the server n' according to the candidate server generation mode 1, starting service deployment from the header, and turning to S3;
s10: if the micro service group meets the first micro service set, turning to S11, otherwise turning to S13;
s11: for the micro service group, acquiring all the server lists n_list where the micro services are deployed in the group, generating the candidate server list according to the candidate server generation mode 2 by the n_list, starting from a table head, deploying the micro services which are not deployed in the micro service group, if the deployment is successful, turning to S3, otherwise turning to S12;
s12: forming a new micro service group by all undeployed micro services in the micro service group, and turning to S5;
s13: for the micro service group, searching the server n 'where the deployed micro service in the micro service group is located, and for the micro service which is not deployed in the group, generating the candidate server list by the server n' according to the candidate server generation mode 1, starting service deployment from a header, and turning to S3;
s14: and after deployment is completed, outputting the obtained micro-service deployment strategy.
10. The deployment method of claim 9 wherein,
the candidate server generation method 1 includes: given the server n, querying the server list from small to large according to hop count, wherein each queried server n' satisfies D nn′ =hop, where hop= {0,..;
the candidate server generation mode 2 includes: given the list of servers n_list, for all the servers in the list, according toAnd performing descending order sorting to obtain the candidate server list.
CN202210705743.3A 2022-06-21 2022-06-21 Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method Active CN115118748B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210705743.3A CN115118748B (en) 2022-06-21 2022-06-21 Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210705743.3A CN115118748B (en) 2022-06-21 2022-06-21 Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method

Publications (2)

Publication Number Publication Date
CN115118748A CN115118748A (en) 2022-09-27
CN115118748B true CN115118748B (en) 2023-09-26

Family

ID=83328920

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210705743.3A Active CN115118748B (en) 2022-06-21 2022-06-21 Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method

Country Status (1)

Country Link
CN (1) CN115118748B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110855578A (en) * 2019-11-06 2020-02-28 西安电子科技大学 Similarity-based cloud micro-service resource scheduling optimization method
CN111027736A (en) * 2019-07-30 2020-04-17 中国人民解放军国防科技大学 Micro-service combined deployment and scheduling method under multi-objective optimization
CN113918277A (en) * 2021-09-18 2022-01-11 浙江工业大学 Data center-oriented service function chain optimization arrangement method and system
CN114615338A (en) * 2022-04-11 2022-06-10 河海大学 Micro-service deployment method and device based on layer sharing in edge environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10356213B2 (en) * 2017-03-17 2019-07-16 International Business Machines Corporation Automatic interdependency resolution for micro-service deployments
US11805076B2 (en) * 2020-08-21 2023-10-31 Kyndryl, Inc. Microservice placement in hybrid multi-cloud using graph matching

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111027736A (en) * 2019-07-30 2020-04-17 中国人民解放军国防科技大学 Micro-service combined deployment and scheduling method under multi-objective optimization
CN110855578A (en) * 2019-11-06 2020-02-28 西安电子科技大学 Similarity-based cloud micro-service resource scheduling optimization method
CN113918277A (en) * 2021-09-18 2022-01-11 浙江工业大学 Data center-oriented service function chain optimization arrangement method and system
CN114615338A (en) * 2022-04-11 2022-06-10 河海大学 Micro-service deployment method and device based on layer sharing in edge environment

Also Published As

Publication number Publication date
CN115118748A (en) 2022-09-27

Similar Documents

Publication Publication Date Title
CN109684075B (en) Method for unloading computing tasks based on edge computing and cloud computing cooperation
Fan et al. Workload allocation in hierarchical cloudlet networks
CN108566659B (en) 5G network slice online mapping method based on reliability
Huang et al. Scalable orchestration of service function chains in NFV-enabled networks: A federated reinforcement learning approach
CN113950066A (en) Single server part calculation unloading method, system and equipment under mobile edge environment
CN110069341B (en) Method for scheduling tasks with dependency relationship configured according to needs by combining functions in edge computing
CN111835849B (en) Method and device for enhancing service capability of access network
Ma et al. A cyclic game for service-oriented resource allocation in edge computing
Lin et al. Column generation based service function chaining embedding in multi-domain networks
Amer et al. An optimized collaborative scheduling algorithm for prioritized tasks with shared resources in mobile-edge and cloud computing systems
Pham et al. Share-to-run IoT services in edge cloud computing
Jiang et al. Hierarchical deployment of deep neural networks based on fog computing inferred acceleration model
CN115118748B (en) Intelligent manufacturing scene micro-service deployment scheme and resource redistribution method
CN106717084B (en) Apparatus and method for overlapping rate partition
Yadav et al. Fuzzy based task allocation technique in distributed computing system
Anwar et al. Recommender system for optimal distributed deep learning in cloud datacenters
CN113157431B (en) Computing task copy distribution method for edge network application environment
Masdari et al. Energy-aware computation offloading in mobile edge computing using quantum-based arithmetic optimization algorithm
CN115169561A (en) Multi-branch network collaborative reasoning method and system for Internet of things
Yadav E-MOGWO Algorithm for Computation Offloading in Fog Computing.
Chuang et al. A dynamic multi-resource management for edge computing
Balusamy et al. Hybridization of immune with particle swarm optimization in task scheduling on smart devices
CN110532079A (en) The distribution method and device of computing resource
Zhang et al. Joint VNF scheduling and deployment: A dynamic scenario
Sato et al. Program file placement problem for machine-to-machine service network platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant