WO2022120959A1 - Load balancing multi-service migration method and system based on minimum-cost maximum-flow - Google Patents

Load balancing multi-service migration method and system based on minimum-cost maximum-flow Download PDF

Info

Publication number
WO2022120959A1
WO2022120959A1 PCT/CN2020/138815 CN2020138815W WO2022120959A1 WO 2022120959 A1 WO2022120959 A1 WO 2022120959A1 CN 2020138815 W CN2020138815 W CN 2020138815W WO 2022120959 A1 WO2022120959 A1 WO 2022120959A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
node
edge server
edge
nodes
Prior art date
Application number
PCT/CN2020/138815
Other languages
French (fr)
Chinese (zh)
Inventor
唐欢
王洋
张锦霞
须成忠
叶可江
Original Assignee
中国科学院深圳先进技术研究院
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 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Publication of WO2022120959A1 publication Critical patent/WO2022120959A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W16/00Network planning, e.g. coverage or traffic planning tools; Network deployment, e.g. resource partitioning or cells structures
    • H04W16/18Network planning tools
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/16Central resource management; Negotiation of resources or communication parameters, e.g. negotiating bandwidth or QoS [Quality of Service]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/02Access restriction performed under specific conditions
    • H04W48/04Access restriction performed under specific conditions based on user or terminal location or mobility data, e.g. moving direction, speed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Definitions

  • the present invention relates to the field of information technology, and more particularly, to a multi-service migration method and system based on load balancing with minimum cost and maximum flow.
  • MEC Mobile edge computing
  • QoS quality of service
  • computing resources can be pushed from the cloud center to the edge of the network, which enables data services and other related processing tasks to run close to mobile users. Therefore, it not only reduces service latency, but also minimizes network traffic, both benefits of which are quite important for those time-bound services (typical applications in mobile computing).
  • MEC is quickly becoming the focus of the next wave of research, especially in 5G networks with smarter and more powerful computing resources, which can be installed at the edge of wireless networks, enabling many time-sensitive services deployment is closer to the user.
  • 5G networks with smarter and more powerful computing resources which can be installed at the edge of wireless networks, enabling many time-sensitive services deployment is closer to the user.
  • the time difference of access to services, and the limited coverage of a single edge server if multiple services are fixed on one edge server at the same time, there will be resource contention and delay in accessing services. Increase. Therefore, if these factors are not taken into account, the service provided may significantly increase the access delay, and worse, cause a large amount of network traffic, cause network congestion, lead to service performance degradation, or even service interruption.
  • the purpose of the present invention is to provide a multi-service migration method and system based on load balancing with minimum cost and maximum flow in view of the technical problems existing in the prior art, so that the placement of virtual services on edge nodes is more balanced and flexible and adjustable .
  • the present invention provides a multi-service migration method based on load balancing with minimum cost and maximum flow.
  • the specific steps of the method include the following steps:
  • a minimum cost maximum flow model is established, and the model includes source nodes, service nodes, edge server nodes and endpoints;
  • Update the access information of each service adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node to achieve load balancing;
  • Real-time monitoring and statistics are performed on the access information of each service.
  • the change rate of the access information exceeds the set threshold, the corresponding service nodes and edge server nodes are adjusted.
  • Ni represents the ith service node
  • Ej represents the jth edge server node
  • the source node S is only connected to the service node Ni
  • each Each service node Ni is connected to all edge server nodes Ej
  • each edge server node Ej is connected to the termination node T; each edge in the model is associated with capacity and communication cost.
  • each edge server node Ej is connected to the terminal T through at least two edges according to the number of services it can bear, and the cost weights of each edge are different and in an increasing relationship.
  • the specific process of updating the position of the service node on the edge server node includes:
  • the incremental minimum cost and maximum flow algorithm is used to solve the problem, and the position of the service node on the edge server node is updated according to the obtained minimum cost and maximum flow.
  • the incremental minimum cost maximum flow algorithm specifically includes the following:
  • the access volume of the service node changes, and when the variable of access times is greater than the pre-learned threshold, the location of the service node is updated;
  • the location of the service node is updated.
  • the present invention also provides a load balancing multi-service migration system based on minimum cost and maximum flow, the system includes the following:
  • Topology map building module used to build a network topology map according to the geographical location and connection relationship of edge servers;
  • Matrix generation module used to calculate the shortest path distance between each pair of edge servers in the network topology diagram, and generate a shortest path distance matrix
  • Model building module used to establish a minimum-cost maximum flow model according to the distance matrix, combined with the access information of each service, the load capacity of each edge server and its relationship with the service delay, and the model includes the source node , service nodes, edge server nodes and edge nodes;
  • Service node migration module used to solve the model to obtain the minimum cost and maximum flow, migrate the service nodes, and place them on the corresponding edge server nodes;
  • Service node update module used to update the access information for each service, adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node;
  • Monitoring and adjustment module It is used to monitor and count the access information of each service in real time, and adjust the corresponding service nodes and edge server nodes when the change rate of the access information exceeds the set threshold.
  • the service node update module includes:
  • Cost update sub-module used to update the access cost and migration cost of each service node placed on the edge server node in the residual network of the model solving algorithm
  • Node deletion and addition sub-module It is used to delete and add service nodes and edge server nodes in the residual network according to the updated access information
  • Weight adjustment sub-module adjust the weight of the edge connecting the edge server node to the endpoint according to the current edge network index changes and the load of each edge server node;
  • Node update sub-module use the incremental minimum cost and maximum flow algorithm to solve, and update the position of the service node on the edge server node according to the minimum cost and maximum flow obtained by the solution.
  • the present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of any one of the methods when the processor executes the program.
  • the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of any one of the methods are implemented.
  • the multi-service migration method and system provided by the present invention transform the communication cost problem and load balancing problem of accessing services in the edge network into the problem of minimum cost and maximum flow, and can realize that only a small part of the access cost is increased.
  • the placement on the edge nodes is more balanced and flexible, and it can also well cope with the sudden increase in the number of service accesses and abnormal situations. It is simple, reliable and easy to implement, ensuring fast response to users. Improved service quality.
  • FIG. 1 is a flowchart of a multi-service migration method for load balancing according to the present invention.
  • FIG. 2 is a network topology diagram of virtual service migration according to the present invention.
  • FIG. 3 is a schematic diagram of the minimum cost maximum flow model of the present invention.
  • FIG. 4 is a flow chart of the present invention for updating the location of a service node.
  • FIG. 5 is a schematic diagram of the last residual network of the present invention.
  • FIG. 6 is a schematic diagram of the modified residual network of the present invention.
  • FIG. 7 is a schematic diagram of a multi-service migration system for load balancing according to the present invention.
  • FIG. 8 is a schematic diagram of a service node update module in the multi-service migration system of the present invention.
  • FIG. 9 is a schematic diagram of the principle of the electronic device of the present invention.
  • the present invention provides a load balancing multi-service migration method based on minimum cost and maximum flow, and the specific steps of the method include the following:
  • Step S1 Build a network topology map according to the geographic location and connection relationship of the edge server. Specifically, the weight of the edge in the network topology graph is determined by the distance between the connected edge nodes and the network transmission speed.
  • the application scenario of the present invention can be abstracted into a network topology diagram as shown in Figure 2.
  • the virtual service runs on the server of the edge node, so the edge node is abstracted into the edge server node, that is, Figure 2
  • the edge servers 1 to 5 connected to the decision center users can access the corresponding edge servers for the services they need through the nearest access points 1 to 5.
  • Step S2 Calculate the shortest path distance between each pair of edge servers in the network topology diagram, and generate a shortest path distance matrix. Specifically, using the shortest path algorithm to calculate the shortest path distance, the method is simple and reliable.
  • Step S3 Count the access information of each service in the most recent time period, and establish a minimum cost maximum flow model according to the shortest path distance matrix and in combination with the load capacity of each edge server and its relationship with the service delay.
  • the model includes source nodes, service nodes, edge server nodes, and endpoints.
  • the access cost and migration cost of each service placed on each edge node are calculated, and the relationship between the load capacity of each edge server and the service delay is calculated, and a minimum cost maximum flow model is established. .
  • the minimum cost maximum flow model is specifically:
  • Ni represents the ith service node
  • Ej represents the jth edge server node, where i is 1 to n, and j is 1 to m, that is, there are a total of n service nodes and m edge server nodes.
  • the source node S is only connected to the service node Ni
  • each service node Ni is connected to all edge server nodes Ej
  • each edge server node Ej is connected to the termination node T.
  • Each edge in the model is associated with two values, capacity and communication cost.
  • the capacity of each edge connecting the source node S and the service node Ni is 1, so that all services can be placed at the edge server or cloud center, and the cost is 0.
  • the capacity of the edge connecting each service node Ni with all edge server nodes Ej is 1, and the cost is the sum of the delay cost and the migration cost of placing the service node on the edge server node Ej.
  • each edge server node Ej is connected to the terminal T through several edges (that is, at least two edges) according to the number of services that the edge server node can carry, and each edge has a different cost weight. and an increasing relationship. Specifically, the weight of each edge can be determined according to the delay and cost of placing a corresponding number of services in the past, or it can be determined according to the user's needs or the real-time load of the entire edge network.
  • the result is the theoretical minimum total access delay, but it often occurs that the number of services that need to be placed on some edge nodes is particularly large, while other edge nodes are The number of services that need to be placed is relatively small, or even zero, which is likely to cause the edge nodes with heavy load to face resource contention, which will increase the delay of the service, or even cause downtime, which will degrade the quality of service.
  • the services on the edge server nodes with heavy load are placed on the relatively idle edge server nodes, and the total service access delay will not increase too much.
  • adding multiple edges on the edge connecting the edge server node to the endpoint that is, splitting one edge from each edge server node to the endpoint into multiple edges, and the number of edges is the number that can be placed by the corresponding edge server node.
  • the number of services, and a certain cost weight is given to each edge, so that services are more inclined to be placed on those edge server nodes with low load, rather than on some edge nodes with low load, but no It will increase too much theoretical access cost, so as to achieve load balancing of edge server nodes, and the degree of balance can be ensured by adjusting the cost weight on the edge from the edge server node to the endpoint, which can flexibly meet the The needs of different users, and can deal with many different scenarios.
  • Step S4 Solve the model to obtain the minimum cost and maximum flow, and place the service node on the corresponding edge server node to complete the migration and placement of the service node.
  • the classical minimum cost and maximum flow solution algorithm is used to solve the problem.
  • the solved minimum cost and maximum flow if there is a flow from the service node Ni through the edge server node Ej, it means that the service node Ni is placed on the edge.
  • the service node is migrated and placed, that is, the position of the edge server node corresponding to the service node can be obtained according to the solution result, and then the service node is migrated and placed.
  • the classical minimum cost maximum flow solution algorithm adopts continuous shortest path method, Cost Scaling, scaling method or elimination circle method, all of which can reliably and effectively obtain the minimum cost maximum flow of the model.
  • Step S5 Update the access information for each service, that is, re-statistic the access information for each service every time period, adjust the weight of the edge connecting the edge server node to the endpoint, and update the service node at the edge.
  • the location on the server node to achieve load balancing as shown in Figure 4, specifically includes:
  • Step S51 in the residual network of the model solving algorithm, update the access cost and migration cost of each service node placed on the edge server node;
  • Step S52 according to the updated access information, perform corresponding deletions and additions to the service nodes and edge server nodes in the residual network;
  • Step S53 Adjust the weight of the edge connecting the edge server node to the end node according to the current edge network index change and the load of each edge server node, so that the calculated placement scheme has a certain tendency, but Doesn't add much to the total access cost.
  • Step S54 Use the incremental minimum cost and maximum flow algorithm to quickly solve the problem, migrate and place the service node according to the obtained minimum cost and maximum flow, and update its position on the edge server node.
  • the access information of the service may be re-statistical at intervals.
  • the process of steps S3 and S4 will be chosen to be re-executed, but the solution time is often too long.
  • the embodiment of the present invention adopts the incremental minimum cost maximum flow algorithm, and directly modifies the corresponding service node and the edge connected to the edge server node in the last residual network, instead of constructing the minimum cost maximum flow model from scratch and Solving, performing the deloop method on the modified residual network reduces the solving time by a factor of 8-15.
  • Step S6 Perform real-time monitoring and statistics on the access information of each service, and adjust the corresponding service node and edge server node when the change rate of the access information exceeds the set threshold.
  • the number of user's access to the service node will have a sudden increase in volume and abnormal situation, and the access information will be monitored and counted in real time through the monitor.
  • An optimal threshold is trained by the reinforcement learning method. When the change rate of the monitored or statistical access information exceeds the set threshold, that is, the optimal threshold, the residual network is immediately updated, and the edge server nodes are adjusted in time to connect to The weight of the edge of the termination point can be solved by the incremental minimum cost maximum flow algorithm proposed in step S5, and the service node and the edge server node are adjusted accordingly.
  • each service node is updated by using the incremental minimum cost maximum flow algorithm, which specifically includes the following:
  • Step S541 The user's access to the service node changes, and when the set conditions are met, the location of the service node is updated, specifically including:
  • Step S5411 When the variable of the number of visits is greater than the pre-learned threshold, in the last residual network of the solution algorithm, modify the weights of the edges connected to the service node; otherwise, do not modify the weights that need to be modified. the number of sides.
  • the amount of visits to most service nodes will change every period of time, and since the number of visits by users to some service nodes will not change too much, the number of visits can be Compare with the optimal threshold learned by machine learning method in advance to determine whether to modify the weight of the edge. Further, the machine learning method is used to determine the threshold value that needs to be modified for the associated edge weights of the service nodes. Different from the traditional method, the optimal threshold value is obtained through the machine learning method and the previous data set training. The threshold obtained at this time can adapt to various access modes of users, large-scale and high-frequency changing network structure, and various abnormal situations, so that the decision center will not frequently change the residual network structure, thereby reducing the number of service adjustments and improving service quality.
  • Step S5412 Add a migration cost on the edge connecting the service node to the edge server node, and start from the service node whose cost has changed, and re-find the flow with the minimum cost and the maximum cost. Specifically, using the circle elimination method to find the minimum cost and maximum flow again, because it is based on the minimum cost and maximum flow in the previous stage, the circle elimination method can be used to find the optimal solution faster than other schemes.
  • Step S513 Update the position of the service node on the edge server node according to the obtained minimum cost and maximum flow.
  • the last partial residual network of the solution algorithm is shown in Figure 4.
  • the capacity and weight of the edge from the service node N1 to the edge server node E1 are (0, 100), indicating that the service node has been
  • the point N1 is placed on the edge server node E1, and the corresponding reverse edge (1, -100) is generated.
  • the service node Nn is allocated to the edge server node E2.
  • the number of user visits to service nodes N1 and Nn changes and the number of visits is greater than the threshold, then the corresponding edges in the residual network need to be modified.
  • the modified residual network is shown in Figure 5.
  • Step S542 when the number of service nodes changes, delete service nodes or add service nodes, and update the locations of service nodes, specifically including:
  • the service node and related edges are added to the residual network, the minimum cost path from the service node to the edge server node is selected, and the flow is added to reach the maximum flow, thereby realizing all services. Node placement; add migration costs on the edge where service nodes connect to edge server nodes;
  • a new minimum cost maximum flow is found, and the service node is migrated and placed.
  • the elimination circle method is also used to find a new minimum cost maximum flow.
  • Step S543 When the bearing capacity of the edge server node changes, update the location of the service node, which specifically includes:
  • Step S5431 When the capacity of the edge server node is reduced, check whether the flow from the edge server node is larger than the capacity of the corresponding edge after the reduction, specifically:
  • the flow corresponding to the edge with the highest cost in the edge server node will be returned; starting from the corresponding edge service node, select to end The shortest path to the point and increase the flow, and add the migration cost on the edge connecting the service node to the edge server node;
  • Step S5432 When the capacity of the edge server node increases or a new edge server node is added, the residual network is modified, and the migration cost is added on the edge connecting the service node to the edge server node; Starting from the server node, use the circle elimination method to find a new minimum cost and maximum flow, and adjust the service node.
  • the multi-service migration method establishes a minimum cost maximum flow model by constructing a network topology map and generating a shortest path distance matrix. Solve to get the minimum cost and maximum flow, migrate and place the service node, and update the position of the service node every time period. Real-time monitoring and statistics are performed on the access information of each service, and the corresponding service nodes and edge nodes are adjusted when necessary.
  • the embodiment of the present invention can achieve a more balanced placement of virtual services on edge nodes under the condition that only a small part of the access cost is increased, and the balance degree can be adjusted, which is positively correlated with the increased access cost, and can be It is very flexibly adjusted according to the actual needs of users, and can also be adjusted according to the load of each edge node, and can well cope with various situations in large-scale dynamic networks.
  • an embodiment of the present invention further provides a load balancing multi-service migration system based on minimum cost and maximum flow.
  • the system includes the following:
  • Topology map building module It is used to build a network topology map based on the geographical location and connection relationship of edge servers.
  • Matrix generation module used to calculate the shortest path distance between each pair of edge servers in the network topology diagram, and generate a shortest path distance matrix.
  • Model building module used to establish a minimum-cost maximum flow model according to the distance matrix, combined with the access information of each service, the load capacity of each edge server and its relationship with the service delay, and the model includes the source node , service nodes, edge server nodes and edge nodes.
  • Service node migration module used to solve the model to obtain the minimum cost and maximum flow, migrate the service nodes, and place them on the corresponding edge server nodes.
  • Service node update module used to update the access information of each service, adjust the weight of the edge connecting the edge server node to the end node, and update the position of the service node on the edge server node.
  • Monitoring and adjustment module It is used to monitor and count the access information of each service in real time, and adjust the corresponding service nodes and edge server nodes when the change rate of the access information exceeds the set threshold.
  • the service node update module includes:
  • Cost update sub-module used to update the access cost and migration cost of each service node placed on the edge server node in the residual network of the model solving algorithm.
  • Node deletion and addition sub-module It is used to perform corresponding deletion and addition of service nodes and edge server nodes in the residual network according to the updated access information.
  • Weight adjustment sub-module Adjust the weight of the edge connecting the edge server node to the endpoint according to the current edge network index changes and the load of each edge server node.
  • Node update sub-module use the incremental minimum cost and maximum flow algorithm to solve, and update the position of the service node on the edge server node according to the minimum cost and maximum flow obtained by the solution.
  • the system provided in the embodiment of the present invention is specifically used to execute the foregoing method embodiment, which is not repeated in this embodiment of the present invention.
  • FIG. 9 is a schematic diagram of the physical structure of an electronic device according to an embodiment of the present invention.
  • the electronic device may include: a processor (processor) 301, a communications interface (Communications Interface) 302, and a memory (memory) 303 and a communication bus 304 , wherein the processor 301 , the communication interface 302 , and the memory 303 communicate with each other through the communication bus 304 .
  • the processor 301 can call a computer program stored in the memory 303 and run on the processor 301 to execute the methods provided by the above embodiments, for example, including:
  • a minimum cost maximum flow model is established, and the model includes source nodes, service nodes, edge server nodes and endpoints;
  • Update the access information for each service adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node;
  • Real-time monitoring and statistics are performed on the access information of each service.
  • the change rate of the access information exceeds the set threshold, the corresponding service nodes and edge server nodes are adjusted.
  • the above-mentioned logic instructions in the memory 303 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
  • the technical solutions of the embodiments of the present invention are essentially, or the parts that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
  • Embodiments of the present invention further provide a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to perform the methods provided by the foregoing embodiments, for example, including:
  • a minimum cost maximum flow model is established, and the model includes source nodes, service nodes, edge server nodes and endpoints;
  • Update the access information for each service adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node;
  • Real-time monitoring and statistics are performed on the access information of each service.
  • the change rate of the access information exceeds the set threshold, the corresponding service nodes and edge server nodes are adjusted.
  • the device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
  • each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware.
  • the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
  • the method and system for multi-service migration based on load balancing with minimum cost and maximum flow provided by the embodiments of the present invention can obtain an optimal placement and migration strategy that minimizes the overall service access cost, and can also achieve a small increase in access when only a small part of the service access cost is minimized.
  • the placement of services on edge nodes is more balanced, and the degree of balance can be adjusted.
  • the time complexity is much lower than the previous method, and the strategy can be solved in a relatively short time, which is a good response. The sudden increase in the number of service accesses and the abnormal situation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to the technical field of information. Disclosed are a load balancing multi-service migration method and system based on a minimum-cost maximum-flow. Said method comprises: constructing a network topology map according to the geographic position and connection relationship of edge servers; calculating the shortest path distance between each pair of edge servers, and generating a shortest path distance matrix; establishing a minimum-cost maximum-flow model, solving the model to obtain a minimum-cost maximum-flow, and placing a service node on a corresponding edge server node; updating access information of each service, adjusting the weight of the edge, connected to a terminal node, of the edge server node, and updating the position of the service node on the edge server node; and monitoring and collecting statistics of the access information in real time, and when the rate of change of the access information exceeds a set threshold, adjusting the service node and edge server node corresponding thereto. The present invention allows for more balanced, flexible and adjustable placement of a virtual service on an edge node, thereby guaranteeing quick response to a user and improving the service quality.

