Container deployment method and device, deployment equipment, storage medium and program product

By combining the football team training algorithm and the ant colony algorithm, the problems of slow iteration calculation speed and large network communication overhead in the container deployment algorithm are solved, and the effect of improving iteration calculation speed and reducing network communication overhead is achieved.

CN119854144APending Publication Date: 2025-04-18ZGC INSTITUTE OF UBIQUITOUS-X INNOVATION & APPLICATIONS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411047124.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing container deployment algorithms have problems such as slow iteration computing speed and large network communication overhead.

Method used

Combining the football team training algorithm and ant colony algorithm, the alternative master nodes in multiple container nodes are determined through the football team training algorithm, and the ant colony algorithm is used for iterative calculations, alternative working nodes are determined, and the container nodes to be deployed are finally determined.

Benefits of technology

It improves the iterative computing speed, reduces the network communication overhead between nodes after the container's distributed deployment, and avoids the problem that the ant colony algorithm is prone to fall into local optimal solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854144A_ABST
    Figure CN119854144A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a container deployment method and device, deployment equipment, a storage medium and a program product, and is applied to the technical field of wireless. The method comprises the following steps: training deployment parameters of a plurality of container nodes by adopting a football team training algorithm to obtain N1 container nodes in the plurality of container nodes as alternative main nodes; according to the deployment parameters of the N1 alternative main nodes, carrying out iterative computation by adopting an ant colony algorithm to obtain N2 container nodes except the N1 alternative main nodes in the plurality of container nodes as alternative working nodes; and determining N container nodes with the shortest connection path on a plurality of connection paths between the alternative main node and the alternative working node as to-be-deployed container nodes. By adopting the method, the football team training algorithm and the ant colony algorithm are combined, so that the effects of improving the iterative computation speed and reducing the network communication overhead between the nodes after the distributed deployment of the container can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of wireless technology, and in particular to a container deployment method, apparatus, deployment device, storage medium, and program product. Background Art

[0002] Container technology has become the most promising lightweight virtualization technology for providing cloud services due to its many features such as shared host OS, fast startup time, portability, scalability and rapid deployment.

[0003] Distributed container deployment mostly uses multi-node deployment, including Master nodes and Worker nodes. The Master node is the control center of the container cluster, responsible for the management and scheduling of the entire cluster. The Worker node is the node that actually runs the application in the container cluster, also known as the Node node, responsible for executing the tasks assigned by the Master node and reporting the node status and resource usage to the Master node.

[0004] Existing container deployment algorithms include particle swarm algorithm, artificial fish swarm algorithm and genetic algorithm, but these algorithms in the prior art all have the problem of slow iterative calculation speed and excessive network communication overhead during node deployment. Summary of the invention

[0005] The purpose of the technical solution of this application is to provide a container deployment method, apparatus, deployment equipment, storage medium and program product, which are used to solve the problems of slow iterative calculation speed and high network communication overhead of the container deployment algorithm using the existing technology.

[0006] One embodiment of the present application provides a container deployment method, which includes:

[0007] Using a football team training algorithm, the deployment parameters of multiple container nodes are trained to obtain N1 container nodes among the multiple container nodes as candidate master nodes; wherein N1 is an integer greater than or equal to 1;

[0008] According to the deployment parameters of the N1 candidate master nodes, an ant colony algorithm is used to perform iterative calculation to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes; N2 is an integer greater than or equal to 1;

[0009] Determine that N container nodes with the shortest connection paths on multiple connection paths between the candidate master node and the candidate working node are container nodes to be deployed; wherein N is an integer greater than or equal to 1, and the sum of N1 and N2 is greater than N.

[0010] Optionally, the container deployment method further comprises:

[0011] After each iterative calculation using the ant colony algorithm, a different weight value is set for each connection path according to the order of the path lengths of the multiple connection paths between the candidate master node and the candidate working node from short to long; wherein the shorter the path length of the connection path, the greater the corresponding weight value;

[0012] When the ant colony algorithm is used for the next iterative calculation, the container nodes on each connection path are calculated in sequence according to the arrangement order of the corresponding weight values ​​from large to small.

[0013] Optionally, the container deployment method further comprises:

[0014] After obtaining N2 candidate working nodes, the connection status information of each candidate working node is compared with the connection status information of the corresponding candidate master node within a preset range;

[0015] In the case that the connection status information of the candidate working node is better than the connection status information of the corresponding candidate master node, the candidate working node replaces the corresponding candidate master node as the candidate master node.

[0016] Optionally, the container deployment method, wherein a football team training algorithm is used to train deployment parameters of multiple container nodes, includes:

[0017] The football team training algorithm is adopted, and multiple container nodes act as different roles in the collective training process to train the deployment parameters of multiple container nodes.

[0018] Optionally, the container deployment method further comprises:

[0019] In the process of training the deployment parameters of multiple container nodes, the moving step size of the container node that follows the best node role is adjusted according to the number of updates of the optimal fitness value of the function in the collective training process before the current training calculation.

[0020] Optionally, the container deployment method, wherein, according to the number of updates of the optimal fitness value of the function in the collective training process before the current training calculation, adjusting the moving step length of the container node as the role of following the best node, comprises:

[0021] When the current moving step length is greater than the minimum moving step length and the number of updates of the optimal fitness value of the function before the current training calculation is greater than the update number threshold, the current moving step length is increased according to a preset adjustment factor to obtain an adjusted moving step length;

[0022] When the current moving step length is greater than the minimum moving step length and the number of updates of the function's optimal fitness value before the current training calculation is less than or equal to the update number threshold, the current moving step length is reduced according to a preset adjustment factor to obtain an adjusted moving step length.

[0023] Optionally, the container deployment method further comprises:

