Cloud native platform container migration method based on improved firefly algorithm

Through the improved Firefly algorithm, combined with the optimization strategy of adaptive parameters and dynamic search direction, the problems of container migration complexity and computing complexity in cloud computing are solved, efficient and accurate container migration is achieved, and the operational cost of the data center is reduced.

CN119938226AActive Publication Date: 2025-05-06NANJING UNIV OF POSTS & TELECOMM
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510015792.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-06
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

In cloud computing, the container migration process requires weighing multiple goals such as energy consumption, bandwidth, and migration time, which leads to complex optimization process. Especially in dynamic load environments, migration decisions need to respond to changes in real time, increasing the difficulty and computing complexity of data center energy efficiency management.

Method used

The improved firefly algorithm is adopted to balance the capabilities of global search and local search by introducing adaptive parameters, optimize the objective functions and constraints of container migration, dynamically adjust the search direction, and avoid local optimal traps.

Benefits of technology

It significantly improves the efficiency and accuracy of container migration, can show good optimization effects at different stages, reduces the bandwidth and storage resource consumption required for migration, and reduces operational costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938226A_ABST
    Figure CN119938226A_ABST
Patent Text Reader

Abstract

The invention provides a cloud native platform container migration method based on an improved firefly algorithm, and the main idea of the method is as follows: firstly, obtaining hosts and containers in a data center and the resource utilization rates of the hosts and the containers; secondly, overloaded hosts are screened, and then a to-be-migrated container set is screened out; thirdly, an objective function of container migration is established, constraint conditions are added, and initial parameters of a firefly algorithm are initialized; further, the relative distance between the fireflies is calculated to obtain the relative attraction, the positions of the fireflies are updated according to the attraction in combination with the step length, and an optimal solution is obtained through iteration; finally, according to the optimal solution, container migration is achieved, and the whole container migration process is completed. According to the method, the problems that a standard firefly algorithm is prone to falling into local optimum, low in convergence speed and prone to stagnation are solved, the step length and attraction are optimized by adopting a dynamic self-adaptive mechanism, and the global search capability and the local convergence performance of the algorithm are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a cloud native platform container migration method based on an improved firefly algorithm, and belongs to the field of cloud computing. Background Art

[0002] With the rapid development of cloud computing technology, data centers have gradually become an important support platform for processing massive data and computing tasks. However, with the increase in application complexity and diversity, the resource management methods of traditional data centers have gradually become inadequate. In order to more efficiently meet the needs of elastic computing and resource optimization, cloud native platforms have emerged and become the core technology of the new generation of cloud computing infrastructure.

[0003] Based on containerization technology, cloud native platforms decouple applications from underlying hardware by providing unified resource abstraction and management interfaces. With the support of cloud native platforms, containers have gradually become the core unit for carrying cloud computing tasks. In order to meet the needs of energy consumption and cost optimization, container migration in data centers has gradually become a key technology in cloud computing resource management. By migrating containers from hosts with high energy consumption or low resource utilization to other idle or low-load hosts, the overall energy consumption can be effectively reduced, resource utilization can be improved, and the operating costs of data centers can be reduced. However, the container migration process involves a trade-off between multiple goals such as energy consumption, bandwidth, and migration time. During the migration process, not only should energy consumption be minimized, but also the migration time should be controlled to avoid service interruption or performance degradation; at the same time, bandwidth resources must be reasonably allocated to prevent network congestion. These conflicting goals make the optimization process extremely complicated, and in a dynamic load environment, migration decisions need to respond to changes in real time, which increases the difficulty and computational complexity of data center energy efficiency management.