Description

基于最小费用最大流的负载均衡的多服务迁移方法及系统Multi-service migration method and system based on load balancing with minimum cost and maximum flow 技术领域technical field
本发明涉及信息技术领域,更具体的说,特别涉及一种基于最小费用最大流的负载均衡的多服务迁移方法及系统。The present invention relates to the field of information technology, and more particularly, to a multi-service migration method and system based on load balancing with minimum cost and maximum flow.
背景技术Background technique
移动边缘计算(MEC)是一种新的计算范式,它融合了移动计算和边缘计算的优点,以提高移动用户的服务质量(QoS)。特别是有了MEC,计算资源可以从云中心推至网络边缘,这使得数据服务和其他相关处理任务可以在靠近移动用户的地方运行。因此,它不仅减少了服务延迟,而且使网络流量最小化,这两个好处对于那些有时间限制的服务(移动计算中的典型应用程序)来说都是相当重要的。Mobile edge computing (MEC) is a new computing paradigm that combines the advantages of mobile computing and edge computing to improve the quality of service (QoS) for mobile users. With MEC in particular, computing resources can be pushed from the cloud center to the edge of the network, which enables data services and other related processing tasks to run close to mobile users. Therefore, it not only reduces service latency, but also minimizes network traffic, both benefits of which are quite important for those time-bound services (typical applications in mobile computing).
鉴于其访问效率和低成本的优点,MEC正迅速成为下一波研究的焦点,尤其是在5G网络中更智能和更强大的计算资源,其可以安装在无线网络的边缘,使许多时间敏感服务的部署更加接近用户。但考虑到用户的移动性、对服务访问的时间差异性以及单个边缘服务器的有限覆盖范围,如果同时将多种服务固定在一个边缘服务器上,则会出现资源的争用而导致访问服务延迟的增加。因此,如果不考虑这些因素,所提供的服务可能会显著增加访问延迟,更糟的是,会造成大量网络流量,造成网络拥塞,导致服务地性能下降,甚至是服务中断。Given its advantages of access efficiency and low cost, MEC is quickly becoming the focus of the next wave of research, especially in 5G networks with smarter and more powerful computing resources, which can be installed at the edge of wireless networks, enabling many time-sensitive services deployment is closer to the user. However, considering the mobility of users, the time difference of access to services, and the limited coverage of a single edge server, if multiple services are fixed on one edge server at the same time, there will be resource contention and delay in accessing services. Increase. Therefore, if these factors are not taken into account, the service provided may significantly increase the access delay, and worse, cause a large amount of network traffic, cause network congestion, lead to service performance degradation, or even service interruption.
随着云计算中虚拟化技术的快速发展,越来越多的应用服务以封装在虚拟机或者容器中的形式,在MEC中为用户提供随需应变的移动服务,能够有效缓解上一段提出的问题。在许多场景下,是由大量的移动用户在不同的时间与地点对服务进行访问,因此服务的放置与迁移策略一般不能针对每个用户进行设计,而是依赖于移动访问模式在时空维度上的动态变化。与此同时,服务的迁移也不是免费的,其代价是大量数据传输的成本,并且可能导致服务中断,从而增加总体服务延时。因此,迁移的目标通常是降低迁移成本和服务延迟,同时有着良好的性能保证。With the rapid development of virtualization technology in cloud computing, more and more application services are encapsulated in virtual machines or containers to provide users with on-demand mobile services in MEC, which can effectively alleviate the problems proposed in the previous paragraph. question. In many scenarios, a large number of mobile users access services at different times and places. Therefore, service placement and migration strategies cannot generally be designed for each user, but depend on the time-space dimension of mobile access patterns. Dynamic changes. At the same time, the migration of services is not free, the cost is the cost of large data transfer, and may cause service interruption, thereby increasing the overall service delay. Therefore, the goal of migration is usually to reduce migration cost and service latency, while having good performance guarantees.
传统上,动态规划算法、启发式算法以及机器学习方法经常被用来解决这个问题。但这些方法都具有较高的时间复杂度、空间复杂度以及离线性质。故在网络规模较大时,策略的求解时间过长,不能满足应用的低延时需求。对于用户访问密集的时刻与地点,这些方法也难以应对请求的突然增加和异常情况。同时这些方法也能没考虑到服务迁移的通信代价。Traditionally, dynamic programming algorithms, heuristics, and machine learning methods are often used to solve this problem. But these methods all have high time complexity, space complexity and offline properties. Therefore, when the network scale is large, the solution time of the strategy is too long, which cannot meet the low-latency requirements of the application. These methods are also difficult to cope with sudden increases in requests and abnormal situations when users visit intensive times and places. At the same time, these methods can also ignore the communication cost of service migration.
相比之下,一些在线迁移算法可以在精度和响应时间之间进行权衡。有学者利用了强化学习的方法在很大程度上改善了所存在的问题,但其针对的只是单个服务,而MEC的大多数场景都会涉及多个服务。有人利用了马尔可夫模型,但其针对的是移动云服务中的动态服务问题,其能够得出最佳的迁移策略,但是没有考虑均衡放置的问题。有学者将同样的问题表述为一对一契约博弈模型,并开发了基于学习的价格控制机制,以有效处理MEC的资源。通过运用博弈方法和学习过程,该方法能够通过与未知系统环境的持续交互来获取MEC系统的动态信息。非常可惜的是,它总是需要一段时间来学习,在其收敛之前,决策的质量无法得到保证,也无法实现服务的低延时。In contrast, some online transfer algorithms can trade off between accuracy and response time. Some scholars have used reinforcement learning to improve the existing problems to a great extent, but it is only aimed at a single service, and most scenarios of MEC involve multiple services. Some people use the Markov model, but it is aimed at the dynamic service problem in mobile cloud services, which can derive the best migration strategy, but does not consider the problem of balanced placement. Some scholars have formulated the same problem as a one-to-one contract game model, and developed a learning-based price control mechanism to effectively deal with the resources of MEC. By applying the game method and learning process, the method can acquire the dynamic information of the MEC system through continuous interaction with the unknown system environment. Unfortunately, it always takes a while to learn, and before it converges, the quality of decision-making cannot be guaranteed, and low latency of service cannot be achieved.
现有工作在迁移策略上已经取得了不错的效果,但其往往没有考虑边缘服务器资源有限而发生多个服务争用资源的问题,并且随着人们需求的日益增长,网络规模也随之增长,访问模式也更为复杂,之前的策略难以在大规模的网络拓扑结构下做出最优决策。同时,之前的策略或是针对单服务的迁移,或是缺乏一定的动态性,亦或是求解时间过长。最主要的缺点是不能同时兼顾低服务延迟以及各边缘结点的负载均衡。Existing work has achieved good results in the migration strategy, but it often does not consider the problem of resource contention for multiple services due to limited edge server resources, and with the increasing demand of people, the network scale also increases. The access patterns are also more complex, and the previous strategies are difficult to make optimal decisions under large-scale network topologies. At the same time, the previous strategy was either for the migration of a single service, or lacked a certain degree of dynamism, or the solution time was too long. The main disadvantage is that it cannot take into account low service delay and load balancing of each edge node at the same time.
技术问题technical problem
本发明的目的在于针对现有技术存在的技术问题,提供一种基于最小费用最大流的负载均衡的多服务迁移方法及系统,使得虚拟服务在边缘结点上的放置得更均衡且灵活可调。The purpose of the present invention is to provide a multi-service migration method and system based on load balancing with minimum cost and maximum flow in view of the technical problems existing in the prior art, so that the placement of virtual services on edge nodes is more balanced and flexible and adjustable .
技术解决方案technical solutions
为了解决以上提出的问题,本发明采用的技术方案为:In order to solve the problem proposed above, the technical scheme adopted in the present invention is:
本发明提供一种基于最小费用最大流的负载均衡的多服务迁移方法,该方法具体步骤包括如下:The present invention provides a multi-service migration method based on load balancing with minimum cost and maximum flow. The specific steps of the method include the following steps:
根据边缘服务器的地理位置以及连接关系,构建网络拓扑图;Build a network topology map based on the geographic location and connection relationship of edge servers;
计算每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵;Calculate the shortest path distance between each pair of edge servers and generate a shortest path distance matrix;
根据所述距离矩阵,并结合每个服务的访问信息、每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和终结点;According to the distance matrix, combined with the access information of each service, the carrying capacity of each edge server and its relationship with the service delay, a minimum cost maximum flow model is established, and the model includes source nodes, service nodes, edge server nodes and endpoints;
对模型进行求解得到最小费用最大流,并将服务结点放置在对应的边缘服务器结点上;Solve the model to obtain the minimum cost and maximum flow, and place the service node on the corresponding edge server node;
更新每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置,实现负载均衡;Update the access information of each service, adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node to achieve load balancing;
对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Real-time monitoring and statistics are performed on the access information of each service. When the change rate of the access information exceeds the set threshold, the corresponding service nodes and edge server nodes are adjusted.
进一步的,所述最小费用最大流模型具体为:Further, the minimum cost maximum flow model is specifically:
以S结点与T结点为模型的源结点和终结点,Ni代表第i个服务结点,Ej代表第j个边缘服务器结点,源结点S只与服务结点Ni相连,每个服务结点Ni和所有边缘服务器结点Ej相连,每个边缘服务器结点Ej均与终结点T相连;模型中的每条边均关联容量和通信成本。Taking the S node and the T node as the source node and the end node of the model, Ni represents the ith service node, Ej represents the jth edge server node, the source node S is only connected to the service node Ni, each Each service node Ni is connected to all edge server nodes Ej, and each edge server node Ej is connected to the termination node T; each edge in the model is associated with capacity and communication cost.
进一步的,所述每个边缘服务器结点Ej根据其所能承载服务的数量通过至少两条边与终结点T相连,每条边的成本权值均不同并呈递增关系。Further, each edge server node Ej is connected to the terminal T through at least two edges according to the number of services it can bear, and the cost weights of each edge are different and in an increasing relationship.
进一步的,所述更新服务结点在边缘服务器结点上的位置,具体过程包括:Further, the specific process of updating the position of the service node on the edge server node includes:
在对模型求解算法的残余网络中,更新每个服务结点放置在边缘服务器结点上的访问成本以及迁移成本;In the residual network of the model solving algorithm, update the access cost and migration cost of each service node placed on the edge server node;
根据更新的访问信息,对残余网络中的服务结点以及边缘服务器结点进行相应的删添;According to the updated access information, delete and add corresponding service nodes and edge server nodes in the residual network;
根据当时的边缘网络指标变化以及每个边缘服务器结点的负载情况,调整边缘服务器结点连至终结点的边的权值;Adjust the weight of the edge connecting the edge server node to the endpoint according to the current edge network index changes and the load of each edge server node;
利用增量式最小费用最大流算法进行求解,并根据求解得到的最小费用最大流,更新服务结点在边缘服务器结点上的位置。The incremental minimum cost and maximum flow algorithm is used to solve the problem, and the position of the service node on the edge server node is updated according to the obtained minimum cost and maximum flow.
进一步的,所述增量式最小费用最大流算法,具体包括如下:Further, the incremental minimum cost maximum flow algorithm specifically includes the following:
服务结点的访问量发生改变,并在访问次数的变量大于预先学习得到的阈值时,更新服务结点的位置;The access volume of the service node changes, and when the variable of access times is greater than the pre-learned threshold, the location of the service node is updated;
服务结点的数量改变时,删除服务结点或增加服务结点,并更新服务结点的位置;When the number of service nodes changes, delete service nodes or add service nodes, and update the location of service nodes;
边缘服务器结点的承载量发生改变时,并在边缘服务器结点的容量减小且从其流出的流大于该边减少后的容量或者出现边缘服务器结点删除时、以及边缘服务器结点容量增加或有新的边缘服务器结点添加时,更新服务结点的位置。When the capacity of the edge server node changes, and when the capacity of the edge server node decreases and the flow from it is larger than the reduced capacity of the edge, or when the edge server node is deleted, and when the capacity of the edge server node increases Or when a new edge server node is added, the location of the service node is updated.
进一步的,从所述改变的结点出发,重新寻找新的最小费用最大流,并对服务结点的进行迁移和放置,更新服务结点在边缘服务器结点上的位置。Further, starting from the changed node, re-find a new minimum cost maximum flow, migrate and place the service node, and update the position of the service node on the edge server node.
本发明还提供一种基于最小费用最大流的负载均衡的多服务迁移系统,该系统包括如下:The present invention also provides a load balancing multi-service migration system based on minimum cost and maximum flow, the system includes the following:
拓扑图构建模块:用于根据边缘服务器的地理位置以及连接关系,构建网络拓扑图;Topology map building module: used to build a network topology map according to the geographical location and connection relationship of edge servers;
矩阵生成模块:用于计算出所述网络拓扑图中每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵;Matrix generation module: used to calculate the shortest path distance between each pair of edge servers in the network topology diagram, and generate a shortest path distance matrix;
模型建立模块:用于根据所述距离矩阵,并结合每个服务的访问信息、每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和边缘结点;Model building module: used to establish a minimum-cost maximum flow model according to the distance matrix, combined with the access information of each service, the load capacity of each edge server and its relationship with the service delay, and the model includes the source node , service nodes, edge server nodes and edge nodes;
服务结点迁徙模块:用于对模型进行求解得到最小费用最大流,并对服务结点进行迁移,并将其放置在对应的边缘服务器结点上;Service node migration module: used to solve the model to obtain the minimum cost and maximum flow, migrate the service nodes, and place them on the corresponding edge server nodes;
服务结点更新模块:用于更新对每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置;Service node update module: used to update the access information for each service, adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node;
监控调整模块:用于对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Monitoring and adjustment module: It is used to monitor and count the access information of each service in real time, and adjust the corresponding service nodes and edge server nodes when the change rate of the access information exceeds the set threshold.
进一步的,所述服务结点更新模块包括:Further, the service node update module includes:
成本更新子模块:用于在对模型求解算法的残余网络中,更新每个服务结点放置在边缘服务器结点上的访问成本以及迁移成本;Cost update sub-module: used to update the access cost and migration cost of each service node placed on the edge server node in the residual network of the model solving algorithm;
结点删添子模块:用于根据更新的访问信息,对残余网络中的服务结点以及边缘服务器结点进行相应的删添;Node deletion and addition sub-module: It is used to delete and add service nodes and edge server nodes in the residual network according to the updated access information;
权值调整子模块:根据当时的边缘网络指标变化以及每个边缘服务器结点的负载情况,调整边缘服务器结点连至终结点的边的权值;Weight adjustment sub-module: adjust the weight of the edge connecting the edge server node to the endpoint according to the current edge network index changes and the load of each edge server node;
结点更新子模块:利用增量式最小费用最大流算法进行求解,并根据求解得到的最小费用最大流,更新服务结点在边缘服务器结点上的位置。Node update sub-module: use the incremental minimum cost and maximum flow algorithm to solve, and update the position of the service node on the edge server node according to the minimum cost and maximum flow obtained by the solution.
本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现任一项所述方法的步骤。The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of any one of the methods when the processor executes the program.
本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现任一项所述方法的步骤。The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of any one of the methods are implemented.
有益效果beneficial effect
与现有技术相比,本发明的有益效果在于: Compared with the prior art, the beneficial effects of the present invention are:
本发明提供的多服务迁移方法及系统将边缘网络中访问服务的通信成本问题以及负载均衡问题转化成了最小费用最大流问题,并能够实现在只增加很小一部分访问成本的条件下,使服务在边缘结点上的放置得更均衡并灵活可调,也能够很好的应对服务访问数量突发的放量剧增和异常情况,其简单、可靠也易于实现,保证了对用户的快速响应,提升了服务质量。The multi-service migration method and system provided by the present invention transform the communication cost problem and load balancing problem of accessing services in the edge network into the problem of minimum cost and maximum flow, and can realize that only a small part of the access cost is increased. The placement on the edge nodes is more balanced and flexible, and it can also well cope with the sudden increase in the number of service accesses and abnormal situations. It is simple, reliable and easy to implement, ensuring fast response to users. Improved service quality.
附图说明Description of drawings
为了更清楚地说明本发明中的方案,下面将对实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。其中:In order to illustrate the solutions in the present invention more clearly, the following will briefly introduce the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are some embodiments of the present invention, which are common in the art. As far as technical personnel are concerned, other drawings can also be obtained based on these drawings without any creative effort. in:
图1为本发明负载均衡的多服务迁移方法的流程图。FIG. 1 is a flowchart of a multi-service migration method for load balancing according to the present invention.
图2为本发明虚拟服务迁移的网络拓扑图。FIG. 2 is a network topology diagram of virtual service migration according to the present invention.
图3为本发明最小费用最大流模型的示意图。FIG. 3 is a schematic diagram of the minimum cost maximum flow model of the present invention.
图4为本发明更新服务结点位置的流程图。FIG. 4 is a flow chart of the present invention for updating the location of a service node.
图5为本发明上一次的残余网络的原理图。FIG. 5 is a schematic diagram of the last residual network of the present invention.
图6为本发明修改后的残余网络的原理图。FIG. 6 is a schematic diagram of the modified residual network of the present invention.
图7为本发明负载均衡的多服务迁移系统的原理图。FIG. 7 is a schematic diagram of a multi-service migration system for load balancing according to the present invention.
图8为本发多服务迁移系统中服务结点更新模块的原理图。FIG. 8 is a schematic diagram of a service node update module in the multi-service migration system of the present invention.
图9为本发明电子设备的原理示意图。FIG. 9 is a schematic diagram of the principle of the electronic device of the present invention.
本发明的最佳实施方式BEST MODE FOR CARRYING OUT THE INVENTION
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的较佳实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容的理解更加透彻全面。In order to facilitate understanding of the present invention, the present invention will be described more fully hereinafter with reference to the related drawings. Preferred embodiments of the invention are shown in the accompanying drawings. However, the present invention may be embodied in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that a thorough and complete understanding of the present disclosure is provided.
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terms used herein in the description of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention.
参阅图1所示,本发明提供一种基于最小费用最大流的负载均衡的多服务迁移方法,该方法具体步骤包括如下:Referring to FIG. 1, the present invention provides a load balancing multi-service migration method based on minimum cost and maximum flow, and the specific steps of the method include the following:
步骤S1: 根据边缘服务器的地理位置以及连接关系,构建网络拓扑图。具体的,所述网络拓扑图中边的权值是由所连接的边缘结点间的距离以及网络传输速度决定的。Step S1: Build a network topology map according to the geographic location and connection relationship of the edge server. Specifically, the weight of the edge in the network topology graph is determined by the distance between the connected edge nodes and the network transmission speed.
本发明的应用场景能够抽象成如图2所示的网络拓扑图,由于边缘网络中,虚拟服务运行在边缘结点的服务器上,所以将边缘结点抽象成了边缘服务器结点,即图2中与决策中心连接的边缘服务器1~5,用户可以通过最近的访问接入点1~5,来对自己所需要的服务访问对应的边缘服务器。The application scenario of the present invention can be abstracted into a network topology diagram as shown in Figure 2. In the edge network, the virtual service runs on the server of the edge node, so the edge node is abstracted into the edge server node, that is, Figure 2 Among the edge servers 1 to 5 connected to the decision center, users can access the corresponding edge servers for the services they need through the nearest access points 1 to 5.
步骤S2:计算所述网络拓扑图中每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵。具体的,利用最短路径算法计算得到最短路径距离,方法简单也可靠。Step S2: Calculate the shortest path distance between each pair of edge servers in the network topology diagram, and generate a shortest path distance matrix. Specifically, using the shortest path algorithm to calculate the shortest path distance, the method is simple and reliable.
步骤S3:统计最近时间段内对每个服务的访问信息,根据所述最短路径距离矩阵,并结合每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和终结点。Step S3: Count the access information of each service in the most recent time period, and establish a minimum cost maximum flow model according to the shortest path distance matrix and in combination with the load capacity of each edge server and its relationship with the service delay. The model includes source nodes, service nodes, edge server nodes, and endpoints.
具体的,根据所述最短路径距离矩阵,计算出每个服务放置在各个边缘结点上的访问成本以及迁移成本,并计算各个边缘服务器的承载量与服务延迟的关系,建立最小费用最大流模型。Specifically, according to the shortest path distance matrix, the access cost and migration cost of each service placed on each edge node are calculated, and the relationship between the load capacity of each edge server and the service delay is calculated, and a minimum cost maximum flow model is established. .
本发明实施例中,参阅图3所示,所述最小费用最大流模型具体为:In the embodiment of the present invention, referring to FIG. 3 , the minimum cost maximum flow model is specifically:
以S结点与T结点为模型的源结点和终结点,这是为了构建模型而设置的。Ni代表第i个服务结点,Ej代表第j个边缘服务器结点,其中i为1~n,j为1~m,即一共有n个服务结点和m个边缘服务器结点。源结点S只与服务结点Ni相连,每个服务结点Ni和所有边缘服务器结点Ej相连,每个边缘服务器结点Ej均与终结点T相连。模型中的每条边均关联两个值,分别为容量和通信成本。Take the S node and the T node as the source node and end node of the model, which are set for building the model. Ni represents the ith service node, and Ej represents the jth edge server node, where i is 1 to n, and j is 1 to m, that is, there are a total of n service nodes and m edge server nodes. The source node S is only connected to the service node Ni, each service node Ni is connected to all edge server nodes Ej, and each edge server node Ej is connected to the termination node T. Each edge in the model is associated with two values, capacity and communication cost.
具体的,源结点S与服务结点Ni相连的每条边的容量均为1,这样使得所有服务均能放置在边缘服务器或云中心处,成本均为0。每个服务结点Ni与所有边缘服务器结点Ej相连的边的容量为1,成本即为将服务结点放置在该边缘服务器结点Ej上的延迟成本与迁移成本之和。Specifically, the capacity of each edge connecting the source node S and the service node Ni is 1, so that all services can be placed at the edge server or cloud center, and the cost is 0. The capacity of the edge connecting each service node Ni with all edge server nodes Ej is 1, and the cost is the sum of the delay cost and the migration cost of placing the service node on the edge server node Ej.
进一步的,每个边缘服务器结点Ej根据该边缘服务器结点所能承载服务的数量,并通过数条边(即至少两条边)与终结点T相连,每条边的成本权值均不同并呈递增关系。具体的,每条边的权值可以根据以往放置相应个数服务所产生的延迟和成本来决定,也可以根据用户的需求或者整个边缘网络的实时负载情况来决定。如果每条边的权值全部设置为0,那么得到的结果是理论上的最低总访问延迟,但这时常会出现某些边缘结点上需要放置的服务数量特别多,而其他边缘结点上需要放置的服务数量比较少,甚至为0,这很有可能导致负载量大的边缘结点面临资源争用的情形,这反而会增加服务的延迟,甚至是停机,使得服务质量下降。Further, each edge server node Ej is connected to the terminal T through several edges (that is, at least two edges) according to the number of services that the edge server node can carry, and each edge has a different cost weight. and an increasing relationship. Specifically, the weight of each edge can be determined according to the delay and cost of placing a corresponding number of services in the past, or it can be determined according to the user's needs or the real-time load of the entire edge network. If the weights of each edge are all set to 0, the result is the theoretical minimum total access delay, but it often occurs that the number of services that need to be placed on some edge nodes is particularly large, while other edge nodes are The number of services that need to be placed is relatively small, or even zero, which is likely to cause the edge nodes with heavy load to face resource contention, which will increase the delay of the service, or even cause downtime, which will degrade the quality of service.
本发明实施例中,将那些负载量大的边缘服务器结点上的服务放置在比较空闲的边缘服务器结点上,其服务访问总延迟并不会增加太多。通过在边缘服务器结点连接到终结点的边上增加多条边,即将每个边缘服务器结点到终结点的一条边拆成多条边,边的数目为对应边缘服务器结点所能放置的服务数量,并赋予每条边一定的成本权值,使得服务更趋向于放置在那些负载量小的边缘服务器结点,而不是放置在一些负载量不是很大的边缘结点上,但又不会增加太多理论上的访问成本,从而实现边缘服务器结点的负载均衡,并可以通过对边缘服务器结点到终结点的边上的成本权值进行调节来保证其均衡程度,其能够灵活满足不同用户的需求,并能够应对很多不同的场景。In the embodiment of the present invention, the services on the edge server nodes with heavy load are placed on the relatively idle edge server nodes, and the total service access delay will not increase too much. By adding multiple edges on the edge connecting the edge server node to the endpoint, that is, splitting one edge from each edge server node to the endpoint into multiple edges, and the number of edges is the number that can be placed by the corresponding edge server node. The number of services, and a certain cost weight is given to each edge, so that services are more inclined to be placed on those edge server nodes with low load, rather than on some edge nodes with low load, but no It will increase too much theoretical access cost, so as to achieve load balancing of edge server nodes, and the degree of balance can be ensured by adjusting the cost weight on the edge from the edge server node to the endpoint, which can flexibly meet the The needs of different users, and can deal with many different scenarios.
步骤S4:对模型进行求解得到最小费用最大流,并将服务结点放置在对应的边缘服务器结点上,完成对服务结点进行迁移和放置。Step S4: Solve the model to obtain the minimum cost and maximum flow, and place the service node on the corresponding edge server node to complete the migration and placement of the service node.
具体的,利用经典的最小费用最大流求解算法进行求解,在求解出的最小费用最大流中,若有流从服务结点Ni流经边缘服务器结点Ej,代表将服务结点Ni放置在边缘服务器结点Ej上,并以此对服务结点进行迁移和放置,即根据求解结果可以得到服务结点对应的边缘服务器结点的位置,再对服务结点进行迁移和放置。本发明实施例中,经典的最小费用最大流求解算法采用连续最短路径法、Cost Scaling、放缩法或消圈法,均能够可靠、有效地得到模型的最小费用最大流。Specifically, the classical minimum cost and maximum flow solution algorithm is used to solve the problem. In the solved minimum cost and maximum flow, if there is a flow from the service node Ni through the edge server node Ej, it means that the service node Ni is placed on the edge. On the server node Ej, the service node is migrated and placed, that is, the position of the edge server node corresponding to the service node can be obtained according to the solution result, and then the service node is migrated and placed. In the embodiment of the present invention, the classical minimum cost maximum flow solution algorithm adopts continuous shortest path method, Cost Scaling, scaling method or elimination circle method, all of which can reliably and effectively obtain the minimum cost maximum flow of the model.
步骤S5:更新对每个服务的访问信息,即每隔一时间段重新统计对每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置,实现负载均衡,如附图4所示,具体包括:Step S5: Update the access information for each service, that is, re-statistic the access information for each service every time period, adjust the weight of the edge connecting the edge server node to the endpoint, and update the service node at the edge. The location on the server node to achieve load balancing, as shown in Figure 4, specifically includes:
步骤S51:在对模型求解算法的残余网络中,更新每个服务结点放置在边缘服务器结点上的访问成本以及迁移成本;Step S51: in the residual network of the model solving algorithm, update the access cost and migration cost of each service node placed on the edge server node;
步骤S52:根据更新的访问信息,对残余网络中的服务结点以及边缘服务器结点进行相应的删添;Step S52: according to the updated access information, perform corresponding deletions and additions to the service nodes and edge server nodes in the residual network;
步骤S53:根据当时的边缘网络指标变化以及每个边缘服务器结点的负载情况,调整边缘服务器结点连至终结点的边的权值,使得计算出的放置方案具有一定的倾向性,但又不会增加太多的总访问成本。Step S53: Adjust the weight of the edge connecting the edge server node to the end node according to the current edge network index change and the load of each edge server node, so that the calculated placement scheme has a certain tendency, but Doesn't add much to the total access cost.
步骤S54:利用增量式最小费用最大流算法进行快速求解,根据求解得到的最小费用最大流来对服务结点进行迁移和放置,更新其在边缘服务器结点上的位置。Step S54: Use the incremental minimum cost and maximum flow algorithm to quickly solve the problem, migrate and place the service node according to the obtained minimum cost and maximum flow, and update its position on the edge server node.
本发明实施例中,由于用户对服务的访问模式、边缘结点的资源使用情况以及网络流量会时常发生变化,故可以每隔一段时间对服务的访问信息进行重新统计。按以往的方法,会选择重新执行步骤S3和S4的过程,但这求解时间往往会过长。本发明实施例采用增量式最小费用最大流算法,直接在上一次的残余网络中对相应服务结点及与边缘服务器结点连接的边进行修改,而不是从头开始构建最小费用最大流模型并求解,在修改后的残余网络上执行消圈法,将求解时间减少了8-15倍。In the embodiment of the present invention, since the access mode of the user to the service, the resource usage of the edge node, and the network traffic will change from time to time, the access information of the service may be re-statistical at intervals. According to the previous method, the process of steps S3 and S4 will be chosen to be re-executed, but the solution time is often too long. The embodiment of the present invention adopts the incremental minimum cost maximum flow algorithm, and directly modifies the corresponding service node and the edge connected to the edge server node in the last residual network, instead of constructing the minimum cost maximum flow model from scratch and Solving, performing the deloop method on the modified residual network reduces the solving time by a factor of 8-15.
步骤S6:对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Step S6: Perform real-time monitoring and statistics on the access information of each service, and adjust the corresponding service node and edge server node when the change rate of the access information exceeds the set threshold.
具体的,用户对服务结点的访问数量会出现突发的放量剧增和异常情况,通过监控器对访问信息进行实时的监控和统计。利用强化学习的方法训练出一个最优阈值,当这些监控或者统计的访问信息的变化率超过设定阈值即所述最优阈值时,就立即更新残余网络,并及时调整边缘服务器结点连至终结点的边的权值,可以通过步骤S5中提出的增量式最小费用最大流算法进行求解,并对服务结点和边缘服务器结点进行相应的调整。Specifically, the number of user's access to the service node will have a sudden increase in volume and abnormal situation, and the access information will be monitored and counted in real time through the monitor. An optimal threshold is trained by the reinforcement learning method. When the change rate of the monitored or statistical access information exceeds the set threshold, that is, the optimal threshold, the residual network is immediately updated, and the edge server nodes are adjusted in time to connect to The weight of the edge of the termination point can be solved by the incremental minimum cost maximum flow algorithm proposed in step S5, and the service node and the edge server node are adjusted accordingly.
本发明实施例中,采用增量式最小费用最大流算法对每个服务结点进行更新,具体包括如下:In the embodiment of the present invention, each service node is updated by using the incremental minimum cost maximum flow algorithm, which specifically includes the following:
步骤S541:用户对服务结点的访问量发生改变,并在满足设定条件时,更新服务结点的位置,具体包括:Step S541: The user's access to the service node changes, and when the set conditions are met, the location of the service node is updated, specifically including:
步骤S5411:当访问次数的变量大于预先学习得到的阈值时,在求解算法的上一次残余网络中,对与该服务结点相连边的权值进行修改;否则不修改,可以减少需要修改权值的边的数量。Step S5411: When the variable of the number of visits is greater than the pre-learned threshold, in the last residual network of the solution algorithm, modify the weights of the edges connected to the service node; otherwise, do not modify the weights that need to be modified. the number of sides.
本发明实施例中,考虑到每隔一段时间,对大部分服务结点的访问量会发生变化,又由于用户对一些服务结点的访问次数不会产生太大的变化,故可将访问次数与预先通过机器学习的方法学习得到的最优阈值进行比较,来确定是否需要修改边的权值。进一步的,利用机器学习的方法确定需要修改服务结点关联边权值的阈值,与传统方法不同的是,这是通过机器学习的方法以及以往的数据集训练得到最优阈值。此时得到的阈值能够适应用户的多种访问模式、大规模高频变化的网络结构以及各种异常情况,使得决策中心不会频繁改变残余网络结构,从而减少服务调整次数,提高服务质量。In the embodiment of the present invention, it is considered that the amount of visits to most service nodes will change every period of time, and since the number of visits by users to some service nodes will not change too much, the number of visits can be Compare with the optimal threshold learned by machine learning method in advance to determine whether to modify the weight of the edge. Further, the machine learning method is used to determine the threshold value that needs to be modified for the associated edge weights of the service nodes. Different from the traditional method, the optimal threshold value is obtained through the machine learning method and the previous data set training. The threshold obtained at this time can adapt to various access modes of users, large-scale and high-frequency changing network structure, and various abnormal situations, so that the decision center will not frequently change the residual network structure, thereby reducing the number of service adjustments and improving service quality.
步骤S5412:在服务结点连向边缘服务器结点的边上添加迁移成本,并从费用改变的服务结点出发,重新寻找最小费用最大流。具体的,利用消圈法重新寻找最小费用最大流,由于是在上一阶段最小费用最大流的基础上出发,故能较之其他方案采用消圈法能更快寻找出最优方案。Step S5412: Add a migration cost on the edge connecting the service node to the edge server node, and start from the service node whose cost has changed, and re-find the flow with the minimum cost and the maximum cost. Specifically, using the circle elimination method to find the minimum cost and maximum flow again, because it is based on the minimum cost and maximum flow in the previous stage, the circle elimination method can be used to find the optimal solution faster than other schemes.
步骤S513:根据所得到的最小费用最大流,对服务结点在边缘服务器结点上的位置进行更新。Step S513: Update the position of the service node on the edge server node according to the obtained minimum cost and maximum flow.
本发明实施例中,假设求解算法的上一次部分残余网络见图4,此时服务结点N1到边缘服务器结点E1的边的容量和权值为(0,100),表示已将服务结点N1放置在边缘服务器结点E1上,并生成相应的反向边(1,-100)。同理服务结点Nn分配到了边缘服务器结点E2上。一段时间过后,用户对服务结点N1和Nn的访问次数发生了变化且访问次数大于阈值,则残余网络中相应的边需要修改,修改后的残余网络见图5。In the embodiment of the present invention, it is assumed that the last partial residual network of the solution algorithm is shown in Figure 4. At this time, the capacity and weight of the edge from the service node N1 to the edge server node E1 are (0, 100), indicating that the service node has been The point N1 is placed on the edge server node E1, and the corresponding reverse edge (1, -100) is generated. Similarly, the service node Nn is allocated to the edge server node E2. After a period of time, the number of user visits to service nodes N1 and Nn changes and the number of visits is greater than the threshold, then the corresponding edges in the residual network need to be modified. The modified residual network is shown in Figure 5.
通过图4可以看出,形成了N1→E2→Nn→E1→N1的负环,可利用消圈法从服务结点N1开始消圈,直至残余网络中不存在负圈,此时达到最大流最小费用。It can be seen from Figure 4 that a negative ring of N1→E2→Nn→E1→N1 is formed, and the circle elimination method can be used to eliminate the circle from the service node N1 until there is no negative circle in the residual network. At this time, the maximum flow rate is reached. Minimum fee.
步骤S542:服务结点的数量改变时,删除服务结点或增加服务结点,并更新服务结点的位置,具体包括:Step S542: when the number of service nodes changes, delete service nodes or add service nodes, and update the locations of service nodes, specifically including:
当有服务结点减少时,在残余网络中删除所述服务结点以及相关的边;When there are fewer service nodes, delete the service nodes and related edges in the residual network;
当有服务结点增加时,在残余网络中添加所述服务结点以及相关的边,选择该服务结点到边缘服务器结点的最小费用路径,进行流的添加达到最大流,从而实现所有服务结点的放置;在服务结点连向边缘服务器结点的边上添加迁移成本;When a service node is added, the service node and related edges are added to the residual network, the minimum cost path from the service node to the edge server node is selected, and the flow is added to reach the maximum flow, thereby realizing all services. Node placement; add migration costs on the edge where service nodes connect to edge server nodes;
从所述删减或增加的服务结点出发,并流向边缘服务器结点,寻找新的最小费用最大流,并对服务结点的进行迁移和放置。具体的,也采用消圈法寻找新的最小费用最大流。Starting from the deleted or added service node, and flowing to the edge server node, a new minimum cost maximum flow is found, and the service node is migrated and placed. Specifically, the elimination circle method is also used to find a new minimum cost maximum flow.
步骤S543:边缘服务器结点的承载量发生改变时,更新服务结点的位置,具体包括:Step S543: When the bearing capacity of the edge server node changes, update the location of the service node, which specifically includes:
步骤S5431:当边缘服务器结点的容量减小时,检查从该边缘服务器结点流出的流是否大于对应边减少后的容量,具体为:Step S5431: When the capacity of the edge server node is reduced, check whether the flow from the edge server node is larger than the capacity of the corresponding edge after the reduction, specifically:
若流出的流仍小于该边减少后的容量,则只改变残余网络中该边的容量,残余网络不进行调整;If the outgoing flow is still less than the reduced capacity of the edge, only the capacity of the edge in the residual network will be changed, and the residual network will not be adjusted;
若流出的流大于该边减少后的容量或者出现边缘服务器结点删除时,则将流入该边缘服务器结点中费用最大的边对应的流退回;从对应的边缘服务结点出发,选择到终结点的最短路径并增加流,并在服务结点连向边缘服务器结点的边上添加迁移成本;If the outgoing flow is larger than the reduced capacity of the edge or the edge server node is deleted, the flow corresponding to the edge with the highest cost in the edge server node will be returned; starting from the corresponding edge service node, select to end The shortest path to the point and increase the flow, and add the migration cost on the edge connecting the service node to the edge server node;
从对应的服务结点出发,利用消圈法寻找新的最小费用最大流,并以此对服务结点的进行迁移和放置,更新服务结点的位置;Starting from the corresponding service node, use the circle elimination method to find a new minimum cost and maximum flow, and use this to migrate and place the service node, and update the location of the service node;
步骤S5432:当边缘服务器结点容量增加或有新的边缘服务器结点添加时,则对残余网络进行修改,并在服务结点连向边缘服务器结点的边上添加迁移成本;从对应的边缘服务器结点出发,利用消圈法寻找新的最小费用最大流,并对服务结点进行调整。Step S5432: When the capacity of the edge server node increases or a new edge server node is added, the residual network is modified, and the migration cost is added on the edge connecting the service node to the edge server node; Starting from the server node, use the circle elimination method to find a new minimum cost and maximum flow, and adjust the service node.
本发明实施例提供的多服务迁移方法,通过构建网络拓扑图,并生成最短路径距离矩阵,从而建立最小费用最大流模型。求解得到最小费用最大流,对服务结点进行迁移和放置,并在每隔一时间段更新服务结点的位置。对每个服务的访问信息进行实时的监控和统计,需要时调整其对应的服务结点和边缘结点。本发明实施例能够实现在只增加很小一部分访问成本的条件下,使得虚拟服务在边缘结点上的放置得更均衡,并且均衡程度是可以调节的,其与增加的访问成本呈正相关,可以非常灵活地根据用户的实际需求来进行相应的调节,也可以根据各个边缘结点的负载情况进行调节,并能够很好地应对大规模动态网络出现的各种情况。The multi-service migration method provided by the embodiment of the present invention establishes a minimum cost maximum flow model by constructing a network topology map and generating a shortest path distance matrix. Solve to get the minimum cost and maximum flow, migrate and place the service node, and update the position of the service node every time period. Real-time monitoring and statistics are performed on the access information of each service, and the corresponding service nodes and edge nodes are adjusted when necessary. The embodiment of the present invention can achieve a more balanced placement of virtual services on edge nodes under the condition that only a small part of the access cost is increased, and the balance degree can be adjusted, which is positively correlated with the increased access cost, and can be It is very flexibly adjusted according to the actual needs of users, and can also be adjusted according to the load of each edge node, and can well cope with various situations in large-scale dynamic networks.
参阅图7所示,本发明实施例还提供一种基于最小费用最大流的负载均衡的多服务迁移系统,该系统包括如下:Referring to FIG. 7 , an embodiment of the present invention further provides a load balancing multi-service migration system based on minimum cost and maximum flow. The system includes the following:
拓扑图构建模块:用于根据边缘服务器的地理位置以及连接关系,构建网络拓扑图。Topology map building module: It is used to build a network topology map based on the geographical location and connection relationship of edge servers.
矩阵生成模块:用于计算出所述网络拓扑图中每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵。Matrix generation module: used to calculate the shortest path distance between each pair of edge servers in the network topology diagram, and generate a shortest path distance matrix.
模型建立模块:用于根据所述距离矩阵,并结合每个服务的访问信息、每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和边缘结点。Model building module: used to establish a minimum-cost maximum flow model according to the distance matrix, combined with the access information of each service, the load capacity of each edge server and its relationship with the service delay, and the model includes the source node , service nodes, edge server nodes and edge nodes.
服务结点迁徙模块:用于对模型进行求解得到最小费用最大流,并对服务结点进行迁移,并将其放置在对应的边缘服务器结点上。Service node migration module: used to solve the model to obtain the minimum cost and maximum flow, migrate the service nodes, and place them on the corresponding edge server nodes.
服务结点更新模块:用于更新对每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置。Service node update module: used to update the access information of each service, adjust the weight of the edge connecting the edge server node to the end node, and update the position of the service node on the edge server node.
监控调整模块:用于对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Monitoring and adjustment module: It is used to monitor and count the access information of each service in real time, and adjust the corresponding service nodes and edge server nodes when the change rate of the access information exceeds the set threshold.
进一步的,参阅图8所示,所述服务结点更新模块包括:Further, referring to Fig. 8, the service node update module includes:
成本更新子模块:用于在对模型求解算法的残余网络中,更新每个服务结点放置在边缘服务器结点上的访问成本以及迁移成本。Cost update sub-module: used to update the access cost and migration cost of each service node placed on the edge server node in the residual network of the model solving algorithm.
结点删添子模块:用于根据更新的访问信息,对残余网络中的服务结点以及边缘服务器结点进行相应的删添。Node deletion and addition sub-module: It is used to perform corresponding deletion and addition of service nodes and edge server nodes in the residual network according to the updated access information.
权值调整子模块:根据当时的边缘网络指标变化以及每个边缘服务器结点的负载情况,调整边缘服务器结点连至终结点的边的权值。Weight adjustment sub-module: Adjust the weight of the edge connecting the edge server node to the endpoint according to the current edge network index changes and the load of each edge server node.
结点更新子模块:利用增量式最小费用最大流算法进行求解,并根据求解得到的最小费用最大流,更新服务结点在边缘服务器结点上的位置。Node update sub-module: use the incremental minimum cost and maximum flow algorithm to solve, and update the position of the service node on the edge server node according to the minimum cost and maximum flow obtained by the solution.
具体地,本发明实施例提供的系统具体用于执行上述方法实施例,本发明实施例对此不再进行赘述。Specifically, the system provided in the embodiment of the present invention is specifically used to execute the foregoing method embodiment, which is not repeated in this embodiment of the present invention.
图9为本发明实施例提供的一种电子设备的实体结构示意图,如图9所示,该电子设备可以包括:处理器(processor)301、通信接口(Communications Interface)302、存储器(memory)303和通信总线304,其中,处理器301,通信接口302,存储器303通过通信总线304完成相互间的通信。处理器301可以调用存储在存储器303上并可在处理器301上运行的计算机程序,以执行上述各实施例提供的方法,例如包括:FIG. 9 is a schematic diagram of the physical structure of an electronic device according to an embodiment of the present invention. As shown in FIG. 9 , the electronic device may include: a processor (processor) 301, a communications interface (Communications Interface) 302, and a memory (memory) 303 and a communication bus 304 , wherein the processor 301 , the communication interface 302 , and the memory 303 communicate with each other through the communication bus 304 . The processor 301 can call a computer program stored in the memory 303 and run on the processor 301 to execute the methods provided by the above embodiments, for example, including:
根据边缘服务器的地理位置以及连接关系,构建网络拓扑图;Build a network topology map based on the geographic location and connection relationship of edge servers;
计算每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵;Calculate the shortest path distance between each pair of edge servers and generate a shortest path distance matrix;
根据所述距离矩阵,并结合每个服务的访问信息、每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和终结点;According to the distance matrix, combined with the access information of each service, the carrying capacity of each edge server and its relationship with the service delay, a minimum cost maximum flow model is established, and the model includes source nodes, service nodes, edge server nodes and endpoints;
对模型进行求解得到最小费用最大流,并将服务结点放置在对应的边缘服务器结点上;Solve the model to obtain the minimum cost and maximum flow, and place the service node on the corresponding edge server node;
更新对每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置;Update the access information for each service, adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node;
对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Real-time monitoring and statistics are performed on the access information of each service. When the change rate of the access information exceeds the set threshold, the corresponding service nodes and edge server nodes are adjusted.
此外,上述的存储器303中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the memory 303 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solutions of the embodiments of the present invention are essentially, or the parts that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的方法,例如包括:Embodiments of the present invention further provide a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to perform the methods provided by the foregoing embodiments, for example, including:
根据边缘服务器的地理位置以及连接关系,构建网络拓扑图;Build a network topology map based on the geographic location and connection relationship of edge servers;
计算每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵;Calculate the shortest path distance between each pair of edge servers and generate a shortest path distance matrix;
根据所述距离矩阵,并结合每个服务的访问信息、每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和终结点;According to the distance matrix, combined with the access information of each service, the carrying capacity of each edge server and its relationship with the service delay, a minimum cost maximum flow model is established, and the model includes source nodes, service nodes, edge server nodes and endpoints;
对模型进行求解得到最小费用最大流,并将服务结点放置在对应的边缘服务器结点上;Solve the model to obtain the minimum cost and maximum flow, and place the service node on the corresponding edge server node;
更新对每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置;Update the access information for each service, adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node;
对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Real-time monitoring and statistics are performed on the access information of each service. When the change rate of the access information exceeds the set threshold, the corresponding service nodes and edge server nodes are adjusted.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
本发明实施例提供的基于最小费用最大流的负载均衡的多服务迁移方法及系统,能够得到使整体服务访问成本最小化的最优放置与迁移策略,同时也能实现在只增加很小一部分访问成本的条件下,服务在边缘结点上的放置得更均衡,并且均衡程度是可以调节的,时间复杂度相比之前的方法低很多,能在较短时间内求解出策略,很好的应对了服务访问数量突发的放量剧增和异常情况。The method and system for multi-service migration based on load balancing with minimum cost and maximum flow provided by the embodiments of the present invention can obtain an optimal placement and migration strategy that minimizes the overall service access cost, and can also achieve a small increase in access when only a small part of the service access cost is minimized. Under the condition of cost, the placement of services on edge nodes is more balanced, and the degree of balance can be adjusted. The time complexity is much lower than the previous method, and the strategy can be solved in a relatively short time, which is a good response. The sudden increase in the number of service accesses and the abnormal situation.
上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited by the above-mentioned embodiments, and any other changes, modifications, substitutions, combinations, The simplification should be equivalent replacement manners, which are all included in the protection scope of the present invention.