[0024] In the process of training the deployment parameters of multiple container nodes, the Levy flight strategy is adopted to adjust the fluctuation amplitude of the container nodes that play the role of fluctuation finding.

[0025] Optionally, the container deployment method, wherein, in the process of training the deployment parameters of the plurality of container nodes, the Levy flight strategy is adopted to adjust the fluctuation amplitude of the container node as the fluctuation search role, including:

[0026] In the process of training the deployment parameters of multiple container nodes, the fluctuation amplitude of the container node as the fluctuation-seeking role after the t-th iterative calculation is determined according to the path and step scaling factor that obeys the Levy flight strategy, and the fluctuation amplitude of the container node as the fluctuation-seeking role for the t+1-th iterative calculation is determined; t is an integer greater than 1.

[0027] Optionally, the container deployment method, wherein an ant colony algorithm is used for iterative calculation to obtain N2 container nodes among the multiple container nodes except N1 candidate master nodes as candidate working nodes, includes:

[0028] According to the preset ant colony algorithm configuration parameters, the computing ant colony is placed on the N1 candidate master nodes;

[0029] Determine a search space for ant colony computing according to the shortest distance between the N1 candidate master nodes;

[0030] Based on the N1 candidate master nodes, according to the ant colony algorithm configuration parameters, and using the determined search space, iterative calculation is performed until the iterative calculation reaches the preset number of times, or the fitness difference obtained in the result of the iterative calculation is less than or equal to a preset value;

[0031] According to the iterative calculation result, N2 candidate working nodes are determined.

[0032] Optionally, the container deployment method further comprises:

[0033] During the iterative calculation process, according to the maximum-minimum ant strategy, the pheromone concentration of the calculation path determined according to the search space is limited to within a preset range.

[0034] One embodiment of the present application further provides a container deployment device, which includes: a first computing module, which is used to use a football team training algorithm to train deployment parameters of multiple container nodes, and obtain N1 container nodes among the multiple container nodes as candidate master nodes; wherein N1 is an integer greater than or equal to 1;

[0035] A second calculation module is used to perform iterative calculations using an ant colony algorithm according to the deployment parameters of the N1 candidate master nodes to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes; N2 is an integer greater than or equal to 1;

[0036] The third computing module is used to determine that N container nodes with the shortest connection paths on multiple connection paths between the candidate master node and the candidate working node are container nodes to be deployed; wherein N is an integer greater than or equal to 1, and the sum of N1 and N2 is greater than N.

[0037] One embodiment of the present application further provides a deployment device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the container deployment method as described in any one of the above items.

[0038] One embodiment of the present application further provides a readable storage medium, wherein a program is stored on the readable storage medium, and when the program is executed by a processor, the steps in the container deployment method described in any one of the above items are implemented.

[0039] One embodiment of the present application further provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, the steps in the container deployment method described in any one of the above items are implemented.

[0040] At least one of the above technical solutions of the present application has the following beneficial effects:

[0041] The container deployment method described in the embodiment of the present application combines the football team training algorithm and the ant colony algorithm, utilizing the strong global search capability of the football team training algorithm and the powerful local optimization capability and the shortest path search function of the ant colony algorithm, so as to improve the iterative calculation speed and reduce the network communication overhead between nodes after the distributed deployment of the container, and avoid the problem that the ant colony algorithm is prone to fall into the local optimal solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of the process of the container deployment method described in an embodiment of the present application;

[0043] Figure 2A topological diagram of distributed container nodes deployed by the container deployment method described in the embodiment of the present application;

[0044] Figure 3 A flowchart of a specific implementation method of the container deployment method described in the embodiment of the present application;

[0045] Figure 4 A parameter configuration for distributed deployment of containers;

[0046] Figure 5 Parameter configuration of the VSFT-LSACO algorithm of the embodiment of the present application;

[0047] Figure 6 This is one of the experimental comparison results of different algorithms for container distributed deployment;

[0048] Figure 7 The second experimental comparison result of different algorithms for container distributed deployment;

[0049] Figure 8 The third experimental comparison result of different algorithms for container distributed deployment;

[0050] Fig. 9 This is a schematic diagram of the structure of the container deployment device described in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the technical problems, technical solutions and advantages to be solved by the present application clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0052] In order to solve the problems of slow iterative calculation speed and large network communication overhead in the container deployment algorithm using the prior art, the embodiment of the present application provides a container deployment method, which uses the strong global search capability of the football team training algorithm to determine N1 container nodes among multiple container nodes as candidate master nodes, so as to obtain the global optimal node when multiple container nodes are deployed as the candidate master node. The N1 candidate master nodes are used as the initial nodes of the ant colony algorithm for iterative calculation to determine N2 candidate working nodes. On this basis, the container nodes to be deployed can be determined according to the determined N1 candidate master nodes and N2 candidate working nodes. In this way, the football team training algorithm and the ant colony algorithm can be combined, and the strong global search capability of the football team training algorithm, as well as the powerful local optimization capability and the function of searching the shortest path of the ant colony algorithm are used to improve the iterative calculation speed, reduce the network communication overhead between nodes after the distributed deployment of the container, and avoid the problem that the ant colony algorithm is easily trapped in the local optimal solution.

[0053] One embodiment of the present application provides a container deployment method, such as Figure 1 As shown, the method includes:

[0054] S110, using a football team training algorithm to train deployment parameters of multiple container nodes, and obtaining N1 container nodes from the multiple container nodes as candidate master nodes; wherein N1 is an integer greater than or equal to 1;

[0055] S120, according to the deployment parameters of the N1 candidate master nodes, an ant colony algorithm is used to perform iterative calculation to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes; N2 is an integer greater than or equal to 1;