[0004] In order to solve the multi-objective optimization problem in container migration, widely used optimization algorithms include particle swarm optimization (PSO) and genetic algorithm (GA). PSO has advantages in search speed and computational efficiency, can converge to the approximate optimal solution quickly, and is suitable for solving large-scale problems. However, PSO is prone to fall into the local optimal solution, especially in complex and multi-peak optimization problems, it is difficult to obtain the global optimal solution. In contrast, genetic algorithm has better global search ability, but its operation is complex and the computational cost is large. Based on these problems, the firefly algorithm (FA) as a biologically inspired swarm intelligence optimization algorithm has gradually attracted attention. The firefly algorithm not only has good global search ability, but also can continuously update the brightness and attractiveness in the algorithm iteration, dynamically adjust the search direction, and effectively avoid the trap of local optimal solution. Although the firefly algorithm performs well in many optimization problems, it still has some shortcomings. First, the optimization performance of the algorithm depends on the selection of control parameters, which may lead to unstable performance on different problems; second, the convergence speed of the firefly algorithm is slow and the convergence accuracy is limited, so it is difficult to achieve the ideal optimization effect in complex problems. To address these problems, the present invention proposes a cloud native platform container migration method based on an improved firefly algorithm. Summary of the invention

[0005] In order to solve the defects and shortcomings of the above-mentioned existing problems, the present invention proposes a cloud-native platform container migration method based on an improved firefly algorithm. By introducing adaptive parameters, it can balance the capabilities of global search and local search, so that it has strong adaptability and stability in multi-objective optimization tasks. Therefore, it shows significant application potential in energy consumption optimization and cost optimization of container migration. The main idea of ​​this method is: first, obtain the hosts and containers in the data center and their respective resource utilization rates; secondly, screen out overloaded hosts and then screen out the set of containers to be migrated; thirdly, establish the objective function of container migration while adding constraints and initializing the initial parameters of the firefly algorithm; further, calculate the relative distance between fireflies and then obtain the relative attraction, update the position of the fireflies according to the attraction combined with the step size, and obtain the optimal solution through iteration; finally, realize container migration according to the optimal solution to complete the overall container migration process.

[0006] The technical solution of the present invention is: a cloud native platform container migration method based on an improved firefly algorithm, the main steps of the method are as follows:

[0007] Step 1: Get the host set HostList in the data center = {H1, H2, ..., H j , …, H m}, there are m hosts in the set, of which H j Indicates the resource utilization rate of the j-th host HostUsage j =(hCPUj , hRAM j ,hBW j , hIO j ), where hCPU i 、hRAM i ,hBW i 、hIO i Respectively represent the CPU utilization, memory utilization, bandwidth utilization and IO utilization of the jth host. Get the container set ConList = {C1, C2, ..., Ci , …, C n}, there are n containers in the collection, of which C i Indicates the resource utilization rate ConUsage of the i-th container. i =(cCPU i , cRAM i ,cBW i , cIO i ), where cCPU i 、cRAM i ,cBW i 、cIO i They represent the CPU utilization, memory utilization, bandwidth utilization, and IO utilization of the i-th container respectively.

[0008] Step 2: Update the host load set HostLoadList according to formula (1): {hostLoad1, hostLoad2, ..., hostLoad i , …, hostLoad m}

[0009] hostLoad i =k1hCPU i +k2hRAM i +k3hB i +k4hIO i #(1)

[0010] where hostLoad i represents the load of the i-th host, k1, k2, k3, k4 represent the weights of CPU utilization, RAM utilization, BW utilization and IO utilization respectively, and k1+k2+k3+k4=1.

[0011] Step 3: Set the host CPU overload threshold T CPU and the overall load threshold T total , if the CPU utilization of the jth host is hCPU j Greater than the host CPU overload threshold T CPU or hostLoad of the jth hostj Greater than the overall load threshold T total , add the current host to the overload host set, and obtain the overload host set OverHostList = {overH1, overH2, ..., overH i ,…,overH l}.

[0012] Set the container CPU low load threshold cCPU min , select a host from the overloaded host set OverHostList in turn, sort the container set in the host according to the memory utilization cRam from small to large, and sort the first container set in the sorted container set whose CPU utilization cCPU is less than cCPU min The container is added to the container collection to be migrated MigrateConList.