Claims (10)

  1. 一种基于最小费用最大流的负载均衡的多服务迁移方法,其特征在于:该方法具体步骤包括如下:A multi-service migration method based on load balancing with minimum cost and maximum flow, characterized in that the specific steps of the method include the following:
    根据边缘服务器的地理位置以及连接关系,构建网络拓扑图;Build a network topology map based on the geographic location and connection relationship of edge servers;
    计算每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵;Calculate the shortest path distance between each pair of edge servers and generate a shortest path distance matrix;
    根据所述距离矩阵,并结合每个服务的访问信息、每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和终结点;According to the distance matrix, combined with the access information of each service, the carrying capacity of each edge server and its relationship with the service delay, a minimum cost maximum flow model is established, and the model includes source nodes, service nodes, edge server nodes and endpoints;
    对模型进行求解得到最小费用最大流,并将服务结点放置在对应的边缘服务器结点上;Solve the model to obtain the minimum cost and maximum flow, and place the service node on the corresponding edge server node;
    更新每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置,实现负载均衡;Update the access information of each service, adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node to achieve load balancing;
    对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Real-time monitoring and statistics are performed on the access information of each service. When the change rate of the access information exceeds the set threshold, the corresponding service nodes and edge server nodes are adjusted.
  2. 根据权利要求1所述的基于最小费用最大流的负载均衡的多服务迁移方法,其特征在于:所述最小费用最大流模型具体为:The multi-service migration method based on load balancing of minimum cost and maximum flow according to claim 1, wherein the minimum cost and maximum flow model is specifically:
    以S结点与T结点为模型的源结点和终结点,Ni代表第i个服务结点,Ej代表第j个边缘服务器结点,源结点S只与服务结点Ni相连,每个服务结点Ni和所有边缘服务器结点Ej相连,每个边缘服务器结点Ej均与终结点T相连;模型中的每条边均关联容量和通信成本。Taking the S node and the T node as the source node and the end node of the model, Ni represents the ith service node, Ej represents the jth edge server node, the source node S is only connected to the service node Ni, each Each service node Ni is connected to all edge server nodes Ej, and each edge server node Ej is connected to the termination node T; each edge in the model is associated with capacity and communication cost.
  3. 根据权利要求2所述的基于最小费用最大流的负载均衡的多服务迁移方法,其特征在于:所述每个边缘服务器结点Ej根据其所能承载服务的数量通过至少两条边与终结点T相连,每条边的成本权值均不同并呈递增关系。The multi-service migration method based on load balancing with minimum cost and maximum flow according to claim 2, wherein each edge server node Ej passes through at least two edges and a termination point according to the number of services it can bear T are connected, and the cost weights of each edge are different and have an increasing relationship.
  4. 根据权利要求2所述的基于最小费用最大流的负载均衡的多服务迁移方法,其特征在于:所述更新服务结点在边缘服务器结点上的位置,具体过程包括:The multi-service migration method based on load balancing with minimum cost and maximum flow according to claim 2, characterized in that: the specific process of updating the position of the service node on the edge server node includes:
    在对模型求解算法的残余网络中,更新每个服务结点放置在边缘服务器结点上的访问成本以及迁移成本;In the residual network of the model solving algorithm, update the access cost and migration cost of each service node placed on the edge server node;
    根据更新的访问信息,对残余网络中的服务结点以及边缘服务器结点进行相应的删添;According to the updated access information, delete and add corresponding service nodes and edge server nodes in the residual network;
    根据当时的边缘网络指标变化以及每个边缘服务器结点的负载情况,调整边缘服务器结点连至终结点的边的权值;Adjust the weight of the edge connecting the edge server node to the endpoint according to the current edge network index changes and the load of each edge server node;
    利用增量式最小费用最大流算法进行求解,并根据求解得到的最小费用最大流,更新服务结点在边缘服务器结点上的位置。The incremental minimum cost and maximum flow algorithm is used to solve the problem, and the position of the service node on the edge server node is updated according to the obtained minimum cost and maximum flow.
  5. 根据权利要求4所述的基于最小费用最大流的负载均衡的多服务迁移方法,其特征在于:所述增量式最小费用最大流算法,具体包括如下:The multi-service migration method based on load balancing with minimum cost and maximum flow according to claim 4, wherein the incremental minimum cost and maximum flow algorithm specifically includes the following:
    服务结点的访问量发生改变,并在访问次数的变量大于预先学习得到的阈值时,更新服务结点的位置;The access volume of the service node changes, and when the variable of access times is greater than the pre-learned threshold, the location of the service node is updated;
    服务结点的数量改变时,删除服务结点或增加服务结点,并更新服务结点的位置;When the number of service nodes changes, delete service nodes or add service nodes, and update the location of service nodes;
    边缘服务器结点的承载量发生改变时,并在边缘服务器结点的容量减小且从其流出的流大于该边减少后的容量或者出现边缘服务器结点删除时、以及边缘服务器结点容量增加或有新的边缘服务器结点添加时,更新服务结点的位置。When the capacity of the edge server node changes, and when the capacity of the edge server node decreases and the flow from it is larger than the reduced capacity of the edge, or when the edge server node is deleted, and when the capacity of the edge server node increases Or when a new edge server node is added, the location of the service node is updated.
  6. 根据权利要求5所述的基于最小费用最大流的负载均衡的多服务迁移方法,其特征在于:从所述改变的结点出发,重新寻找新的最小费用最大流,并对服务结点的进行迁移和放置,更新服务结点在边缘服务器结点上的位置。The load balancing multi-service migration method based on the minimum cost and maximum flow according to claim 5, characterized in that: starting from the changed node, re-find a new minimum cost and maximum flow, and carry out the process for the service node. Migration and placement, updating the location of service nodes on edge server nodes.
  7. 一种基于最小费用最大流的负载均衡的多服务迁移系统,其特征在于:该系统包括如下:A load balancing multi-service migration system based on minimum cost and maximum flow, characterized in that: the system includes the following:
    拓扑图构建模块:用于根据边缘服务器的地理位置以及连接关系,构建网络拓扑图;Topology map building module: used to build a network topology map according to the geographical location and connection relationship of edge servers;
    矩阵生成模块:用于计算出所述网络拓扑图中每一对边缘服务器间的最短路径距离,并生成最短路径距离矩阵;Matrix generation module: used to calculate the shortest path distance between each pair of edge servers in the network topology diagram, and generate a shortest path distance matrix;
    模型建立模块:用于根据所述距离矩阵,并结合每个服务的访问信息、每个边缘服务器的承载量及其与服务延迟的关系,建立最小费用最大流模型,所述模型包括源结点、服务结点、边缘服务器结点和边缘结点;Model building module: used to establish a minimum-cost maximum flow model according to the distance matrix, combined with the access information of each service, the load capacity of each edge server and its relationship with the service delay, and the model includes the source node , service nodes, edge server nodes and edge nodes;
    服务结点迁徙模块:用于对模型进行求解得到最小费用最大流,并对服务结点进行迁移,并将其放置在对应的边缘服务器结点上;Service node migration module: used to solve the model to obtain the minimum cost and maximum flow, migrate the service nodes, and place them on the corresponding edge server nodes;
    服务结点更新模块:用于更新对每个服务的访问信息,调整边缘服务器结点连至终结点的边的权值,并更新服务结点在边缘服务器结点上的位置;Service node update module: used to update the access information for each service, adjust the weight of the edge connecting the edge server node to the endpoint, and update the position of the service node on the edge server node;
    监控调整模块:用于对每个服务的访问信息进行实时的监控和统计,在访问信息的变化率超过设定阈值时,调整其对应的服务结点和边缘服务器结点。Monitoring and adjustment module: It is used to monitor and count the access information of each service in real time, and adjust the corresponding service nodes and edge server nodes when the change rate of the access information exceeds the set threshold.
  8. 根据权利要求7所述的基于最小费用最大流的负载均衡的多服务迁移系统,其特征在于:所述服务结点更新模块包括:The load balancing multi-service migration system based on the minimum cost and maximum flow according to claim 7, wherein the service node update module comprises:
    成本更新子模块:用于在对模型求解算法的残余网络中,更新每个服务结点放置在边缘服务器结点上的访问成本以及迁移成本;Cost update sub-module: used to update the access cost and migration cost of each service node placed on the edge server node in the residual network of the model solving algorithm;
    结点删添子模块:用于根据更新的访问信息,对残余网络中的服务结点以及边缘服务器结点进行相应的删添;Node deletion and addition sub-module: It is used to delete and add service nodes and edge server nodes in the residual network according to the updated access information;
    权值调整子模块:根据当时的边缘网络指标变化以及每个边缘服务器结点的负载情况,调整边缘服务器结点连至终结点的边的权值;Weight adjustment sub-module: adjust the weight of the edge connecting the edge server node to the endpoint according to the current edge network index changes and the load of each edge server node;
    结点更新子模块:利用增量式最小费用最大流算法进行求解,并根据求解得到的最小费用最大流,更新服务结点在边缘服务器结点上的位置。Node update sub-module: use the incremental minimum cost and maximum flow algorithm to solve, and update the position of the service node on the edge server node according to the minimum cost and maximum flow obtained by the solution.
  9. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至7任一项所述方法的步骤。An electronic device, comprising a memory, a processor and a computer program stored on the memory and running on the processor, characterized in that, when the processor executes the program, the program as claimed in any one of claims 1 to 7 is implemented. steps of the method described.
  10. 一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1至7任一项所述方法的步骤。A non-transitory computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