[0056] S130, determining that N container nodes with the shortest connection paths on multiple connection paths between the candidate master node and the candidate working node are container nodes to be deployed; wherein N is an integer greater than or equal to 1, and the sum of N1 and N2 is greater than N.

[0057] In an embodiment of the present application, the container deployment algorithm combines the football team training algorithm with the ant colony algorithm. The algorithm combining the football team training algorithm with the ant colony algorithm can be called a variable step size football training algorithm VSFT-limiting and sorting ant colony algorithm LSACO (Variable Step Size Football Team Training Algorithm-Limitingand Sorting Ant Colony Algorithm) algorithm.

[0058] In order to clearly illustrate the specific implementation of the container deployment algorithm of the present application, the specific principles of the football team training algorithm and the ant colony algorithm are first explained below.

[0059] For the football team training algorithm:

[0060] The algorithm simulates the three stages of the training process: collective training, group training and individual remedial training. It has powerful global search capabilities and excellent global optimization capabilities, making it very suitable for application in highly distributed cloud wireless networks.

[0061] During the collective training phase, the roles corresponding to the trained players are divided into four different types: those who follow the best nodes, those who find the best and worst nodes, those who balance the gaps between nodes, and those who fluctuate to find nodes.

[0062] In each iteration of the collective training phase, each player's corresponding role will randomly change its role type.

[0063] For those who follow the best node: they are fanatical followers of the current best node. They will move towards the best node, but due to power limitations, they can only move randomly near the best node.

[0064] For those who find the best and worst nodes: You can find the best and worst nodes within the current fluctuation range, avoid becoming the worst node, and strive to get closer to the best node.

[0065] For those who balance the gap between nodes: they can see the gap between the best node and the worst node, and will look for the middle node to achieve balance in dimension.

[0066] For those who are searching for nodes by fluctuations: expand the node search range through continuous fluctuations.

[0067] For the ant colony algorithm:

[0068] This algorithm is a probabilistic algorithm that simulates the foraging behavior of ants in nature to find the optimal path. When ants are looking for food sources, they release a pheromone on the path they pass through. The concentration of the pheromone represents the distance of the path. The higher the pheromone concentration, the shorter the corresponding path distance. The walking path of the ants can represent the feasible solution to the problem to be optimized. All paths of the entire ant colony constitute the solution space of the problem to be optimized. Ants with shorter paths release more pheromones. As time goes by, the accumulated pheromone concentration on the shorter path gradually increases, and the number of ants choosing this path also increases. Finally, the entire ant will concentrate on the best path under the action of positive feedback, thereby determining the shortest path, which corresponds to the optimal solution path of the problem to be optimized.

[0069] Based on the above, the ant colony algorithm has a strong local optimization capability and the function of searching the shortest path.

[0070] The container deployment method described in the embodiment of the present application, the topology diagram of the deployed distributed container nodes is as follows Figure 2 As shown, it includes multiple master nodes and multiple working nodes connected to each master node.

[0071] In the embodiment of the present application, optionally, in step S110, a football team training algorithm is used to train the deployment parameters of multiple container nodes, including:

[0072] The football team training algorithm is adopted, and multiple container nodes act as different roles in the collective training process to train the deployment parameters of multiple container nodes.

[0073] Among them, before executing the collective training of the football team training algorithm, parameter initialization is performed, and the number N1 of candidate master nodes obtained, the number of iterations and the node quality of the container nodes required to be deployed are set. Optionally, the number N1 is greater than or equal to the number of master nodes required for container node deployment; the node quality includes one or more items of the memory size, computing amount, number of node connections, etc. of the container node.

[0074] By adopting this implementation mode, the collective training process of the football team training algorithm is utilized. According to the deployment parameters of multiple container nodes and the number N1 of candidate master nodes set, the number of iterations and the node quality of the container nodes that need to be deployed, etc., the role of the container node is adjusted in each iteration to switch between following the best node, finding the best node and the worst node, balancing the gap between nodes and fluctuating to find nodes. Finally, N1 best container nodes among the multiple container nodes are obtained as candidate master nodes.

[0075] In one embodiment of the present application, optionally, the method further includes:

[0076] In the process of training the deployment parameters of multiple container nodes, the moving step size of the container node that follows the best node role is adjusted according to the update number of the optimal fitness value of the function in the collective training process in n training calculations before the current training calculation.

[0077] In another embodiment, optionally, the method further comprises:

[0078] In the process of training the deployment parameters of multiple container nodes, the Levy flight strategy is adopted to adjust the fluctuation amplitude of the container nodes that play the role of fluctuation finding.

[0079] In the collective training process of the football team training algorithm, the one who follows the best node can only move randomly to the vicinity of the best node, and the fluctuation amplitude of the one who fluctuates to find the node is small, which leads to a large number of algorithm iterations and a long time. In the method described in the embodiment of the present application, a football team training algorithm is adopted, and multiple container nodes are respectively used as different roles in the collective training process. In the process of training the deployment parameters of the multiple container nodes, a dynamic adjustment strategy of the moving step is introduced. According to the number of updates of the optimal fitness value of the function in the collective training process before the current training calculation, the moving step of the container node that follows the best node role is dynamically adjusted to achieve the effect of reducing the number of algorithm iterations and reducing network communication overhead.

[0080] Optionally, an adjustment factor of the moving step length (that is, a preset adjustment factor) can be preset. When the function optimal fitness value in the collective training process is updated more than the preset number of times before the current training calculation, it means that the distance to the best node is farther and the moving step length needs to be increased. Then, the adjustment factor is increased on the basis of the current moving step length to obtain the moving step length of the container node that follows the best node role; when the function optimal fitness value in the collective training process is updated less than the preset number of times before the current training calculation, it means that the distance to the best node is closer. Then, the adjustment factor is reduced on the basis of the current moving step length to obtain the moving step length of the container node that follows the best node role. In this way, by dynamically adjusting the moving step length of the container node that follows the best node role, the effect of quickly determining the best node and reducing network overhead is achieved.