[0013] Step 4: Set the number of fireflies in the firefly algorithm to n, where n is ( 10,15 ) random integers between them, the maximum number of iterations maxG=50, the adaptive parameter α0=0.9, and the initial position of each firefly X={X1,X2,…,X i ,…,X n}, where X i It is a possibility to map a container to a host. i ={cH1,cH2,…,cH j ,…,cH m}, where m is the number of containers in the container set to be migrated MigrateConList, cH j Indicates the location where the j-th container is mapped to the host, and the number of initialization iterations is t=1.

[0014] Step 5: Calculate the Cartesian distance r between any two fireflies according to formula (2): ij

[0015]

[0016] According to formula (3), the light intensity attenuation coefficient γ is calculated ij

[0017]

[0018] Where d represents the dimension of the solution vector, that is, the number of containers in the container set MigrateConList to be migrated, X i,k represents the kth component of the i-th firefly, r avg is the average distance from the i-th firefly to other fireflies, expressed as

[0019]

[0020] Step 6: Calculate the relative attraction β between fireflies according to formula (4) ij (r ij )

[0021]

[0022] where r ij It represents the Cartesian distance from the i-th firefly to the j-th firefly, β0 is the minimum attraction, β0=0.1.

[0023] Step 7: Substitute each pair of fireflies in the set into formula (5) and calculate the solution vector X corresponding to the larger result. i (t) Update the firefly's position X according to formula (6) i (t+1)

[0024]

[0025] Where W is the information load energy consumption, C is the total operating cost, and W min and W max They represent the minimum and maximum values ​​of information load energy consumption, C min and C max They respectively represent the minimum and maximum values ​​of the total operating cost, m1+m2=1.

[0026] X i (t+1)=X i (t)+β ij (r ij )×(X j (t)-X i (t))+α(t+1)×(rand-0.5)#(6)

[0027] Among them, X i (t) represents the position of the i-th firefly at the t-th iteration, X j (t) is the solution vector corresponding to the smaller calculation result, α(t+1) represents the step size at the t+1th iteration, rand is a random value between (0,1), and k is the curve attenuation rate, k=3.

[0028]

[0029] If the number of iterations t is equal to the maximum number of iterations maxG, the final position set of fireflies X = {X1, X2, ..., X i ,…,X n}, otherwise, the number of iterations t increases by 1 and jumps to step 5.

[0030] Step 8: Set the firefly final position set X = {X1, X2, …, X i ,…,X n}Every solution vector X i Substitute it into formula (5) and take the solution vector corresponding to the minimum result as the final migration solution X fin ={cH1,cH2,…,cH j ,…,cH m}.

[0031] Step 9: According to the final migration plan X fin ={cH1,cH2,…,cH j ,…,cH m}Migrate the corresponding container to the target host and the migration is completed.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] 1. When screening overloaded hosts, the present invention considers both the CPU utilization and the overall load of the host; when screening the set of containers to be migrated, in addition to paying attention to the CPU utilization (maximum correlation) of the container that causes the host overload, the migration time of the container is also comprehensively considered. In the process of searching for the target host, the standard firefly algorithm is optimized, which is prone to fall into the local optimum and has slow convergence and easy stagnation. The dynamic adaptive mechanism is used to optimize the step size and attraction, which enhances the global search ability and local convergence performance of the algorithm.

[0034] 2. The present invention gives priority to containers with small migration loads when selecting containers to be migrated, thereby reducing the bandwidth and storage resource consumption required for migration, improving migration efficiency, saving overall resources of the data center, and reducing operating costs.

[0035] 3. The present invention adopts an adaptive step size mechanism, which makes the step size larger in the early stage of iteration to facilitate global search, and gradually reduces it in the later stage to carry out refined local development, avoiding insufficient convergence in the early stage or oscillation in the later stage, significantly improving the convergence accuracy and efficiency of the algorithm, so that it can show better optimization effect in different stages. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flow chart of the present invention.