PCT/CN2020/138815 2020-12-10 2020-12-24 Load balancing multi-service migration method and system based on minimum-cost maximum-flow WO2022120959A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011436474.2A CN112601232B (en) 2020-12-10 2020-12-10 Load balancing multi-service migration method and system based on minimum cost and maximum flow
CN202011436474.2 2020-12-10

Publications (1)

Publication Number Publication Date
WO2022120959A1 true WO2022120959A1 (en) 2022-06-16

Family

ID=75191543

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/138815 WO2022120959A1 (en) 2020-12-10 2020-12-24 Load balancing multi-service migration method and system based on minimum-cost maximum-flow

Country Status (2)

Country Link
CN (1) CN112601232B (en)
WO (1) WO2022120959A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117973812A (en) * 2024-03-29 2024-05-03 北京卓导科技有限公司 Enterprise informatization management platform and method based on big data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019199362A1 (en) * 2018-04-11 2019-10-17 Intel IP Corporation Flexible multi-access edge computing (mec) services consumption through hosts zoning
CN111148174A (en) * 2019-12-13 2020-05-12 北京邮电大学 Service migration path selection method in mobile edge calculation
CN111443990A (en) * 2020-03-25 2020-07-24 中南大学 Edge calculation task migration simulation system
CN112015518A (en) * 2020-08-27 2020-12-01 山东大学 Method and system for realizing real-time migration of multiple virtual machines in incremental deployment SDN environment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708625A (en) * 2016-12-08 2017-05-24 中国科学院软件研究所 Minimum-cost maximum-flow based large-scale resource scheduling system and minimum-cost maximum-flow based large-scale resource scheduling method
US10951317B2 (en) * 2017-07-20 2021-03-16 Huawei Technologies Canada Co., Ltd. Multi-layer virtual network embedding
US10700964B1 (en) * 2019-01-04 2020-06-30 Dropbox, Inc. Centralized application-layer routing at the edge of an online application service provider network
CN109800072B (en) * 2019-01-22 2021-07-09 深圳市简智联信息科技有限公司 Task scheduling optimization method and device based on edge calculation
CN111045822B (en) * 2019-12-07 2023-12-29 深圳先进技术研究院 Service migration method, system and terminal equipment in mobile cloud computing
CN111124639B (en) * 2019-12-11 2023-05-23 安徽大学 Operation method and system of edge computing system and electronic equipment
CN111147604B (en) * 2019-12-31 2022-03-29 重庆邮电大学 Load balancing method for edge calculation of Internet of vehicles
CN111835819B (en) * 2020-05-07 2023-04-18 东南大学 Regional hierarchical task migration method in mobile edge computing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019199362A1 (en) * 2018-04-11 2019-10-17 Intel IP Corporation Flexible multi-access edge computing (mec) services consumption through hosts zoning
CN111148174A (en) * 2019-12-13 2020-05-12 北京邮电大学 Service migration path selection method in mobile edge calculation
CN111443990A (en) * 2020-03-25 2020-07-24 中南大学 Edge calculation task migration simulation system
CN112015518A (en) * 2020-08-27 2020-12-01 山东大学 Method and system for realizing real-time migration of multiple virtual machines in incremental deployment SDN environment

