A cloud-native platform container migration method based on an improved firefly algorithm
By improving the Firefly algorithm and introducing adaptive parameters and step size mechanism, the container migration process is optimized, which solves the problems of slow convergence speed and insufficient accuracy of the traditional Firefly algorithm in container migration, and achieves efficient resource utilization and cost optimization.
Patent Information
- Application Number
- CN202510015792.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-01-06
AI Technical Summary
Traditional firefly algorithms suffer from problems such as unstable optimization performance due to the choice of control parameters, slow convergence speed, and limited convergence accuracy during container migration, making it difficult to achieve ideal optimization results in complex problems.
By introducing adaptive parameters and combining adaptive step size and attraction mechanism, the global and local search capabilities of the firefly algorithm are optimized. By screening overloaded hosts and containers to be migrated, an objective function is established and the container migration process is iteratively optimized.
It improves the global search capability and local convergence performance of container migration, reduces migration bandwidth and storage resource consumption, lowers operating costs, and improves migration efficiency and algorithm convergence accuracy.
Smart Images

Figure CN119938226B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a cloud-native platform container migration method based on an improved firefly algorithm, and belongs to the field of cloud computing. BACKGROUND
[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 of application complexity and diversity, the resource management mode of traditional data centers gradually appears to be inadequate. In order to more efficiently meet the needs of flexible computing and resource optimization, cloud-native platforms have emerged as the core technology of the new generation of cloud computing infrastructure.
[0003] Cloud-native platforms are based on containerization technology and provide unified resource abstraction and management interfaces to achieve decoupling of applications and underlying hardware. With the support of cloud-native platforms, containers have gradually become the core unit of carrying cloud computing tasks. In order to meet the needs of energy consumption and cost optimization, container migration within 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, overall energy consumption can be effectively reduced, resource utilization can be improved, and data center operating costs can be reduced. However, the container migration process involves the trade-off of multiple targets such as energy consumption, bandwidth, and migration time. During the migration process, not only is it necessary to minimize energy consumption, but it is also necessary to control the migration time to avoid service interruption or performance degradation; at the same time, it is also necessary to reasonably allocate bandwidth resources to prevent network congestion. These conflicting goals make the optimization process extremely complex, and in a dynamic load environment, migration decisions need to respond to changes in real time, increasing the difficulty and computational complexity of data center energy efficiency management.
[0004] To address multi-objective optimization problems in container migration, widely used optimization algorithms include Particle Swarm Optimization (PSO) and Genetic Algorithm (GA). PSO excels in search speed and computational efficiency, converging quickly to near-optimal solutions, making it suitable for large-scale problems. However, PSO is prone to getting trapped in local optima, especially in complex, multi-modal optimization problems where it struggles to achieve a global optimum. In contrast, GA offers better global search capabilities, but its operation is complex and computationally expensive. Based on these issues, the Firefly Algorithm (FA), a bio-inspired swarm intelligence optimization algorithm, has gained increasing attention. The Firefly Algorithm not only possesses excellent global search capabilities but also continuously updates its brightness and attractiveness during iterations, dynamically adjusting its search direction and effectively avoiding local optima traps. Despite its excellent performance in many optimization problems, the Firefly Algorithm still has some shortcomings. First, its optimization performance depends on the selection of control parameters, which can lead to unstable performance across different problems. Second, the Firefly Algorithm has a slow convergence speed and limited convergence accuracy, making it difficult to achieve ideal optimization results in complex problems. To address these issues, this invention proposes a cloud-native platform container migration method based on an improved firefly algorithm. Summary of the Invention
[0005] To address the shortcomings and deficiencies of existing methods, this 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 and local searches, giving it strong adaptability and stability in multi-objective optimization tasks. Therefore, it shows significant application potential in energy consumption and cost optimization for container migration. The main idea of this method is as follows: First, obtain the hosts and containers in the data center and their respective resource utilization rates; second, filter overloaded hosts and then select a set of containers to be migrated; third, establish the objective function for container migration, add constraints, and initialize the initial parameters of the firefly algorithm; further, calculate the relative distance between fireflies to obtain the relative attraction, update the firefly positions based on the attraction and step size, and obtain the optimal solution through iteration; finally, realize the container migration based on the optimal solution to complete the overall container migration process.
[0006] The technical solution of this invention is: a cloud-native platform container migration method based on an improved firefly algorithm, the main steps of which are as follows:
[0007] Step 1: Obtain the host collection HostList = {H1, H2, ..., H...} in the data center j H m The set contains m hosts, of which H j HostUsage represents the resource utilization of the j-th host. j =(hCPUj 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. Obtain the container set ConList = {C1, C2, …, Ci , , …, C n}, which contains n containers in total, where C i represents the ith container, and the resource utilization of the ith container is ConUsage i = (cCPU i , cRAM i , cBW i , cIO i ), where cCPU i , cRAM i , cBW i , cIO i represent the CPU utilization, memory utilization, bandwidth utilization and IO utilization of the ith container, respectively.
[0008] Step 2: Update the host load set HostLoadList = {hostLoad1, hostLoad2, …, hostLoad i , …, hostLoad m} according to formula (1).
[0009] hostLoad i = k1hCPU i + k2hRAM i + k3hBW i + k4hIO i #(1)
[0010] where hostLoad i represents the ith host load situation, and 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 hCPU j is greater than the host CPU overload threshold T CPU or the jth host load hostLoadj Greater than the overall load threshold T total Add the current host to the overloaded host set, resulting in an overloaded host set OverHostList = {overH1, overH2, ..., overH...} i , ...,overH l}
[0012] Set the container CPU low load threshold cCPU min From the overloaded host set OverHostList, select one host at a time. Sort the container sets on that host according to their memory utilization (cRam) in ascending order. Then, select the first container in the sorted set whose CPU utilization (cCPU) is less than cCPU. min The container is added to the collection of containers to be migrated, MigrateConList.
[0013] Step 4: Set the number of fireflies in the firefly algorithm to n, where n is... ( 10,15 ) Given random integers, a maximum number of iterations maxG = 50, an adaptive parameter α0 = 0.9, and initialize the position of each firefly X = {X1, X2, ..., X...}. i ,…,X n}, where X i X is a possibility for mapping a container to a host. i ={cH1,cH2,…,cH j ,…,cH m}, where m is the number of containers in the MigrateConList set of containers to be migrated, and cH j This indicates the location of the j-th container mapped to the host, with the initial iteration count t = 1.
[0014] Step 5: Calculate the Cartesian distance r between any two fireflies according to formula (2). ij
[0015]
[0016] The light intensity attenuation coefficient γ is calculated according to formula (3). ij
[0017]
[0018] Where d represents the solution vector dimension, i.e., the number of containers in the MigrateConList set of containers to be migrated, and X i,k Let r represent the k-th component of the i-th firefly. avg Let be the average distance from the i-th firefly to the other fireflies, denoted as .
[0019]
[0020] Step 6: Calculate the relative attraction β between fireflies according to formula (4) ij (r ij )
[0021]
[0022] where r ij is the Cartesian distance from the i-th firefly to the j-th firefly, β0is the minimum attraction, β0= 0.1.
[0023] Step 7: Substitute each pair of fireflies in the set into formula (5) for calculation, and the solution vector X i corresponding to the larger result i (t+1)
[0024]
[0025] where W is the information load energy consumption, C is the total operating cost, W min and W max are the minimum and maximum values of the information load energy consumption respectively, C min and C max are the minimum and maximum values of the total operating cost respectively, 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] where 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 result of calculation, α(t+1) represents the step size at the t+1-th iteration, rand is a random value between (0, 1), k is the curve decay rate, k = 3.
[0028]
[0029] If the iteration number t is equal to the maximum iteration number maxG, the final position set of fireflies X = {X1, X2, …, X i , …, X n} is obtained, otherwise, the iteration number t is increased by 1 and jump to step 5.
[0030] Step 8: each solution vector X in the final position set of firefly X = {X1, X2, …, X i ,…,X n} is substituted into formula (5), and the solution vector corresponding to the minimum result is taken as the final migration scheme X i = {cH1, cH2, …, cH fin ,…,cH j ,…,cH m}.
[0031] Step 9: according to the final migration scheme X fin = {cH1, cH2, …, cH j ,…,cH m}, the corresponding container is migrated to the target host, and the migration ends.
[0032] Compared with the prior art, the present application has the following beneficial effects:
[0033] 1. In the present application, the CPU utilization and overall load of the host are considered when screening the overloaded host; when screening the container set to be migrated, in addition to the CPU utilization of the container leading to the overload of the host (the maximum correlation degree), the migration time of the container is also considered. In the process of finding the target host, the optimization standard firefly algorithm is prone to local optimization, slow convergence speed and stagnation. The dynamic self-adaptive mechanism is used to optimize the step length and attraction, thereby enhancing the global search ability and local convergence performance of the algorithm.
[0034] 2. In the present application, the container with small migration load is preferentially considered when selecting the container to be migrated, thereby reducing the bandwidth and storage resource consumption required for migration, improving the migration efficiency, saving the overall resources of the data center, and reducing the operating cost.
[0035] 3. In the present application, the adaptive step length mechanism is adopted, so that the step length is large in the early iteration, which is beneficial to global search, and gradually decreases in the later period to perform fine local development, thereby avoiding the problems of insufficient convergence in the early stage or oscillation in the later stage, significantly improving the convergence accuracy and efficiency of the algorithm, and making it show good optimization effect in different stages. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 is a flowchart of the present application.
[0037] Figure 2 is a schematic diagram of a container migration device of the present application. DETAILED DESCRIPTION
[0038] The present application will be further explained below according to the drawings and specific embodiments in the specification.
[0039] In the implementation process, the whole migration system is divided into three modules, including container selection module, function calculation module and optimization deployment module, as shown in Figure 2 .
[0040] First, the container selection module. This is the preparation stage of container migration, and the overloaded host is screened through the overall load and CPU utilization of the host. One container is selected from each of the screened overloaded hosts to be added to the set of containers to be migrated. The specific method is to 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, as shown in steps 2 and 3.
[0041] Second, the function calculation module and the optimization deployment module, which migrate the container to the target host. This is the core stage of container migration, which uses the firefly algorithm to find the optimal solution that meets the target function. The specific algorithm includes: initializing the basic parameters, as shown in step 4; calculating the distance between fireflies and then obtaining the relative attraction, as shown in steps 5 and 6; updating the position of the firefly according to the attraction combined with the step length to obtain the optimal solution, as shown in steps 7 and 8; and realizing container migration according to the optimal solution, as shown in step 9.
[0042] As shown in Figure 1 , a cloud native platform container migration method based on an improved firefly algorithm, the detailed steps are as follows:
[0043] Step 1: Obtain the host set HostList = {H1, H2, …, H j , …, H m} in the data center, which contains m hosts, where H j represents the jth host, and the resource utilization of the jth 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. Obtain the container set ConList = {C1, C2, …, C i , …, C n}, which contains n containers, where C i represents the ith container, and the resource utilization of the ith container ConUsage i = (cCPU i , cRAM i , cBW icIO i ), where cCPU i cRAM i cBW i cIO i Let 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 = {hostLoad1, hostLoad2, ..., hostLoad...} according to formula (1). i , ..., hostLoad m}
[0045] hostLoad i =k1hCPU i +k2hRAM i +k3hBW i +k4hIO i #(1)
[0046] hostLoad i Let k represent the load of the i-th host. k1, k2, k3, and 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 overall load threshold T total If the CPU utilization of the j-th host is hCPU j Greater than the host CPU overload threshold T CPU Or the load on the j-th host. j Greater than the overall load threshold T total Add the current host to the overloaded host set, resulting in an overloaded host set OverHostList = {overH1, overH2, ..., overH...} i , ...,overH l}
[0048] Set the container CPU low load threshold cCPU min From the overloaded host set OverHostList, select one host at a time. Sort the container sets on that host according to their memory utilization (cRam) in ascending order. Then, select the first container in the sorted set whose CPU utilization (cCPU) is less than cCPU. min The container is added to the collection of containers 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 X is a possibility for mapping a container to a host. i ={cH1, cH2, ..., cH j , ..., cH m}, where m is the number of containers in the MigrateConList set of containers to be migrated, and cH j This indicates the location of the j-th container mapped to the host, with the initial iteration count t = 1.
[0050] Step 5: Calculate the Cartesian distance r between any two fireflies according to formula (2). ij
[0051]
[0052] The light intensity attenuation coefficient γ is calculated according to formula (3). ij
[0053]
[0054] Where d represents the solution vector dimension, i.e., the number of containers in the MigrateConList set of containers to be migrated, and X i,k Let r represent the k-th component of the i-th firefly. avg Let be the average distance from the i-th firefly to the other fireflies, denoted as .
[0055]
[0056] Step 6: Calculate the relative attraction β between fireflies according to formula (4). ij (r ij )
[0057]
[0058] Where r ij Let β0 represent the Cartesian distance from the i-th firefly to the j-th firefly, where β0 is the minimum attraction and β0 = 0.1.
[0059] Step 7: Substitute each pair of fireflies in the set into formula (5) to calculate, and the solution vector X corresponding to the larger result is... 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 running cost, W min and W max represent the minimum and maximum values of the information load energy consumption, C min and C max represent the minimum and maximum values of the total running 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] where 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+1-th iteration, rand is a random value between (0, 1), and k is the curve decay rate, k=3.
[0064]
[0065] If the iteration number t is equal to the maximum iteration number maxG, the final position set of the firefly X = {X1, X2, …, X i , …, X n} is obtained, otherwise, the iteration number t is incremented by 1 and the process jumps to step 5.
[0066] Step 8: Substitute each solution vector X i in the final position set of the firefly X = {X1, X2, …, X n , …, X i} into formula (5), and take the solution vector corresponding to the smallest result as the final migration scheme X fin = {cH1, cH2, …, cH j , …, cH m}.
[0067] Step 9: According to the final migration scheme X fin = {cH1, cH2, …, cH j , …, cH m}, the corresponding containers are migrated to the target host, and the migration is completed.
[0068] The above merely describes preferred embodiments of the present application and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A cloud-native platform container migration method based on an improved firefly algorithm, characterized in that, Includes the following steps: Step 1: Obtain the host collection HostList = {H1, H2, ..., H...} in the data center j ,…,H m }; Step 2: Update the host load set HostLoadList = {hostLoad1, hostLoad2, ..., hostLoad...} according to formula (1). i ,…,hostLoad m } hostLoad i =k1hCPU i +k2hRAM i +k3hBW i +k4hIO i #(1) hostLoad i Let k1, k2, k3, and 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 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 X is a possibility for mapping a container to a host. i ={cH1,cH2,…,cH j ,…,cH m }, where m is the number of containers in the MigrateConList set of containers to be migrated, and cH j This indicates the location of the j-th container mapped to the host, with the initial iteration count t = 1; Step 5: Calculate the Cartesian distance r between any two fireflies. ij and 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) to calculate, and the solution vector X corresponding to the larger result is... i (t) Update the firefly's position X according to formula (6). i (t+1) Where W represents information load energy consumption, and C represents total operating cost. min and W max C represents the minimum and maximum energy consumption of information load, respectively. min and C max Let m1 and m2 represent the minimum and maximum values of the total operating cost, respectively, and 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 in the t-th iteration, X j (t) is the solution vector corresponding to the smaller calculation result, α(t+1) represents the step size in the (t+1)th iteration, rand is a random value between (0,1), k is the curve decay rate, k=3; If the number of iterations t equals the maximum number of iterations maxG, then the final set of firefly positions X = {X1, X2, ..., X} is obtained. i ,…,X n Otherwise, increment the iteration count t by 1 and jump to step 5; Step 8: Set the final location set of fireflies X = {X1, X2, ..., X...} i ,…,X n Each solution vector X in} i Substituting into formula (5), the solution vector corresponding to the minimum result is taken as the final migration scheme X. fin ={cH1,cH2,…,cH j ,…,cH m }; Step 9: Based on the final migration plan X fin ={cH1,cH2,…,cH j ,…,cH m The corresponding container is then migrated to the target host, and the migration is complete.
2. The cloud-native platform container migration method based on the improved firefly algorithm according to claim 1, characterized in that, The HostList set in step 1 contains a total of m hosts, of which H j HostUsage represents the resource utilization of the j-th host. j =(hCPU j hRAM j hBW j hIO j ), where hCPU i hRAM i hBW i hIO i Let these represent the CPU utilization, memory utilization, bandwidth utilization, and I / O utilization of the j-th host, respectively. Obtain the container set ConList = {C1, C2, ..., C...} i ,…,C n The set contains n containers, where C i Represents 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 Let represent the CPU utilization, memory utilization, bandwidth utilization, and IO utilization of the i-th container, respectively.
3. The cloud-native platform container migration method based on the improved firefly algorithm according to claim 1, characterized in that, The specific content of step 3 is: if the CPU utilization of the j-th host is hCPU j Greater than the host CPU overload threshold T CPU Or the load on the j-th host. j Greater than the overall load threshold T total Add the current host to the overloaded host set, resulting in an overloaded host set OverHostList = {overH1, overH2, ..., overH...} i ,…,overH l }; Set the container CPU low load threshold cCPU min From the overloaded host set OverHostList, select one host at a time. Sort the container sets on that host according to their memory utilization (cRam) in ascending order. Then, select the first container in the sorted set whose CPU utilization (cCPU) is less than cCPU. min The container is added to the collection of containers to be migrated, MigrateConList.
4. The cloud-native platform container migration method based on the improved firefly algorithm according to claim 1, characterized in that, In step 5, the Cartesian distance r between any two fireflies ij The calculation formula is as follows: Light intensity attenuation coefficient γ ij The calculation formula is as follows: Where d represents the solution vector dimension, i.e., the number of containers in the MigraeConList set of containers to be migrated, and X i,k Let r represent the k-th component of the i-th firefly. avg Let be the average distance from the i-th firefly to the other fireflies, denoted as .
5. A cloud-native platform container migration method based on an improved firefly algorithm according to claim 1, characterized in that, The relative attraction β between fireflies in step 6 ij (r ij The calculation formula for ) is as follows: Where r ij Let β0 represent the Cartesian distance from the i-th firefly to the j-th firefly, where β0 is the minimum attraction and β0 = 0.1.
Citation Information
Patent Citations
CMP task scheduling method of improved firefly algorithm
CN112395059A
Cloud data center-oriented computing task cross-region migration method and system
CN115718644A