A container migration scheduling method, apparatus, device, medium, and program product.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-16
- Publication Date
- 2026-08-14
AI Technical Summary
它们普遍存在容易陷入局部最优解的缺陷,即算法过早收敛于一个次优的迁移方案,无法找到真正成本最低的全局最优解,导致最终得到的迁移方案在迁移总时间、服务性能损失以及数据中心能源消耗等方面的综合成本依然高昂
[0023]Compared with existing technologies, the container migration scheduling method, apparatus, device, media, and program products disclosed in this invention randomly generate multiple initial container migration schemes. With the goal of minimizing the total migration cost of these schemes, differentiated scheme update strategies are implemented for container migration schemes with different costs. This guides different schemes to undergo local fine-tuning or large-scale redistribution exploration. Gaussian noise perturbation is introduced for mutation processing, increasing the diversity of the container migration scheme set and achieving the optimal discrete mapping from containers to physical servers. This effectively avoids getting trapped in local optima and quickly finds a near-global optimal container migration scheme. While ensuring migration feasibility, minimizing the total migration cost of container migration schemes effectively improves resource utilization, reduces load variance, and shortens scheduling decision time. This invention significantly improves convergence speed and scheduling efficiency, reduces performance loss, migration time, and energy consumption during the migration process, and is suitable for real-time container migration scheduling scenarios on large-scale cloud-native platforms.
Smart Images