[0081] Optionally, the moving step length m_step of the container node that serves as the best node to follow may be determined according to the following formula 1:

[0082] Formula 1:

[0083] In the formula 1, α is the adjustment factor; τ is the given minimum moving step length; Change Times is the number of updates of the optimal fitness value of the function before the current training calculation; and n is the set update number threshold of Change Times. Optionally, α is less than 1 and greater than 0.

[0084] By adopting the above method, when the current moving step length is greater than the minimum moving step length, and the number of updates of the optimal fitness value of the function before the current training calculation is greater than the update number threshold, the current moving step length is increased according to the preset adjustment factor to obtain the adjusted moving step length;

[0085] When the current moving step length is greater than the minimum moving step length and the number of updates of the function's optimal fitness value before the current training calculation is less than or equal to the update number threshold, the current moving step length is reduced according to a preset adjustment factor to obtain an adjusted moving step length.

[0086] According to the calculated moving step length m_step, the moving mode of the container node as the role of following the best node can be determined, which can be calculated as shown in the following formula 2:

[0087] Formula 2:

[0088]

[0089] Among them, k is the number of iterations, i and j are evaluation dimensions, To follow the position of the best node character before moving, is the position of the current best node, To follow the best node role after moving.

[0090] Another implementation method, in order to address the problem that the fluctuation amplitude of the fluctuation node seeker is small during collective training, resulting in a long algorithm iteration time, the container deployment method described in the embodiment of the present application is adopted. In the process of training the deployment parameters of multiple container nodes, the Levy flight strategy is adopted to adjust the fluctuation amplitude of the container nodes that play the fluctuation search role, so as to increase the fluctuation amplitude of the fluctuation node seeker, strengthen the global search capability, avoid being in the local optimization process in the early stage of the algorithm, thereby reducing the number of algorithm iterations and reducing network communication overhead.

[0091] The Levy flight strategy is a special random walk mode in which the step length distribution has a heavy-tail characteristic, that is, there is a relatively high probability of large steps occurring during the random walk. In this way, by introducing the Levy flight strategy, the fluctuation amplitude can be increased and the number of algorithm iterations can be reduced.

[0092] Optionally, in the process of training the deployment parameters of the plurality of container nodes, the Levy flight strategy is adopted to adjust the fluctuation amplitude of the container node as the fluctuation search role, including:

[0093] In the process of training the deployment parameters of multiple container nodes, the fluctuation amplitude of the container node as the fluctuation-seeking role after the t-th iterative calculation is determined according to the path and step scaling factor that obeys the Levy flight strategy, and the fluctuation amplitude of the container node as the fluctuation-seeking role for the t+1-th iterative calculation is determined; t is an integer greater than 1.

[0094] Specifically, the fluctuation amplitude X of the container node of the role can be found by the following formula: t+1 :

[0095] Formula 3:

[0096] Among them, X t+1 represents the fluctuation range after the t+1th iteration calculation, X t represents the fluctuation amplitude after the t-th iteration calculation; Levy(β) represents the path that obeys the Levy distribution; α is the step size scaling factor;

[0097] According to the above formula, the moving formula of the wave search node can be determined as shown in the following formula 4:

[0098] Formula 4:

[0099] in, Find the position of the character after the wave moves, Indicates the position before the wave moves to find the character.

[0100] Based on the above process, by introducing the dynamic adjustment strategy of mobile step length and Levy flight strategy in the variable step length football team training algorithm, the number of algorithm iterations can be reduced, the network communication overhead can be reduced, and after the variable step length football team collective training algorithm is completed, the global N1 better nodes are obtained as the candidate main nodes.

[0101] In the embodiment of the present application, in step S120, an ant colony algorithm is used to perform iterative calculation to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes, including:

[0102] According to the preset ant colony algorithm configuration parameters, the computing ant colony is placed on the N1 candidate master nodes;

[0103] Determine a search space for ant colony computing according to the shortest distance between the N1 candidate master nodes;

[0104] Based on the N1 candidate master nodes, according to the ant colony algorithm configuration parameters, and using the determined search space, iterative calculation is performed until the iterative calculation reaches the preset number of times, or the fitness value difference obtained in the result of the iterative calculation is less than or equal to a preset value;

[0105] According to the iterative calculation result, N2 candidate working nodes are determined.

[0106] Optionally, the ant colony algorithm configuration parameters include one or more of the ant colony size, the number N2 of candidate working nodes obtained by calculation (optionally, the number N2 of nodes is greater than or equal to the number of working nodes required for container deployment), the pheromone volatilization rate and the maximum number of iterations.

[0107] In the initialization phase of the ant colony algorithm, after setting the above configuration parameters, the computing ant colony is evenly placed in the N1 candidate master nodes obtained by the football team training algorithm. Afterwards, the search space for ant colony computing is determined based on the shortest distance between the N1 candidate master nodes. Optionally, the distance between the N1 candidate master nodes can be calculated using the Floyd algorithm, and half of the shortest distance m between each two candidate master nodes (i.e., m / 2) is set as the search radius of the search space for ant colony computing.

[0108] Optionally, the method further comprises:

[0109] During the iterative calculation process, according to the maximum-minimum ant strategy, the pheromone concentration of the calculation path determined according to the search space is limited to within a preset range.