[0037] Figure 2 It is a schematic diagram of a container migration device of the present invention. DETAILED DESCRIPTION

[0038] The present invention will be further explained below based on the accompanying drawings and specific embodiments.

[0039] In the implementation process of the present invention, the entire migration system is divided into three modules, including a container selection module, a function calculation module, and an optimization deployment module. Figure 2 shown.

[0040] First, the container selection module. This is the preparation stage for container migration. Overloaded hosts are screened by the overall load and CPU utilization of the host. A container is selected from each screened overloaded host and added to the set of containers to be migrated. The specific method is to first sort the containers in the host according to their respective RAM utilization, and then select the first container that meets the conditions from the sorted set. See steps 2 and 3 for details.

[0041] Secondly, the function computing module and the optimization deployment module migrate the container to the target host. This is the core stage of container migration. The firefly algorithm is used to find the optimal solution that satisfies the objective function. The specific algorithm includes: initializing basic parameters, see step 4 for details; calculating the distance between fireflies to obtain the relative attraction, see steps 5 and 6 for details; updating the position of fireflies according to the attraction and step length to obtain the optimal solution, see steps 7 and 8 for details; and implementing container migration based on the optimal solution, see step 9 for details.

[0042] like Figure 1 As shown in the figure, a cloud native platform container migration method based on the improved firefly algorithm is shown in the figure. The detailed steps are as follows:

[0043] Step 1: Get the host set HostList in the data center = {H1, H2, ..., H j , …, H m}, there are m hosts in the set, of which H j Indicates the resource utilization rate of the j-th host HostUsage j =(hCPU j , hRAM j ,hBW j , hIO j ), where hCPU i 、hRAM i ,hBW i 、hIO i Represent the CPU utilization, memory utilization, bandwidth utilization and IO utilization of the jth host respectively. Get the container set ConList = {C1, C2, ..., C i ,…,C n}, there are n containers in the collection, of which C i Indicates the resource utilization rate ConUsage of the i-th container. i =(cCPU i , cRAM i ,cBW i, cIO i ), where cCPU i 、cRAM i ,cBW i 、cIO i They represent the CPU utilization, memory utilization, bandwidth utilization, and IO utilization of the i-th container respectively.

[0044] Step 2: Update the host load set HostLoadList according to formula (1): {hostLoad1, hostLoad2, ..., hostLoad i , …, hostLoad m}

[0045] hostLoad i =k1hCPU i +k2hRAM i +k3hB i +k4hIO i #(1)

[0046] where hostLoad i represents the load of the i-th host, k1, k2, k3, k4 represent the weights of CPU utilization, RAM utilization, BW utilization and IO utilization respectively, and k1+k2+k3+k4=1.

[0047] Step 3: Set the host CPU overload threshold T CPU and the overall load threshold T total , if the CPU utilization of the jth host is hCPU j Greater than the host CPU overload threshold T CPU or hostLoad of the jth host j Greater than the overall load threshold T total , add the current host to the overload host set, and obtain the overload host set OverHostList = {overH1, overH2, ..., overH i ,…,overH l}.

[0048] Set the container CPU low load threshold cCPU min , select a host from the overloaded host set OverHostList in turn, sort the container set in the host according to the memory utilization cRam from small to large, and sort the first container set in the sorted container set whose CPU utilization cCPU is less than cCPU min The container is added to the container collection to be migrated MigrateConList.

[0049] Step 4 Set the number of fireflies in the firefly algorithm to n, where n is a random integer between (10, 15), the maximum number of iterations maxG = 50, the adaptive parameter α0 = 0.9, and initialize the position of each firefly X = {X1, X2, ..., X i , …, X n}, where X i It is a possibility to map a container to a host. i ={cH1, cH2, ..., cH j , …, cH m}, where m is the number of containers in the container set to be migrated MigrateConList, cH j Indicates the location where the j-th container is mapped to the host, and the number of initialization iterations is t=1.

[0050] Step 5: Calculate the Cartesian distance r between any two fireflies according to formula (2): ij