Figure CN122570069A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud-native container technology, and in particular to a container migration scheduling method, apparatus, device, medium, and program product. Background Technology
[0002] In containerized cloud platforms, due to the dynamic changes in business load, some physical servers (hosts) may be overloaded, while other servers are under light load. Therefore, container migration is a key technology to solve uneven load and ensure service quality.
[0003] However, existing migration decision-making methods still face many serious challenges when dealing with large-scale, highly dynamic cloud-native environments. Current container migration solutions are usually based on simple rule-based methods with preset thresholds, triggering migration only based on instantaneous resource utilization (such as CPU exceeding 80%). Although these methods have low computational overhead, their decision-making logic is too rigid and lacks consideration for the overall system state and the long-term impact of migration. This can easily lead to containers being unnecessarily and frequently migrated in and out between nodes. Not only does this fail to fundamentally optimize the load, but the continuous migration operations themselves also bring significant performance overhead, increase network congestion and service latency, ultimately resulting in high total migration costs.
[0004] To find better solutions, current solutions often incorporate various metaheuristic algorithms, such as traditional genetic algorithms and particle swarm optimization. However, these traditional optimization algorithms often underperform when solving high-dimensional, multi-constraint combinatorial optimization problems like container migration. They generally suffer from the drawback of easily getting trapped in local optima, meaning the algorithm prematurely converges to a suboptimal migration solution, failing to find the truly lowest-cost global optimum. This results in a final migration solution with high overall costs in terms of total migration time, service performance loss, and data center energy consumption. Summary of the Invention
[0005] The purpose of this invention is to provide a container migration scheduling method, apparatus, device, medium, and program product that can quickly find a near-globally optimal container migration scheme, effectively avoid local optima, and significantly improve the solution speed.
[0006] To achieve the above objectives, embodiments of the present invention provide a container migration scheduling method, comprising: Based on the status information of the containers to be migrated and all servers, several initial container migration plans are randomly generated to obtain the current migration plan set; Select the container migration scheme with the lowest total migration cost from the current set of migration schemes as the globally optimal migration scheme; Perform a first update operation on the current migration scheme set to obtain an updated migration scheme set; wherein, the first update operation is: perform different scheme update strategies on container migration schemes with different total migration costs in the current migration scheme set, and introduce Gaussian noise perturbation for mutation processing to generate updated container migration schemes, thereby obtaining an updated migration scheme set. Perform a second update operation on the globally optimal migration scheme; wherein, the second update operation is: select the container migration scheme with the lowest total migration cost in the updated migration scheme set, and denot it as the current optimal migration scheme; if the total migration cost of the current optimal migration scheme is less than the total migration cost of the globally optimal migration scheme, update the globally optimal migration scheme as the current optimal migration scheme. The updated migration scheme set is used as the current migration scheme set. The first update operation and the second update operation are re-executed until the preset iteration termination condition is met, and the final global optimal migration scheme is obtained.
[0007] As an improvement to the above solution, the first update operation is specifically as follows: Based on the total migration cost of each container migration scheme in the current migration scheme set, the container migration schemes are divided into a high-cost group and a low-cost group; A local fine-tuning scheme update strategy is implemented for container migration schemes in the low-cost group, and a large-scale reallocation scheme update strategy is implemented for container migration schemes in the high-cost group. Gaussian noise perturbation is introduced into each of the container migration schemes, and the container positions in the container migration schemes are randomly adjusted to obtain the mutated container migration schemes. The total migration cost of the modified container migration scheme is compared one by one with that of the corresponding initial container migration scheme. The container migration scheme with the lower total migration cost is retained to obtain the updated migration scheme set.
[0008] As an improvement to the above scheme, the scheme update strategy for performing local fine-tuning on the container migration scheme in the low-cost group includes: For all container migration schemes in the low-cost group, a probability vector and weight coefficients are randomly generated; Based on the probability vector and the weight coefficients, the following update strategy is adopted for each container migration scheme:
[0009] in, The server assigned to the i-th container in the updated j-th container migration scheme. The server allocated to the i-th container in the original j-th container migration scheme. The server allocated to the i-th container in the globally optimal migration scheme; Let i be the i-th element in the probability vector. Let m be the weighting coefficient, and m be the number of containers.
[0010] As an improvement to the above scheme, the scheme update strategy of performing large-scale reallocation of container migration schemes in the high-cost group includes: For all container migration schemes in the high-cost group, randomly generate exploration vectors and scaling factors; Based on the exploration vector and the scaling factor, the following update strategy is adopted for each container migration scheme:
[0011] in, The server assigned to the i-th container in the updated j-th container migration scheme. The server allocated to the i-th container in the original j-th container migration scheme. The server allocated to the i-th container in the globally optimal migration scheme; Let i be the i-th element in the exploration vector. Let m be the scaling factor, and m be the number of containers.
[0012] As an improvement to the above scheme, the step of introducing Gaussian noise perturbation into each of the container migration schemes and randomly adjusting the container positions in the container migration schemes to obtain a mutated container migration scheme includes: For all container migration schemes after the scheme update strategy has been executed, generate Gaussian random noise; Calculate the random noise perturbation based on the Gaussian random noise to update the server assigned to the container in the container migration scheme:
[0013] in, Let i be the server assigned to the i-th container in the j-th container migration scheme after the mutation processing. This refers to the server allocated to the i-th container in the original updated j-th container migration plan. Let n be the Gaussian random noise, and n be the number of servers.
[0014] As an improvement to the above solution, the step of randomly generating several initial container migration schemes based on the status information of the containers to be migrated and all servers includes: Obtain the status information of the containers to be migrated and all servers; Based on the state information, a number of initial container migration schemes are randomly generated using the Logistic chaotic mapping method.
[0015] As an improvement to the above scheme, the status information of the container includes a container list and a resource requirement vector for each container in the container list, and the status information of the server includes a server list and an available resource vector for each server in the server list.
[0016] As an improvement to the above scheme, based on the state information, a Logistic chaotic mapping method is used to randomly generate several initial container migration schemes, including: Set initial running parameters; wherein, the initial running parameters include the number of traversals, the mapping parameters of the Logistic chaotic mapping formula, and the random seed; Traverse the list of containers and use the Logistic chaotic mapping formula to assign a server to each container in turn. When the number of mappings reaches the number of containers, an initial container migration scheme is formed; After repeating the traversal a certain number of times, several initial container migration schemes are obtained.
[0017] As an improvement to the above solution, the method further includes: The total migration cost of the container migration scheme is calculated using the following steps: For each of the container migration schemes, calculate the average utilization of each resource and the global average utilization of each of the servers. Based on the average utilization and the global average utilization, calculate the resource imbalance penalty for each of the servers; The resource imbalance penalty is normalized using a normalized exponential function to calculate the normalized weight of the resource imbalance penalty. Calculate the weighted sum of the resource imbalance penalties for all the servers to obtain the total migration cost of the container migration scheme.
[0018] As an improvement to the above scheme, the preset iteration termination condition is: the current iteration number reaches the preset maximum iteration number threshold, or the change rate of the total migration component table of the global optimal migration scheme is less than the preset change rate threshold.
[0019] This invention also provides a container migration scheduling apparatus, comprising: The initial migration plan generation module is used to randomly generate several initial container migration plans based on the status information of the containers to be migrated and all servers, thus obtaining the current migration plan set. The global optimal solution selection module is used to select the container migration solution with the lowest total migration cost from the current migration solution set as the global optimal migration solution. The container migration scheme update module is used to perform a first update operation on the current migration scheme set to obtain an updated migration scheme set; wherein, the first update operation is: to perform different scheme update strategies on container migration schemes with different total migration costs in the current migration scheme set, and to introduce Gaussian noise perturbation for mutation processing to generate updated container migration schemes, thereby obtaining an updated migration scheme set. The global optimal solution update module is used to perform a second update operation on the global optimal migration solution; wherein, the second update operation is: selecting the container migration solution with the lowest total migration cost in the updated migration solution set, and denoting it as the current optimal migration solution; if the total migration cost of the current optimal migration solution is less than the total migration cost of the global optimal migration solution, the global optimal migration solution is updated to the current optimal migration solution. The global optimal solution output module is used to take the updated migration solution set as the current migration solution set, re-execute the first update operation and the second update operation until the preset iteration termination condition is met, and obtain the final global optimal migration solution.
[0020] This invention also provides a container migration scheduling device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the container migration scheduling method as described in any of the preceding embodiments.
[0021] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the container migration scheduling method as described in any of the preceding embodiments.
[0022] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the container migration scheduling method as described above.
[0023] Compared with existing technologies, the container migration scheduling method, apparatus, device, media, and program products disclosed in this invention randomly generate multiple initial container migration schemes. With the goal of minimizing the total migration cost of these schemes, differentiated scheme update strategies are implemented for container migration schemes with different costs. This guides different schemes to undergo local fine-tuning or large-scale redistribution exploration. Gaussian noise perturbation is introduced for mutation processing, increasing the diversity of the container migration scheme set and achieving the optimal discrete mapping from containers to physical servers. This effectively avoids getting trapped in local optima and quickly finds a near-global optimal container migration scheme. While ensuring migration feasibility, minimizing the total migration cost of container migration schemes effectively improves resource utilization, reduces load variance, and shortens scheduling decision time. This invention significantly improves convergence speed and scheduling efficiency, reduces performance loss, migration time, and energy consumption during the migration process, and is suitable for real-time container migration scheduling scenarios on large-scale cloud-native platforms. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating a container migration scheduling method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the container migration scheduling system in an embodiment of the present invention; Figure 3 This is a flowchart illustrating a preferred container migration scheduling method in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a container migration scheduling device provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0027] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0028] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0029] It's important to note that in the physical / virtual deployment architecture of a cloud-native platform, a server (host) refers to the physical server in the cloud data center. It's a collection of physical hardware resources such as CPU, memory, disk, and network. Each host has its own available resource limit and serves as the runtime environment for containers. A container is a business application unit packaged using containerization technologies (such as Docker). Each container requests fixed or dynamic hardware resources from the host based on its own business needs. Multiple containers can share the hardware resources of the same host and can migrate between different hosts. Container migration effectively solves the problem of uneven load distribution, such as host overload or light load.
[0030] This invention proposes a cloud-native container migration scheduling method based on the Improved Horned Lizard Optimization Algorithm (IHLOA). The container migration scheduling problem is modeled as an optimization problem with the objective of minimizing the total migration cost (including service performance loss, migration time and energy consumption), and the Improved Horned Lizard Optimization Algorithm (IHLOA) is used to solve the problem.
[0031] See Figure 1 This is a flowchart illustrating a container migration scheduling method provided in an embodiment of the present invention. The embodiment of the present invention provides a container migration scheduling method, including steps S11 to S15: S11. Based on the status information of the containers to be migrated and all servers, randomly generate several initial container migration schemes to obtain the current migration scheme set.
[0032] First, obtain the container list C = {c1, c2, ..., c3} formed by the containers to be migrated. i ,..., cm} and a server list S = {s1, s2, ..., s} formed by all servers. i ,...,s n Let m be the number of containers and n be the number of servers. Resource vectors and output results are also defined. A pre-defined random generation algorithm, such as the Kent chaotic mapping algorithm or the Logistic chaotic mapping algorithm, is used. Basic operating parameters, such as the total number of migration schemes tn and algorithm parameters, are set. Several initial container migration schemes are randomly generated based on this algorithm, avoiding the aggregation of traditional random initialization. Each container migration scheme includes the mapping relationship between the servers allocated to the containers to be migrated, represented as X=[x1,x2,...,x...]. i ...,x n] x i Represents container c i The assigned server, the container migration scheme set STX=[X1,X2,...,Xj...,Xtn].
[0033] S12. Select the container migration scheme with the lowest total migration cost from the current migration scheme set as the globally optimal migration scheme.
[0034] Define the goal of minimizing the total migration cost as the objective function, and calculate the total migration cost for each initial container migration scheme. The container migration solution with the lowest total migration cost from the current set of solutions is selected and temporarily considered the globally optimal migration solution. .
[0035] S13. Perform a first update operation on the current migration scheme set to obtain an updated migration scheme set; wherein, the first update operation is: perform different scheme update strategies on container migration schemes with different total migration costs in the current migration scheme set, and introduce Gaussian noise perturbation for mutation processing to generate updated container migration schemes and obtain an updated migration scheme set. S14. Perform a second update operation on the globally optimal migration scheme; wherein, the second update operation is: select the container migration scheme with the lowest total migration cost in the updated migration scheme set, and denot it as the current optimal migration scheme; if the total migration cost of the current optimal migration scheme is less than the total migration cost of the globally optimal migration scheme, update the globally optimal migration scheme as the current optimal migration scheme.
[0036] Entering the main loop, the iteration counter t is initialized to 0. In each iteration, based on the total migration cost of different container migration schemes, different scheme update strategies are executed for different container migration schemes, thereby precisely adjusting the optimal discrete mapping between containers and servers. Gaussian noise perturbation is then introduced into all initially updated container migration schemes to randomly adjust the container placement positions in the schemes, enhancing search diversity. The final updated container migration schemes form an updated migration scheme set.
[0037] Calculate the total migration cost for each container migration scheme in the update migration scheme set, and find the container migration scheme with the lowest cost. and the historical globally optimal migration scheme The comparison and update are performed, and the solution with the lower cost is selected as the updated globally optimal migration solution. Then update the globally optimal migration scheme. .
[0038] S15. The updated migration scheme set is used as the current migration scheme set. The first update operation and the second update operation are re-executed until the preset iteration termination condition is met, and the final global optimal migration scheme is obtained.
[0039] Repeat the main loop steps above until the preset iteration termination condition is reached, such as reaching a certain number of iterations or the quality of the globally optimal migration solution no longer significantly improves. Then, output the final globally optimal migration solution and hand it over to the cloud platform management component to perform the actual container migration operation according to the solution.
[0040] Preferably, the preset iteration termination condition is: the current iteration number reaches the preset maximum iteration number threshold Tmax, or the change rate of the total migration component table of the global optimal migration scheme is less than the preset change rate threshold.
[0041] Optionally, Tmax = 5.
[0042] See Figure 2 This is a schematic diagram of the container migration scheduling system in an embodiment of the present invention. The cloud-native management platform includes several servers and several containers, forming a server list (host list) and a container list, respectively. The scheduling center is used to obtain the list information of the cloud-native management platform and transmit the real-time data to the IHLOA optimization engine. The IHLOA optimization engine is used to execute the container migration scheduling method of the present invention, generate the final global optimal migration plan, and send the migration plan to the migration executor. The migration executor generates corresponding migration instructions according to the migration plan and controls the container migration of the cloud-native management platform.
[0043] This invention employs the technical means of randomly generating multiple initial container migration schemes. With the goal of minimizing the total migration cost of these schemes, a differentiated scheme update strategy is implemented for schemes with different costs. This guides different schemes to undergo local fine-tuning or large-scale redistribution exploration. Gaussian noise perturbation is introduced for mutation processing, increasing the diversity of the container migration scheme set and achieving the optimal discrete mapping from containers to physical servers. This effectively avoids getting trapped in local optima and quickly finds a near-global optimal container migration scheme. While ensuring migration feasibility, minimizing the total migration cost of the container migration schemes effectively improves resource utilization, reduces load variance, and shortens scheduling decision time. This invention significantly improves convergence speed and scheduling efficiency, reduces performance loss, migration time, and energy consumption during the migration process, and is suitable for real-time container migration scheduling scenarios on large-scale cloud-native platforms.
[0044] As a preferred embodiment, the present invention is further implemented based on the above embodiments, see [link to previous embodiments]. Figure 3 This is a flowchart illustrating a preferred container migration scheduling method in an embodiment of the present invention. Step S11, namely, randomly generating several initial container migration schemes based on the status information of the containers to be migrated and all servers, includes: Obtain the status information of the containers to be migrated and all servers; Based on the state information, a number of initial container migration schemes are randomly generated using the Logistic chaotic mapping method.
[0045] Preferably, the status information of the containers includes a list of containers and a resource requirement vector for each container in the list, and the status information of the servers includes a list of servers and an available resource vector for each server in the list.
[0046] Obtain the server list S={s1,s2,...,s...} through the cloud-native resource management platform interface. i ,...,s n}, where n is the number of servers; container list C = {c1, c2, ..., c i ,..., c m Let m be the number of containers. Define the resource requirement vector R for each container. c =[r c1 ,r c2 ,...,r ci ...,r ck ](r ci For each server (including CPU, memory, etc.), the available resource vector Sh = [s h1 ,s h2 ,...s hi ...,s hkThe output is defined as a container migration scheme X=[x1,x2,...,x] i ...,x n] x i Represents container c i The server you were assigned to.
[0047] Preferably, the step of randomly generating several initial container migration schemes based on the state information using the Logistic chaotic mapping method includes: Set initial running parameters; wherein, the initial running parameters include the number of traversals, the mapping parameters of the Logistic chaotic mapping formula, and the random seed; Traverse the list of containers and use the Logistic chaotic mapping formula to assign a server to each container in turn. When the number of mappings reaches the number of containers, an initial container migration scheme is formed; After repeating the traversal a certain number of times, several initial container migration schemes are obtained.
[0048] In this embodiment of the invention, a set of initial container migration schemes is randomly generated using Logistic chaotic mapping to avoid traditional random initialization aggregation.
[0049] Optionally, the total number of migration schemes (i.e., the number of traversals) is set to tn, the Logistic chaotic mapping parameter μ=3.999998, and the random seed s'0 is taken as an integer in [1,n].
[0050] Iterate through the container list C, and use a Logistic chaotic mapping to assign servers s'q to each container ci in turn. The formula for the Logistic chaotic mapping is as follows:
[0051] After performing m mappings, an initial container migration scheme X=[s'1,s'2,...,s'm] is formed. After repeating the traversal tn times, tn initial container migration schemes X are generated, forming a migration scheme set STX=[X1,X2,...,Xj,...,Xtn].
[0052] By employing the technical means of this invention, Logistic chaotic mapping is used to sequentially generate initial placement positions for all containers, avoiding the clustering phenomenon caused by traditional random initialization, and providing a reliable foundation for subsequent updates to container migration schemes and selection of the optimal scheme.
[0053] As a preferred embodiment, the present invention is further implemented based on any of the above embodiments, and the method further includes: The total migration cost of the container migration scheme is calculated using the following steps: For each of the container migration schemes, calculate the average utilization of each resource and the global average utilization of each of the servers. Based on the average utilization and the global average utilization, calculate the resource imbalance penalty for each of the servers; The resource imbalance penalty is normalized using a normalized exponential function to calculate the normalized weight of the resource imbalance penalty. Calculate the weighted sum of the resource imbalance penalties for all the servers to obtain the total migration cost of the container migration scheme.
[0054] In this embodiment of the invention, the migration scheme set STX is traversed, and for the current migration scheme... Iterate through the server list S and calculate the resource utilization vector for each server si:
[0055] in, For server A collection of containers running on top of For containers The resource demand vector, For server The available resource vector. After finishing iterating through S, iterate through the server list S again, for each server... Calculate the resource imbalance penalty:
[0056]
[0057] in, For server The average utilization rate of resource d To determine the global average utilization of resource d, the normalized exponent (softmax) function is used to evaluate the utilization of all servers. Convert to normalized weights:
[0058] in, The larger the value, the more unbalanced the server is.
[0059] The total migration cost of the container migration scheme is ultimately defined as the weighted sum of all server imbalance penalties, that is:
[0060] in, This represents the total migration cost of the container migration solution.
[0061] By employing the technical means of this invention, the deviation between the multi-dimensional resource utilization of each server and the global average is calculated, and a comprehensive imbalance penalty is obtained by combining normalized exponent weighting as the total migration cost evaluation index, so that the objective function design takes into account both load balancing and migration feasibility constraints.
[0062] As a preferred embodiment, the present invention is further implemented based on any of the above embodiments, see [link to previous embodiments]. Figure 3 The first update operation is specifically as follows: Based on the total migration cost of each container migration scheme in the current migration scheme set, the container migration schemes are divided into a high-cost group and a low-cost group; A local fine-tuning scheme update strategy is implemented for container migration schemes in the low-cost group, and a large-scale reallocation scheme update strategy is implemented for container migration schemes in the high-cost group. Gaussian noise perturbation is introduced into each of the container migration schemes, and the container positions in the container migration schemes are randomly adjusted to obtain the mutated container migration schemes. The total migration cost of the modified container migration scheme is compared one by one with that of the corresponding initial container migration scheme. The container migration scheme with the lower total migration cost is retained to obtain the updated migration scheme set.
[0063] In this embodiment of the invention, based on the total migration cost of the container migration scheme, the groups are divided into a low-cost group and a high-cost group, and different scheme update strategies are implemented.
[0064] For example, take the median M of the total migration cost of all container migration schemes within STX, and for each container migration scheme... If cost The solutions marked as low-cost are placed in the low-cost group, while the rest are marked as high-cost and placed in the high-cost group.
[0065] For solutions with low migration costs, the approach tends to perform local fine-tuning, conducting a detailed search near the historical best solution; for solutions with high migration costs, the approach tends to perform large-scale redistribution, learning from the currently known best solution or conducting a wider range of exploration.
[0066] Gaussian noise perturbation is then introduced into all initially updated container migration schemes to randomly adjust the container placement positions within the schemes, enhancing search diversity. A greedy selection mechanism is employed, comparing the total migration cost before and after each scheme's mutation, and always retaining the scheme with the lower cost, resulting in an updated set of migration schemes.
[0067] As a preferred embodiment, the scheme update strategy for performing local fine-tuning on the container migration scheme in the low-cost group includes: For all container migration schemes in the low-cost group, a probability vector is randomly generated. and weighting coefficients ; Based on the probability vector and the weight coefficients, the following update strategy is adopted for each container migration scheme, namely... The server assigned to the container in Updated to:
[0068] in, The server assigned to the i-th container in the updated j-th container migration scheme. The server allocated to the i-th container in the original j-th container migration scheme. The server allocated to the i-th container in the globally optimal migration scheme; Let i be the i-th element in the probability vector. Let m be the weighting coefficient, and m be the number of containers.
[0069] In a preferred embodiment, the scheme update strategy of performing large-scale reallocation of container migration schemes in the high-cost group includes: For all container migration schemes in the high-cost group, randomly generate exploration vectors. and scaling factor ; Based on the exploration vector and the scaling factor, the following scheme update strategy is adopted for each container migration scheme, namely... The server assigned to the container in Updated to:
[0070] in, The server assigned to the i-th container in the updated j-th container migration scheme. The server allocated to the i-th container in the original j-th container migration scheme. The server allocated to the i-th container in the globally optimal migration scheme; Let i be the i-th element in the exploration vector. Let m be the scaling factor, and m be the number of containers.
[0071] If the updated <1 or >n, let Randomly select an integer value in the range [1, n]. After completing the traversal, obtain the container migration schemes after implementing the scheme update strategy. The scheme set is denoted as . .
[0072] In a preferred embodiment, the step of introducing Gaussian noise perturbation into each of the container migration schemes and randomly adjusting the container positions in the container migration schemes to obtain a mutated container migration scheme includes: Traversal For all container migration schemes after the scheme update strategy has been executed Generate Gaussian random noise
[0073] Calculate the random noise perturbation based on the Gaussian random noise to update the server assigned to the container in the container migration scheme:
[0074] in, Let i be the server assigned to the i-th container in the j-th container migration scheme after the mutation processing. This refers to the server allocated to the i-th container in the original updated j-th container migration plan. Let n be the Gaussian random noise, and n be the number of servers.
[0075] After completing the traversal, a set of mutation and migration schemes is obtained. .
[0076] Traversal Calculate each mutation migration scheme Cost .like Then update and After the traversal ends, the iterative migration scheme makes... This yields a set of updated migration schemes.
[0077] This invention employs the technical means of an adaptive cost assessment and early stopping mechanism. It utilizes a hierarchical update strategy based on cost ranking, performing local fine-tuning on low-cost solutions and large-scale redistribution of high-cost solutions by learning from historical best solutions. This achieves effective coordination between local fine-tuning and large-scale reconstruction, realizing the optimal discrete mapping from containers to physical servers. Gaussian noise perturbation is applied to each updated solution with a fixed probability, effectively improving the diversity of the candidate solution set and enhancing the ability to escape local optima. Simultaneously, a greedy selection mechanism is employed, comparing the cost of each particle before and after mutation, always retaining the better solution, ensuring that the population's evolutionary direction always moves towards a better solution, and guaranteeing the algorithm's convergence.
[0078] See Figure 4This is a schematic diagram of a container migration scheduling device provided in an embodiment of the present invention. The embodiment of the present invention provides a container migration scheduling device 10, comprising: The initial migration scheme generation module 11 is used to randomly generate several initial container migration schemes based on the status information of the containers to be migrated and all servers, so as to obtain the current migration scheme set. The global optimal solution selection module 12 is used to select the container migration solution with the lowest total migration cost in the current migration solution set as the global optimal migration solution. The container migration scheme update module 13 is used to perform a first update operation on the current migration scheme set to obtain an updated migration scheme set; wherein, the first update operation is: to perform different scheme update strategies on container migration schemes with different total migration costs in the current migration scheme set, and to introduce Gaussian noise perturbation for mutation processing to generate updated container migration schemes and obtain an updated migration scheme set. The global optimal solution update module 14 is used to perform a second update operation on the global optimal migration solution; wherein, the second update operation is: selecting the container migration solution with the lowest total migration cost in the updated migration solution set, and denoting it as the current optimal migration solution; if the total migration cost of the current optimal migration solution is less than the total migration cost of the global optimal migration solution, updating the global optimal migration solution to the current optimal migration solution. The global optimal solution output module 15 is used to take the updated migration solution set as the current migration solution set, re-execute the first update operation and the second update operation until the preset iteration termination condition is met, and obtain the final global optimal migration solution.
[0079] It should be noted that the container migration scheduling device provided in this embodiment of the invention is used to execute all the process steps of the container migration scheduling method in the above embodiment. The working principle and beneficial effect of the two are one-to-one, so they will not be described again.
[0080] This invention also provides a container migration scheduling device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the container migration scheduling method as described in any of the above embodiments.
[0081] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the container migration scheduling method as described in any of the above embodiments.
[0082] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the container migration scheduling method as described in any of the above embodiments.
[0083] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0084] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A container migration scheduling method, characterized in that, include: Based on the status information of the containers to be migrated and all servers, several initial container migration plans are randomly generated to obtain the current migration plan set; Select the container migration scheme with the lowest total migration cost from the current set of migration schemes as the globally optimal migration scheme; Perform a first update operation on the current migration scheme set to obtain an updated migration scheme set; wherein, the first update operation is: perform different scheme update strategies on container migration schemes with different total migration costs in the current migration scheme set, and introduce Gaussian noise perturbation for mutation processing to generate updated container migration schemes, thereby obtaining an updated migration scheme set. Perform a second update operation on the globally optimal migration scheme; wherein, the second update operation is: select the container migration scheme with the lowest total migration cost in the updated migration scheme set, and denot it as the current optimal migration scheme; if the total migration cost of the current optimal migration scheme is less than the total migration cost of the globally optimal migration scheme, update the globally optimal migration scheme as the current optimal migration scheme. The updated migration scheme set is used as the current migration scheme set. The first update operation and the second update operation are re-executed until the preset iteration termination condition is met, and the final global optimal migration scheme is obtained.
2. The container migration scheduling method as described in claim 1, characterized in that, The first update operation is as follows: Based on the total migration cost of each container migration scheme in the current migration scheme set, the container migration schemes are divided into a high-cost group and a low-cost group; A local fine-tuning scheme update strategy is implemented for container migration schemes in the low-cost group, and a large-scale reallocation scheme update strategy is implemented for container migration schemes in the high-cost group. Gaussian noise perturbation is introduced into each of the container migration schemes, and the container positions in the container migration schemes are randomly adjusted to obtain the mutated container migration schemes. The total migration cost of the modified container migration scheme is compared one by one with that of the corresponding initial container migration scheme. The container migration scheme with the lower total migration cost is retained to obtain the updated migration scheme set.
3. The container migration scheduling method as described in claim 2, characterized in that, The scheme update strategy for performing local fine-tuning of container migration schemes in the low-cost group includes: For all container migration schemes in the low-cost group, a probability vector and weight coefficients are randomly generated; Based on the probability vector and the weight coefficients, the following update strategy is adopted for each container migration scheme: in, The server assigned to the i-th container in the updated j-th container migration scheme. The server allocated to the i-th container in the original j-th container migration scheme. The server allocated to the i-th container in the globally optimal migration scheme; Let i be the i-th element in the probability vector. Let m be the weighting coefficient, and m be the number of containers.
4. The container migration scheduling method as described in claim 2, characterized in that, The scheme update strategy for performing large-scale reallocation of container migration schemes in the high-cost group includes: For all container migration schemes in the high-cost group, randomly generate exploration vectors and scaling factors; Based on the exploration vector and the scaling factor, the following update strategy is adopted for each container migration scheme: in, The server assigned to the i-th container in the updated j-th container migration scheme. The server allocated to the i-th container in the original j-th container migration scheme. The server allocated to the i-th container in the globally optimal migration scheme; Let i be the i-th element in the exploration vector. Let m be the scaling factor, and m be the number of containers.
5. The container migration scheduling method as described in claim 2, characterized in that, The process of introducing Gaussian noise perturbation into each container migration scheme and randomly adjusting the container positions in the container migration scheme to obtain a mutated container migration scheme includes: For all container migration schemes after the scheme update strategy has been executed, generate Gaussian random noise; Calculate the random noise perturbation based on the Gaussian random noise to update the server assigned to the container in the container migration scheme: in, Let i be the server assigned to the i-th container in the j-th container migration scheme after the mutation processing. This refers to the server allocated to the i-th container in the original updated j-th container migration plan. Let n be the Gaussian random noise, and n be the number of servers.
6. The container migration scheduling method as described in claim 1, characterized in that, Based on the status information of the containers to be migrated and all servers, several initial container migration schemes are randomly generated, including: Obtain the status information of the containers to be migrated and all servers; Based on the state information, a number of initial container migration schemes are randomly generated using the Logistic chaotic mapping method.
7. The container migration scheduling method as described in claim 6, characterized in that, The status information of the containers includes a list of containers and a resource requirement vector for each container in the list. The status information of the servers includes a list of servers and an available resource vector for each server in the list.
8. The container migration scheduling method as described in claim 7, characterized in that, Based on the state information, a Logistic chaotic mapping method is used to randomly generate several initial container migration schemes, including: Set initial running parameters; wherein, the initial running parameters include the number of traversals, the mapping parameters of the Logistic chaotic mapping formula, and the random seed; Traverse the list of containers and use the Logistic chaotic mapping formula to assign a server to each container in turn. When the number of mappings reaches the number of containers, an initial container migration scheme is formed; After repeating the traversal a certain number of times, several initial container migration schemes are obtained.
9. The container migration scheduling method as described in claim 1, characterized in that, The method further includes: The total migration cost of the container migration scheme is calculated using the following steps: For each of the container migration schemes, calculate the average utilization of each resource and the global average utilization of each of the servers. Based on the average utilization rate and the global average utilization rate, calculate the resource imbalance penalty for each of the servers; The resource imbalance penalty is normalized using a normalized exponential function to calculate the normalized weight of the resource imbalance penalty. Calculate the weighted sum of the resource imbalance penalties for all the servers to obtain the total migration cost of the container migration scheme.
10. The container migration scheduling method as described in claim 1, characterized in that, The preset iteration termination condition is: the current iteration number reaches the preset maximum iteration number threshold, or the change rate of the total migration component table of the global optimal migration scheme is less than the preset change rate threshold.
11. A container migration scheduling device, characterized in that, include: The initial migration plan generation module is used to randomly generate several initial container migration plans based on the status information of the containers to be migrated and all servers, thus obtaining the current migration plan set. The global optimal solution selection module is used to select the container migration solution with the lowest total migration cost from the current migration solution set as the global optimal migration solution. The container migration scheme update module is used to perform a first update operation on the current migration scheme set to obtain an updated migration scheme set; wherein, the first update operation is: to perform different scheme update strategies on container migration schemes with different total migration costs in the current migration scheme set, and to introduce Gaussian noise perturbation for mutation processing to generate updated container migration schemes, thereby obtaining an updated migration scheme set. The global optimal solution update module is used to perform a second update operation on the global optimal migration solution; wherein, the second update operation is: selecting the container migration solution with the lowest total migration cost in the updated migration solution set, and denoting it as the current optimal migration solution; if the total migration cost of the current optimal migration solution is less than the total migration cost of the global optimal migration solution, the global optimal migration solution is updated to the current optimal migration solution. The global optimal solution output module is used to take the updated migration solution set as the current migration solution set, re-execute the first update operation and the second update operation until the preset iteration termination condition is met, and obtain the final global optimal migration solution.
12. A container migration scheduling device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the container migration scheduling method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the container migration scheduling method as described in any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the container migration scheduling method as described in any one of claims 1 to 10.