[0110] The concentration of pheromones (also called external pheromones or global pheromones) refers to the concentration of pheromones generated by a specific global pheromone update mechanism in the entire search space, and is usually used to guide ants to find the optimal solution more efficiently during the search process. The concentration of pheromones is usually updated according to the optimal path or better path found after all ants have completed an iteration. Specifically, the optimal solution found will increase the pheromone concentration on its path so as to guide more ants to choose this path in subsequent iterations. The design of pheromone concentration helps to strike a balance between exploring new paths and developing known good paths. Through an appropriate pheromone concentration update strategy, the algorithm can avoid falling into a local optimal solution while effectively utilizing known high-quality paths. The reason for limiting the pheromone concentration here is to limit the search space and avoid excessive concentration of nodes.

[0111] The container deployment method described in the embodiment of the present application introduces the maximum-minimum ant strategy to limit the pheromone concentration of each calculation path corresponding to the search radius determined according to the search space to a preset range (such as [τ min ,τ max ]), after completing one iteration calculation, if the pheromone concentration exceeds the preset range, the corresponding pheromone concentration is limited to the first boundary value τ of the preset range min Or the second boundary value τ max This can effectively avoid the pheromone on one of the calculation paths being much larger than the pheromone on the other calculation paths, so as to improve the even distribution of the calculation results and reduce the network communication overhead.

[0112] For example, after completing one iteration, the pheromone concentration is greater than the second boundary value τ max In the case of, the updated pheromone concentration is determined to be the second boundary value τ max ; When the pheromone concentration is less than the first boundary value τ min In the case of, the updated pheromone concentration is determined to be the first boundary value τ min .

[0113] For example, the weight of the global optimal solution is ω, and the weight of the rth optimal solution is max{0,ω-r / (n1+n2)}. Then the update rule of pheromone is as follows:

[0114]

[0115] Among them, τ ij (t+1) is the pheromone concentration after t+1 iterations, ρ is the pheromone volatilization rate, τ ij (t) is the pheromone concentration at the tth iteration, is the pheromone left by the rth optimal solution through path i to j in iteration t, is the pheromone left by the optimal solution through path i to j in iteration t, L r (t) is the path length of the rth optimal solution, L gb (t) is the path length of the optimal solution.

[0116] Using this method, when the maximum number of iterations is reached, we can get the Master node and Worker node we need, as well as the shortest connection path between them.

[0117] Furthermore, based on the N1 candidate master nodes, according to the ant colony algorithm configuration parameters, and using the determined search space, iterative calculation is performed until the number of iterative calculations reaches a preset number, or the calculated fitness difference is less than or equal to a preset value, the local search of the ant colony algorithm ends, and N2 container nodes are obtained as candidate working nodes.

[0118] Optionally, the method further comprises:

[0119] After obtaining N2 candidate working nodes, the connection status information of each candidate working node is compared with the connection status information of the corresponding candidate master node within a preset range;

[0120] In the case that the connection status information of the candidate working node is better than the connection status information of the corresponding candidate master node, the candidate working node replaces the corresponding candidate master node as the candidate master node.

[0121] Optionally, the connection status information includes the number of node connections and / or the node quality. When the number of node connections of the alternative working node is greater than the number of node connections of the alternative main node, the connection status information of the alternative working node is determined to be better than the corresponding connection status information of the alternative main node; and / or, when the node quality of the alternative working node is greater than the node quality of the alternative main node, the connection status information of the alternative working node is determined to be better than the corresponding connection status information of the alternative main node.

[0122] In the container deployment method described in the embodiment of the present application, by adopting the ant colony algorithm, N1 globally optimal nodes are used as the initial nodes of the ant colony algorithm. The distance between N1 nodes is calculated using the Floyd algorithm, the shortest distance m / 2 between two nodes is set as the search space radius of the ant colony algorithm, and the maximum and minimum ant strategy is introduced to improve the uniform distribution of nodes and reduce network communication overhead; in this way, by determining N2 local optimal solutions near N1 nodes as alternative worker nodes (N2 is greater than or equal to the required number of worker nodes), and comparing the number of connections and node quality of N1 nodes and N2 nodes, if there is a node in N2 that is better than the N1 node near the node, then the node replaces the original N1 node to ensure that the determined main node is the optimal node.

[0123] In the embodiment of the present application, optionally, the method further includes:

[0124] After each iterative calculation using the ant colony algorithm, a different weight value is set for each connection path according to the order of the path lengths of the multiple connection paths between the candidate master node and the candidate working node from short to long; wherein the shorter the path length of the connection path, the greater the corresponding weight value;

[0125] When the ant colony algorithm is used for the next iterative calculation, the container nodes on each connection path are calculated in sequence according to the arrangement order of the corresponding weight values ​​from large to small.

[0126] By adopting this implementation method, by removing the restriction conditions of the ant colony search space, introducing a sorting optimization strategy, optimizing the solution and the connection path, the purpose of further reducing the network communication overhead is achieved. In addition, after setting the maximum number of iterations and the required number of nodes (n1+n2), after each iteration calculated according to the ant colony algorithm is completed, the paths taken by the ants are arranged in order from short to long, and the algorithm assigns different weights according to the path length. The shorter the path length, the greater the weight. When the maximum number of iterations is reached, the required main Master node and main Worker node, as well as the shortest connection path between the main Master node and the main Worker node can be obtained, so that the N container nodes of the shortest connection path are used as the container nodes to be deployed.

[0127] By adopting this implementation method, the purpose of optimizing solutions and connection paths is achieved by introducing a sorting optimization strategy into the ant colony algorithm; in addition, the search space of the ant colony algorithm can be set to global, and nodes in the optimized search space can be gradually selected and optimized, and the shortest path for distributed deployment of containers can be found, thereby reducing the network overhead of communication between nodes.

[0128] like Figure 3The following is a flowchart of a specific implementation method of the container deployment method according to an embodiment of the present application. The implementation process specifically includes the following processes:

[0129] start;

[0130] Initialize the variable step length football team training algorithm; that is, set the number of candidate master nodes N1 obtained, the number of iterations, and the node quality of the container nodes to be deployed, etc.;