[0051]

[0052] According to formula (3), the light intensity attenuation coefficient γ is calculated ij

[0053]

[0054] Where d represents the dimension of the solution vector, that is, the number of containers in the container set MigrateConList to be migrated, X i,k represents the kth component of the i-th firefly, r avg is the average distance from the i-th firefly to other fireflies, expressed as

[0055]

[0056] Step 6: Calculate the relative attraction β between fireflies according to formula (4) ij (r ij )

[0057]

[0058] where r ij It represents the Cartesian distance from the i-th firefly to the j-th firefly, β0 is the minimum attraction, β0=0.1.

[0059] Step 7: Substitute each pair of fireflies in the set into formula (5) and calculate the solution vector X corresponding to the larger result. i (t) Update the firefly's position X according to formula (6) i (t+1)

[0060]

[0061] Where W is the information load energy consumption, C is the total operating cost, and W min and W max They represent the minimum and maximum values ​​of information load energy consumption, C min and C max They respectively represent the minimum and maximum values ​​of the total operating cost, m1+m2=1.

[0062] X i (t+1)=X i (t)+β ij (r ij )×(X j (t)-X i (t))+α(t+1)×(rand-0.5)#(6)

[0063] Among them, X i (t) represents the position of the i-th firefly at the t-th iteration, X j (t) is the solution vector corresponding to the smaller calculation result, α(t+1) represents the step size at the t+1th iteration, rand is a random value between (0, 1), k is the curve attenuation rate, k=3.

[0064]

[0065] If the number of iterations t is equal to the maximum number of iterations maxG, the final position set of fireflies X = {X1, X2, ..., X i , …, X n}, otherwise, the number of iterations t increases by 1 and jumps to step 5.

[0066] Step 8: Set the firefly final position set X = {X1, X2, ..., X i , …, X n}Every solution vector X i Substitute it into formula (5) and take the solution vector corresponding to the minimum result as the final migration solution X fin ={cH1, cH2, ..., cH j , …, cH m}.

[0067] Step 9: According to the final migration plan X fin ={cH1, cH2, ..., cH j , …, cH m}Migrate the corresponding container to the target host and the migration is completed.

[0068] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A cloud native platform container migration method based on an improved firefly algorithm, characterized in that: The steps include: Step 1: Get the host set HostList in the data center = {H1, H2, ..., H j ,…,H m }; Step 2: Update the host load set HostLoadList according to formula (1): {hostLoad1, hostLoad2, ..., hostLoad i ,…,hostLoad m } hostLoad i =k1hCPU i +k2hRAM i +k3hBW i +k4hIO i #(1) where hostLoad i represents the load of the i-th host, k1, k2, k3, k4 represent the weights of CPU utilization, RAM utilization, BW utilization and IO utilization respectively, and k1+k2+k3+k4=1; Step 3: Set the host CPU overload threshold T CPU and the overall load threshold T total ; Step 4: Set the number of fireflies in the firefly algorithm to n, where n is a random integer between (10, 15), the maximum number of iterations maxG = 50, the adaptive parameter α0 = 0.9, and initialize the position of each firefly X = {X1, X2, …, X i ,…,X n }, where X i It is a possibility to map a container to a host. i ={cH1,cH2,…,cH j ,…,cH m }, where m is the number of containers in the container set to be migrated MigrateConList, cH j Indicates the location where the jth container is mapped to the host, and the number of initialization iterations is t = 1; Step 5: Calculate the Cartesian distance r between any two fireflies ij and the light intensity attenuation coefficient γ ij ; Step 6: Calculate the relative attraction β between fireflies ij (r ij ); Step 7: Substitute each pair of fireflies in the set into formula (5) and calculate the solution vector X corresponding to the larger result. i (t) Update the firefly's position X according to formula (6) i (t+1) Where W is the information load energy consumption, C is the total operating cost, and W min and W max They represent the minimum and maximum values ​​of information load energy consumption, C min and C max Respectively represent the minimum and maximum values ​​of the total operating cost, m1+m2=1, X i (t+1)=X i (t)+β ij (r ij )×(X j (t)-X i (t))+α(t+1)×(rand-0.5)#(6) Among them, X i (t) represents the position of the i-th firefly at the t-th iteration, X j (t) is the solution vector corresponding to the smaller calculation result, α(t+1) represents the step size at the t+1th iteration, rand is a random value between (0,1), k is the curve decay rate, k=3; If the number of iterations t is equal to the maximum number of iterations maxG, the final position set of fireflies X = {X1, X2, ..., X i ,…,X n }, otherwise, the number of iterations t increases by 1 and jumps to step 5; Step 8: Set the firefly final position set X = {X1, X2, …, X i ,…,X n }Every solution vector X i Substitute it into formula (5) and take the solution vector corresponding to the minimum result as the final migration solution X fin ={cH1,cH2,…,cH j ,…,cH m }; Step 9: According to the final migration plan X fin ={cH1,cH2,…,cH j ,…,cH m }Migrate the corresponding container to the target host and the migration is completed.