Also Published As

Publication number Publication date
CN112601232B (en) 2022-04-26
CN112601232A (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN111953758B (en) Edge network computing unloading and task migration method and device
CN113708972B (en) Service function chain deployment method and device, electronic equipment and storage medium
US11784931B2 (en) Network burst load evacuation method for edge servers
US11831708B2 (en) Distributed computation offloading method based on computation-network collaboration in stochastic network
CN109257287A (en) A kind of shortest path determines method and controller
WO2020220430A1 (en) Traffic limiting method and system
Chen et al. ALBRL: Automatic Load‐Balancing Architecture Based on Reinforcement Learning in Software‐Defined Networking
EP4024212B1 (en) Method for scheduling inference workloads on edge network resources
Xu et al. An actor-critic-based transfer learning framework for experience-driven networking
CN110247795A (en) A kind of cloud net resource service chain method of combination and system based on intention
WO2022120953A1 (en) Virtual service migration method and system based on incremental minimum-cost maximum-flow
CN113076177A (en) Dynamic migration method of virtual machine in edge computing environment
Kim et al. Adaptive packet scheduling in IoT environment based on Q-learning
Li et al. DQN-enabled content caching and quantum ant colony-based computation offloading in MEC
Xu et al. ReCARL: resource allocation in cloud RANs with deep reinforcement learning
WO2022120959A1 (en) Load balancing multi-service migration method and system based on minimum-cost maximum-flow
CN110971451B (en) NFV resource allocation method
CN110768827B (en) Task unloading method based on group intelligent algorithm
Yuan et al. A DRL-Based Container Placement Scheme with Auxiliary Tasks.
WO2022166348A1 (en) Routing method, routing apparatus, controller and computer-readable storage medium
CN114785692A (en) Virtual power plant aggregation regulation and control communication network flow balancing method and device
CN114116052A (en) Edge calculation method and device
Cong et al. A deep reinforcement learning-based routing scheme with two modes for dynamic networks
Chen et al. B-scale: Bottleneck-aware VNF scaling and flow routing in edge clouds
CN113596138A (en) Heterogeneous information center network cache allocation method based on deep reinforcement learning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20964888

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20964888

Country of ref document: EP

Kind code of ref document: A1