[0131] Execute a collective training process of the football team training algorithm, and adjust the roles of the container nodes in each iteration to switch between best node follower, best node and worst node finder, node gap balancer, and fluctuating node finder;

[0132] When executing the training calculation of the role of the container node as the best node follower, after the training calculation, it is determined whether the optimal fitness value obtained by the calculation is updated; if the determination result is no, the training calculation of the role of the container node as the best node follower is continued; if the determination result is yes, the moving step adjustment strategy is executed;

[0133] When executing training calculations for a container node that plays the role of a fluctuation seeker, the Levy flight strategy is used to adjust the fluctuation amplitude of the container node that plays the role of a fluctuation seeker;

[0134] After each execution of the collective training of the football team training algorithm, it is determined whether the iteration process is finished, such as whether the number of iterations reaches a preset number. If the result of the determination is yes, it is determined that the iteration process is finished; if the result of the determination is no, the collective training process of the football team training algorithm continues to be executed;

[0135] After the iteration process of collective training of the above-mentioned football team training algorithm is completed, N1 (or n1) container nodes are obtained as candidate master nodes;

[0136] Use N1 candidate master nodes as the initial nodes for executing the restricted sorting ant colony algorithm;

[0137] The search space of the restricted sorting ant colony algorithm is determined by using the Floyd algorithm.

[0138] Performing iterative calculation of the restricted sorting ant colony algorithm, and in the process of iterative calculation, according to the maximum and minimum ant strategy, limiting the pheromone concentration of the calculation path determined according to the search space to within a preset range;

[0139] Determine whether the iterative calculation of the restricted sorting ant colony algorithm is finished. If it is determined that the number of iterative calculations reaches a preset number, or the calculated fitness difference is less than or equal to a preset value, it is determined that the iterative calculation process of the ant colony algorithm is finished; otherwise, it is determined that the iterative calculation process is not finished, and the next round of iterative calculation process is continued;

[0140] When it is determined that the iterative calculation process of executing the restricted sorting ant colony algorithm is finished, N2 (or n2) container nodes are obtained as candidate working nodes;

[0141] Determine whether there is a candidate working node among the n2 candidate working nodes whose connection status information or connection quality is better than the connection status information or connection quality of the corresponding n1 candidate master nodes;

[0142] If the result of the judgment is yes, the candidate working node with better connection quality among the n2 candidate working nodes replaces or substitutes the candidate master node with worse connection quality among the corresponding n1 candidate master nodes, so as to obtain the final candidate working node and candidate master node;

[0143] If the judgment result is yes, the final candidate working node and candidate master node are obtained according to the n2 candidate working nodes and the n1 candidate master node;

[0144] Execute the sorting optimization strategy and use the N container nodes with the shortest connection path as the container nodes to be deployed;

[0145] Finish.

[0146] By adopting the above implementation process, the football team training algorithm and the ant colony algorithm are combined, and the moving step adjustment strategy and the Levy flight strategy are introduced to reduce the number of algorithm iterations and reduce the network communication overhead in the distributed deployment of containers. In addition, this method can also solve the problem that the ant colony algorithm is prone to fall into the local optimal solution, and by introducing the maximum and minimum ant strategy and the sorting optimization strategy, the network communication overhead between nodes after the deployment is reduced.

[0147] Compared with the particle swarm algorithm, genetic algorithm and artificial fish swarm algorithm of the prior art for distributed deployment of containers, the method described in the embodiment of the present application can effectively reduce the number of algorithm iterations, as well as reduce the network communication overhead during the deployment process and the network communication overhead required to execute tasks after the deployment is completed.

[0148] The technical effects that can be achieved by using the technical solution of the present application in comparison with the deployment methods of the prior art can be verified and explained through simulation.

[0149] For example, the method described in the embodiment of the present application is simulated on Docker Desktop, and the container distributed deployment algorithm based on VSFT-LSACO is compared with the container distributed deployment algorithm based on particle swarm, the container distributed deployment algorithm based on genetics, and the container distributed deployment algorithm based on artificial fish swarm. The container distributed deployment parameter configuration is as follows: Figure 4 As shown, the parameter configuration of the VSFT-LSACO algorithm of the embodiment of the present application is as follows Figure 5 As shown in the figure, the experiment selected the average iteration number of the algorithm for distributed container deployment, the network communication overhead during the deployment process, and the network communication overhead required to execute the task after the deployment was completed for testing. The experiment selected the average iteration number of the algorithm for distributed container deployment, the network communication overhead during the deployment process, and the network communication overhead required to execute the task after the deployment was completed for testing. The test results of different algorithms are shown in the figure. Figure 6 , Figure 7 and Figure 8 shown.

[0150] Compared with the above Figure 6 , Figure 7 and Figure 8 From the experimental results, it can be seen that compared with the container distributed deployment algorithms based on particle swarm algorithm, genetic algorithm and artificial fish swarm algorithm, the container distributed deployment algorithm based on VSFT-LSACO has fewer iterations, and the network communication overhead during the deployment process and the network communication overhead required to execute tasks after the deployment is completed are also less.

[0151] One embodiment of the present application also provides a container deployment device, such as Fig. 9 As shown, including:

[0152] The first calculation module 910 is used to train the deployment parameters of the plurality of container nodes using a football team training algorithm, and obtain N1 container nodes among the plurality of container nodes as candidate master nodes; wherein N1 is an integer greater than or equal to 1;

[0153] The second calculation module 920 is used to perform iterative calculations using an ant colony algorithm according to the deployment parameters of the N1 candidate master nodes to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes; N2 is an integer greater than or equal to 1;

[0154] The third computing module 930 is used to determine that N container nodes with the shortest connection paths on multiple connection paths between the candidate master node and the candidate working node are container nodes to be deployed; wherein N is an integer greater than or equal to 1, and the sum of N1 and N2 is greater than N.