2. According to claim 1, a cloud native platform container migration method based on an improved firefly algorithm is characterized in that: There are m hosts in the host list in step 1, where H j Indicates the resource utilization rate of the j-th host HostUsage j =(hCPU j ,hRAM j ,hBW j ,hIO j ), where hCPU i 、hRAM i ,hBW i 、hIO i Represent the CPU utilization, memory utilization, bandwidth utilization and IO utilization of the jth host respectively, and obtain the container set ConList = {C1, C2, ..., C i ,…,C n }, there are n containers in the collection, of which C i Indicates the resource utilization rate ConUsage of the i-th container. i =(cCPU i ,cRAM i ,cBW i ,cIO i ), where cCPU i 、cRAM i ,cBW i 、cIO i They represent the CPU utilization, memory utilization, bandwidth utilization, and IO utilization of the i-th container respectively.

3. According to the cloud native platform container migration method based on the improved firefly algorithm according to claim 1, it is characterized in that: The specific content of step 3 is: if the CPU utilization rate of the jth host is hCPU j Greater than the host CPU overload threshold T CPU or hostLoad of the jth host j Greater than the overall load threshold T total , add the current host to the overload host set, and obtain the overload host set OverHostList = {overH1, overH2, ..., overH i ,…,overH l }; Set the container CPU low load threshold cCPU min , select a host from the overloaded host set OverHostList in turn, sort the container set in the host according to the memory utilization cRam from small to large, and sort the first container set in the sorted container set whose CPU utilization cCPU is less than cCPU min The container is added to the container collection to be migrated MigrateConList.

4. According to claim 1, a cloud native platform container migration method based on an improved firefly algorithm is characterized in that: The Cartesian distance r between any two fireflies in step 5 ij The calculation formula is as follows: Light intensity attenuation coefficient γ ij The calculation formula is as follows: Among them, d represents the dimension of the solution vector, that is, the number of containers in the container set MigraeConList to be migrated, X i,k represents the kth component of the i-th firefly, r avg is the average distance from the i-th firefly to other fireflies, expressed as 5. According to claim 1, a cloud native platform container migration method based on an improved firefly algorithm is characterized in that: The relative attraction β between the fireflies in step 6 ij (r ij ) is calculated as follows: where r ij It represents the Cartesian distance from the i-th firefly to the j-th firefly, β0 is the minimum attraction, β0=0.1.

Citation Information

Patent Citations

  • Container dynamic migration method and system based on minimum migration quantity

    CN107992353A

  • CMP task scheduling method of improved firefly algorithm

    CN112395059A

  • Data warehouse ETL scheduling optimization method for improving discrete firefly algorithm

    CN113535683A

  • Path planning method based on fusion of improved firefly algorithm and dynamic window method

    CN115129064A

  • Cloud data center-oriented computing task cross-region migration method and system

    CN115718644A