[0155] By adopting the container deployment device described in the embodiment of the present application, the strong global search capability of the football team training algorithm is utilized to determine N1 container nodes among multiple container nodes as candidate master nodes, so as to obtain the global optimal node when multiple container nodes are deployed as the candidate master node. The N1 candidate master nodes are used as the initial nodes of the ant colony algorithm for iterative calculation to determine N2 candidate working nodes. On this basis, the container nodes to be deployed can be determined according to the determined N1 candidate master nodes and N2 candidate working nodes. In this way, the football team training algorithm and the ant colony algorithm can be combined, and the strong global search capability of the football team training algorithm and the powerful local optimization capability and the function of searching the shortest path of the ant colony algorithm can be utilized to improve the iterative calculation speed and reduce the network communication overhead between nodes after the distributed deployment of the container, and avoid the problem that the ant colony algorithm is easily trapped in the local optimal solution.

[0156] Optionally, in the container deployment device, the second computing module 920 is further used for:

[0157] After each iterative calculation using the ant colony algorithm, a different weight value is set for each connection path according to the order of the path lengths of the multiple connection paths between the candidate master node and the candidate working node from short to long; wherein the shorter the path length of the connection path, the greater the corresponding weight value;

[0158] When the ant colony algorithm is used for the next iterative calculation, the container nodes on each connection path are calculated in sequence according to the arrangement order of the corresponding weight values ​​from large to small.

[0159] Optionally, in the container deployment device, the second computing module 920 is further used for:

[0160] After obtaining N2 candidate working nodes, the connection status information of each candidate working node is compared with the connection status information of the corresponding candidate master node within a preset range;

[0161] In the case that the connection status information of the candidate working node is better than the connection status information of the corresponding candidate master node, the candidate working node replaces the corresponding candidate master node as the candidate master node.

[0162] Optionally, in the container deployment device, the first calculation module 910 uses a football team training algorithm to train deployment parameters of multiple container nodes, including:

[0163] The football team training algorithm is adopted, and multiple container nodes act as different roles in the collective training process to train the deployment parameters of multiple container nodes.

[0164] Optionally, in the container deployment device, the first computing module 910 is further configured to:

[0165] In the process of training the deployment parameters of multiple container nodes, the moving step size of the container node that follows the best node role is adjusted according to the number of updates of the optimal fitness value of the function in the collective training process before the current training calculation.

[0166] Optionally, the container deployment device, wherein the first calculation module 910 adjusts the moving step of the container node as the follower of the best node role according to the number of updates of the optimal fitness value of the function in the collective training process before the current training calculation, includes:

[0167] When the current moving step length is greater than the minimum moving step length and the number of updates of the optimal fitness value of the function before the current training calculation is greater than the update number threshold, the current moving step length is increased according to a preset adjustment factor to obtain an adjusted moving step length;

[0168] When the current moving step length is greater than the minimum moving step length and the number of updates of the function's optimal fitness value before the current training calculation is less than or equal to the update number threshold, the current moving step length is reduced according to a preset adjustment factor to obtain an adjusted moving step length.

[0169] Optionally, in the container deployment device, the first computing module 910 is further configured to:

[0170] In the process of training the deployment parameters of multiple container nodes, the Levy flight strategy is adopted to adjust the fluctuation amplitude of the container nodes that play the role of fluctuation finding.

[0171] Optionally, in the container deployment device, in the process of training the deployment parameters of the plurality of container nodes, the first computing module 910 adopts the Levy flight strategy to adjust the fluctuation amplitude of the container node as the fluctuation search role, including:

[0172] In the process of training the deployment parameters of multiple container nodes, the fluctuation amplitude of the container node as the fluctuation-seeking role after the t-th iterative calculation is determined according to the path and step scaling factor that obeys the Levy flight strategy, and the fluctuation amplitude of the container node as the fluctuation-seeking role for the t+1-th iterative calculation is determined; t is an integer greater than 1.

[0173] Optionally, in the container deployment device, the second computing module 920 uses an ant colony algorithm to perform iterative computing to obtain N2 container nodes in the plurality of container nodes except the N1 candidate master nodes as candidate working nodes, including:

[0174] According to the preset ant colony algorithm configuration parameters, the computing ant colony is placed on the N1 candidate master nodes;

[0175] Determine a search space for ant colony computing according to the shortest distance between the N1 candidate master nodes;

[0176] Based on the N1 candidate master nodes, according to the ant colony algorithm configuration parameters, and using the determined search space, iterative calculation is performed until the iterative calculation reaches the preset number of times, or the fitness difference obtained in the result of the iterative calculation is less than or equal to a preset value;

[0177] According to the iterative calculation result, N2 candidate working nodes are determined.

[0178] Optionally, in the container deployment device, the second computing module 920 is further used for:

[0179] During the iterative calculation process, according to the maximum-minimum ant strategy, the pheromone concentration of the calculation path determined according to the search space is limited to within a preset range.

[0180] One embodiment of the present application further provides a deployment device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the container deployment method as described in any one of the above items.

[0181] Among them, the program running on the processor of the deployment device executes the specific implementation method of the container deployment method. Please refer to the detailed description of the specific implementation method of the container deployment method mentioned above, and will not be repeated here.

[0182] In addition, a specific embodiment of the present application further provides a readable storage medium on which a computer program is stored, wherein when the program is executed by a processor, the steps in the container deployment method described in any one of the above items are implemented.

[0183] Specifically, the readable storage medium is applied to the above-mentioned deployment device. When applied to the deployment device, the execution steps in the corresponding container deployment method are as described in detail above and will not be repeated here.

[0184] Another embodiment of the present application further provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, the steps in the container deployment method described in any one of the above are implemented, or the steps in the container deployment method described in any one of the above are implemented.

[0185] Optionally, the embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0186] The computer program product described in the embodiment of the present application includes computer instructions that implement the various processes of the method embodiment shown above when executed by a processor, and can achieve the same technical effect. To avoid repetition, they are not described here.

[0187] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0188] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0189] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving methods described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0190] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary personnel in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A container deployment method, characterized in that: include: Using a football team training algorithm, the deployment parameters of multiple container nodes are trained to obtain N1 container nodes among the multiple container nodes as candidate master nodes; wherein N1 is an integer greater than or equal to 1; According to the deployment parameters of the N1 candidate master nodes, an ant colony algorithm is used to perform iterative calculation to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes; N2 is an integer greater than or equal to 1; Determine that N container nodes with the shortest connection paths on multiple connection paths between the candidate master node and the candidate working node are container nodes to be deployed; wherein N is an integer greater than or equal to 1, and the sum of N1 and N2 is greater than N.

2. The container deployment method according to claim 1, characterized in that: The method further comprises: After each iterative calculation using the ant colony algorithm, a different weight value is set for each connection path according to the order of the path lengths of the multiple connection paths between the candidate master node and the candidate working node from short to long; wherein the shorter the path length of the connection path, the greater the corresponding weight value; When the ant colony algorithm is used for the next iterative calculation, the container nodes on each connection path are calculated in sequence according to the arrangement order of the corresponding weight values ​​from large to small.

3. The container deployment method according to claim 1, characterized in that: The method further comprises: After obtaining N2 candidate working nodes, the connection status information of each candidate working node is compared with the connection status information of the corresponding candidate master node within a preset range; In the case that the connection status information of the candidate working node is better than the connection status information of the corresponding candidate master node, the candidate working node replaces the corresponding candidate master node as the candidate master node.

4. The container deployment method according to claim 1, characterized in that: The football team training algorithm is used to train the deployment parameters of multiple container nodes, including: The football team training algorithm is adopted, and multiple container nodes act as different roles in the collective training process to train the deployment parameters of multiple container nodes.

5. The container deployment method according to claim 4, characterized in that: The method further comprises: In the process of training the deployment parameters of multiple container nodes, the moving step size of the container node that follows the best node role is adjusted according to the number of updates of the optimal fitness value of the function in the collective training process before the current training calculation.

6. The container deployment method according to claim 5, characterized in that: According to the number of updates of the optimal fitness value of the function in the collective training process before the current training calculation, adjusting the moving step length of the container node as the follower of the optimal node role, including: When the current moving step length is greater than the minimum moving step length and the number of updates of the optimal fitness value of the function before the current training calculation is greater than the update number threshold, the current moving step length is increased according to a preset adjustment factor to obtain an adjusted moving step length; When the current moving step length is greater than the minimum moving step length and the number of updates of the function's optimal fitness value before the current training calculation is less than or equal to the update number threshold, the current moving step length is reduced according to a preset adjustment factor to obtain an adjusted moving step length.

7. The container deployment method according to claim 4, characterized in that: The method further comprises: In the process of training the deployment parameters of multiple container nodes, the Levy flight strategy is adopted to adjust the fluctuation amplitude of the container nodes that play the role of fluctuation finding.

8. The container deployment method according to claim 7, characterized in that: In the process of training the deployment parameters of multiple container nodes, the Levy flight strategy is used to adjust the fluctuation amplitude of the container node as the fluctuation search role, including: In the process of training the deployment parameters of multiple container nodes, the fluctuation amplitude of the container node as the fluctuation-seeking role after the t-th iterative calculation is determined according to the path and step scaling factor that obeys the Levy flight strategy, and the fluctuation amplitude of the container node as the fluctuation-seeking role for the t+1-th iterative calculation is determined; t is an integer greater than 1.

9. The container deployment method according to claim 1, characterized in that: An ant colony algorithm is used to perform iterative calculation to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes, including: According to the preset ant colony algorithm configuration parameters, the computing ant colony is placed on the N1 candidate master nodes; Determine a search space for ant colony computing according to the shortest distance between the N1 candidate master nodes; Based on the N1 candidate master nodes, according to the ant colony algorithm configuration parameters, and using the determined search space, iterative calculation is performed until the iterative calculation reaches a preset number of times, or the fitness difference obtained in the result of the iterative calculation is less than or equal to a preset value; According to the iterative calculation result, N2 candidate working nodes are determined.

10. The container deployment method according to claim 9, characterized in that: The method further comprises: During the iterative calculation process, according to the maximum-minimum ant strategy, the pheromone concentration of the calculation path determined according to the search space is limited to a preset range.

11. A container deployment device, characterized in that: include: A first computing module is used to train the deployment parameters of the plurality of container nodes using a football team training algorithm, and obtain N1 container nodes among the plurality of container nodes as candidate master nodes; wherein N1 is an integer greater than or equal to 1; A second calculation module is used to perform iterative calculations using an ant colony algorithm according to the deployment parameters of the N1 candidate master nodes to obtain N2 container nodes other than the N1 candidate master nodes among the multiple container nodes as candidate working nodes; N2 is an integer greater than or equal to 1; The third computing module is used to determine that N container nodes with the shortest connection paths on multiple connection paths between the candidate master node and the candidate working node are container nodes to be deployed; wherein N is an integer greater than or equal to 1, and the sum of N1 and N2 is greater than N.

12. A deployment device, characterized in that: The method comprises a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the method for deploying a container according to any one of claims 1 to 10 is implemented.

13. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is executed by the processor, the steps in the container deployment method according to any one of claims 1 to 10 are implemented.

14. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps in the container deployment method according to any one of claims 1 to 10.