Self-adaptive container migration method and system

Through the adaptive container migration method, combined with vehicle position prediction and flow fluctuation calculation, a dynamic adaptive migration optimization model is built, and a migration strategy is generated using the RIME algorithm, which solves the problems of low resource utilization and high task delay in traditional container migration strategies, and achieves more efficient dynamic resource adjustment and rapid response.

CN120034907AActive Publication Date: 2025-05-23GUANGDONG UNIV OF TECH

Patent Information

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

AI Technical Summary

Technical Problem

When traditional edge computing container migration strategies face the needs of high vehicle mobility and complex tasks, there are problems such as low resource utilization, poor flexibility and high task delay.

Method used

An adaptive container migration method is proposed. By obtaining the current position and predicted position of the vehicle, calculating the vehicle flow fluctuation value, building a container migration optimization model, and generating a migration strategy using a RIME algorithm based on loop detection, dynamically adjusting the container location to meet the delay requirements.

Benefits of technology

By optimizing the container migration process, the system's resource utilization and flexibility are improved, unnecessary migration frequency is reduced, task delay is reduced, and the overall system performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034907A_ABST
    Figure CN120034907A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Internet of Vehicles and edge computing, and discloses a self-adaptive container migration method and system.The method comprises the steps that the current position of an automobile is obtained, and the position of the automobile at the next time step is predicted; calculating a vehicle flow fluctuation value according to the current position and the predicted position of the vehicle; judging whether the vehicle flow fluctuation value is smaller than a migration threshold value or not; if yes, maintaining the current deployment; if not, constructing a container migration optimization model, and solving the container migration optimization model by using an RIME algorithm based on loop detection to generate a migration strategy; and migrating the container from the current server to the target server according to the migration strategy. According to the method, the adaptivity and the robustness of a migration strategy are enhanced, quicker response and resource dynamic adjustment can be realized in a multi-task processing scene, and the flexibility is improved. And meanwhile, the performance bottleneck caused by the traditional dependence on static configuration is avoided, the unnecessary migration frequency is effectively reduced, and the resource utilization rate of the whole system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Vehicles and edge computing technology, and more specifically, to an adaptive container migration method and system. Background Art

[0002] Mobile edge computing (MEC) provides low-latency and high-efficiency computing capabilities for smart vehicles in the Internet of Vehicles scenario, and is an effective supplement to traditional cloud computing. With the rapid development of autonomous driving technology, vehicles need to perform latency-sensitive and complex dependent tasks in real time while maintaining communication with the surrounding infrastructure. However, traditional edge computing container migration strategies still face significant challenges when faced with the high mobility of vehicles and the diverse needs of complex tasks. For example, how to dynamically adjust the position of containers during vehicle movement to meet latency requirements, and how to efficiently handle complex tasks with dependencies, have become key issues that need to be solved urgently. In addition, the lack of container resource sharing and multi-task support capabilities also limits the overall efficiency of the system.

[0003] Existing studies have proposed a variety of solutions for container migration strategies. For example, Xu et al. proposed a container scheduling strategy based on model predictive control to achieve cluster load balancing, but the default container is bound to a single task and does not support multi-task sharing scenarios, resulting in resource waste. Kim et al. proposed a solution to optimize container migration based on user mobility, but did not consider the resource contention and uneven server load that may be caused by the simultaneous migration of multiple containers, which would affect the timely completion of tasks and system efficiency. In addition, Cheng et al. optimized task scheduling through a task splitting strategy, but ignored task dependencies and server computing power limitations, which may cause tasks to queue or have circular dependencies, further increasing delays and reducing system reliability. Summary of the invention

[0004] In order to overcome the defects of low resource utilization and flexibility and high task delay in the existing container migration technology, the present invention proposes the following technical solutions: In a first aspect, the present invention provides an adaptive container migration method, comprising: Get the current position of the car and predict the position of the car in the next time step; Calculate the vehicle flow fluctuation value based on the current position and predicted position of the car; Determine whether the vehicle flow fluctuation value is less than the migration threshold; if so, maintain the current deployment; if not, build a container migration optimization model, and use the RIME algorithm based on loop detection to solve the container migration optimization model and generate a migration strategy; Migrate the container from the current server to the target server according to the migration strategy.

[0005] As a preferred technical solution, the expression of the container migration optimization model is as follows:

[0006]

[0007] in, and is the weight coefficient, is the task completion rate, which indicates the proportion of tasks completed on time within a specific time window. Indicates the degree of server imbalance; is a binary variable, indicating the container k Whether it has been migrated to the server n , is a binary variable, indicating the task i Whether it is offloaded to the server n , It is an indicator function. When the condition in the brackets is met, the value is 1, otherwise it is 0. For container k The set of tasks you are responsible for, tasks For task collection part of For Server n The number of queues, Indicates the task i On the server n The queue p The execution location in is the total number of servers; Represents the total number of tasks, Representation Server n In the queue p Maximum capacity on K Indicates the total number of containers. Representation container k Required storage resources, Representation Server n storage capacity.

[0008] As a preferred technical solution, the vehicle flow fluctuation value is calculated according to the following formula:

[0009] in, Indicates the number of active servers in the current or next time slot. Indicates n Change in the number of vehicles on active servers, Average of all active servers' vehicle population changes.

[0010] As a preferred technical solution, the method further includes determining the migration threshold by Bayesian optimization, including: Construct an evaluation function, whose expression is as follows:

[0011] in, and is a non-negative weight coefficient, is the migration frequency, is the task completion rate; According to the evaluation function, the Gaussian process is used to fit the posterior distribution of the observed data of the current migration threshold parameter, and based on the expected improvement as the acquisition function, the optimal adjustment direction of the migration threshold parameter in each iteration is calculated according to the following formula; By iteratively optimizing the evaluation function and adjusting the migration threshold parameters, the optimal migration threshold that minimizes the evaluation function value is finally found.

[0012] As a preferred technical solution, the RIME algorithm based on loop detection is used to solve the container migration optimization model and generate a migration strategy, including: Initialize the population set R , migrate the variables in the container optimization model As a population R i ; Perform loop detection on each population individual. If no loop is detected, calculate each population individual R i The initial fitness value F ( R i ), if a loop is detected, the current population individual is assigned a positive infinity as a penalty term; Generate random numbers b 2 ,when b 2 < hour, is the current iteration number, A is the maximum iteration number, and the soft frost strategy is used to update the individual positions of the population; Recalculate the fitness values ​​of the updated population individuals, and update the individuals with the best fitness values ​​as the new global optimal solution; Repeat the above steps until the maximum number of iterations is reached or the convergence condition is met, output the current global optimal solution, and generate a migration strategy.

[0013] As a preferred technical solution, loop detection is performed on each population individual, including: Traverse the tasks in each population individual. If the current task is already in the set of nodes used to store the current recursive path R p , it is determined that there is a loop; if the current task is already in the set of nodes used to store the visited nodes V s , then it is determined that the task has been detected; if the current task is not in either set R p and set V s , then the task is added to V s and R p respectively; Traverse the dependent tasks of the current task. If there is no loop in the dependent tasks of the current task, remove the current task from the set R p .

[0014] As a preferred technical solution, the soft frost strategy is used to update the position of the population individual, and its expression is as follows:

[0015] Among them, represents the updated position of the a th iteration on the i th dimension of the j th population individual; represents the position of the current global optimal solution on the j th dimension; is a random number within the interval ; is the direction factor, is the angle parameter that dynamically adjusts with the number of iterations; is the environmental factor, is a preset constant value; is a random number within the interval ; is the upper limit of the search space of the i th population individual on the jth dimension, represents the i th population individual on the lower limit of the search space on the jth dimension.

[0016] As a preferred technical solution, after using the soft frost strategy to update the position of the population individual, the method further includes: Normalize the current fitness value of the current population individual to obtain the normalized fitness value ; Generate a random number b 3 ,when b 3 < When , the hard frost strategy is adopted to update the individual positions of the population to the global optimal value, and its expression is as follows: .

[0017] As a preferred technical solution, the method further includes: The average system performance of the current migration strategy is calculated according to the following formula:

[0018] in, express The average system performance over the time period, Indicated in The objective function of the container migration optimization model at each moment is: Indicates the time period The number of migrations within .

[0019] In a second aspect, the present invention further provides an adaptive container migration system, which is applied to the adaptive container migration method as described in any solution of the first aspect, comprising: The prediction module is used to construct and obtain the current position of the car and predict the position of the car in the next time step; A calculation module, used for calculating the vehicle flow fluctuation value according to the current position and predicted position of the vehicle; The judgment module is used to judge whether the vehicle flow fluctuation value is less than the migration threshold; if so, the current deployment is maintained; if not, a container migration optimization model is constructed, and the RIME algorithm based on loop detection is used to solve the container migration optimization model and generate a migration strategy; The migration module is used to migrate the container from the current server to the target server according to the migration strategy.

[0020] The beneficial effects of the present invention include at least: The present invention optimizes the container migration process, combines the obtained vehicle position prediction and traffic fluctuation calculation, and constructs a dynamic adaptive migration optimization model, which can more accurately evaluate the server load and task allocation status, and decide whether the migration operation needs to be triggered. By introducing the RIME algorithm based on loop detection, the adaptability and robustness of the migration strategy are enhanced, and faster response and dynamic adjustment of resources can be achieved in multi-tasking scenarios, thereby improving flexibility. At the same time, it avoids the performance bottleneck caused by traditional reliance on static configuration, effectively reduces the frequency of unnecessary migrations, and improves the resource utilization of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of a flow chart of an adaptive container migration method provided by an embodiment of the present invention.

[0022] Figure 2 This is an example diagram of the task dependency graph model based on the extended AOE provided in an embodiment of the present invention.

[0023] Figure 3 This is an example diagram of a deadlock caused by a loop in task dependency provided by an embodiment of the present invention.

[0024] Figure 4 (a) is a comparison chart of the task completion rate of the RIME algorithm based on loop detection provided by an embodiment of the present invention and other solutions.

[0025] Figure 4 (b) is a comparison chart of the load balancing effects of the RIME algorithm based on loop detection provided by an embodiment of the present invention and other solutions.

[0026] Figure 4 (c) is a comparison chart of the objective function values ​​of the RIME algorithm based on loop detection provided by an embodiment of the present invention and other schemes.

[0027] Figure 5 This is an example diagram comparing the effects of the adaptive migration method provided in an embodiment of the present invention and other methods.

[0028] Figure 6 An architecture diagram of an adaptive container migration system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred technical solutions. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred technical solutions are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0030] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0031] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0032] Example 1 This embodiment proposes an adaptive container migration method, such as Figure 1 As shown, Figure 1 A schematic diagram of a flow chart of an adaptive container migration method provided by an embodiment of the present invention, the method comprising the following steps: S1: Get the current position of the car and predict the position of the car in the next time step; S2: Calculate the vehicle flow fluctuation value based on the current position and predicted position of the car; S3: Determine whether the vehicle flow fluctuation value is less than the migration threshold; if so, maintain the current deployment; if not, build a container migration optimization model, and use the RIME algorithm based on loop detection to solve the container migration optimization model and generate a migration strategy; S4: Migrate the container from the current server to the target server according to the migration strategy; As an example, the current position of the vehicle is obtained in real time, and its driving path and position in the next time step are predicted, and the vehicle flow fluctuation value in the area is calculated. The vehicle flow fluctuation value is compared with the preset migration threshold. When the flow fluctuation value is found to be higher than the threshold, the task completion status and server load balancing are comprehensively considered to build a container migration optimization model for the vehicle, and the model is solved based on the RIME algorithm of loop detection to generate the optimal migration strategy. According to the migration strategy, the vehicle's task processing container is migrated from the current server (such as server X) to the target server (such as server Y) with lower load and able to meet the task computing latency requirements.

[0033] It is understandable that by optimizing the container migration process, combining the obtained vehicle location prediction and traffic fluctuation calculation, and building a dynamic adaptive migration optimization model, it is possible to more accurately evaluate the server load and task allocation status, and decide whether the migration operation needs to be triggered. By introducing the RIME algorithm based on loop detection, the adaptability and robustness of the migration strategy are enhanced, which can achieve faster response and dynamic adjustment of resources in multi-tasking scenarios, and improve flexibility. At the same time, it avoids the performance bottleneck caused by traditional reliance on static configuration, effectively reduces the frequency of unnecessary migration, and improves the resource utilization of the overall system.

[0034] Example 2 This embodiment makes improvements based on the adaptive container migration method proposed in Embodiment 1.

[0035] As an exemplary description, this embodiment describes in detail the process of building a container migration optimization model: In the scenario of Internet of Vehicles, consider the system has edge servers, whose set is denoted as , each server has a certain amount of computing resources. At the same time, there are The vehicle set is represented as The vehicle request is defined as a workflow, each workflow contains several dependent tasks, each task can be processed by a corresponding container. Definition The collection of containers is , where container The set of tasks that can be processed is , the task set in the vehicle workflow is Each container consumes CPU, memory, and storage resources during execution. express.

[0036] In order to describe the relationship between container migration and task offloading, a binary variable is introduced and .in, Representation container Migrate to server , Indicates the task Whether to uninstall to the server Execution, specifically defined as follows:

[0037]

[0038] To ensure that tasks can only be assigned to the server where the container is located, , the constraints must be met .

[0039] Assuming that each task can only be processed by a specific container, for To ensure the uniqueness of container deployment, add constraints ,This constraint ensures that a set of tasks processed by the same container will be offloaded to the same server.

[0040] Additionally, the storage consumption of containers migrated to a server must not exceed the storage capacity limit of that server, namely:

[0041] in, Representation Server storage capacity limitations.

[0042] Using a multi-queue execution model, tasks can be executed on a specific queue of the server. represents the execution order in the queue on each server, where .server It is possible to have multiple parallel execution queues ,gather The elements in the task represent On the server The queue The position or execution order in a queue. Tasks assigned to the same queue are executed sequentially, that is, a task must wait for the previous task in the queue to complete before it can be executed.

[0043] To ensure reasonable allocation of tasks and efficient management of server resources, the following basic constraints are introduced:

[0044] Each task must be assigned to one and only one queue on the server to ensure that it will not be assigned to multiple queues at the same time. The task allocation constraint can be expressed as. Among them, is an indicator function used Is it greater than 0? On the server The queue There is a position in ), indicating that the function returns 1; otherwise, it returns 0. This constraint ensures that each task can occupy only one non-zero queue position.

[0045] server Each queue on Has limited capacity , which limits the number of tasks that can be processed in parallel in the queue. The queue capacity constraint is This constraint ensures that The number of tasks does not exceed the maximum capacity .

[0046] To ensure that tasks are executed in the correct order in the same queue, we introduce constraints , to ensure that the position index in the queue is unique and ordered. This formula ensures that in the same queue, the queue position index of different tasks and Different, thus avoiding conflicts in execution order.

[0047] A task graph model based on extended AOE is constructed to represent the inherent dependencies between tasks due to the execution logic of vehicle requests and the delayed dependencies caused by multi-queue execution. Define the task dependency matrix To describe the logical dependency between tasks, if a task must wait for the task to be completed before it can be started, then ;otherwise, .

[0048] In the extended AOE graph, there are two special vertices " "and" ", respectively, indicate the start and completion of the entire task set. The directed edges between tasks indicate both the logical dependency and the execution order in the server queue. Figure 2 As shown, Figure 2 An example diagram of a task dependency graph model based on an extended AOE provided in an embodiment of the present invention is shown in Figure 2 Medium Server In five different cohorts ( ; ; ; ; ) processes tasks from top to bottom, with a workflow of two vehicles, tasks Must wait for a predecessor task in the same workflow Completed while waiting for tasks from another workflow , because in the server queue, the task In the task Before, it resulted in a lagged dependency.

[0049] In large-scale task scheduling, due to the complex dependencies between tasks and the order of server execution queues, circular waiting problems are prone to occur, leading to deadlock. Figure 3 As shown, Figure 3 An example diagram of a deadlock caused by a loop in task dependency provided by an embodiment of the present invention, wherein , , , A loop is formed. Server Process tasks from top to bottom in five different queues ; ; ; ; .Task Depends on the previous task completion, and Waiting for the server to complete the task In turn, the task depending on completion, and Must wait Done. In this case, It must wait for its own completion, forming a circular dependency, which seriously affects the efficiency of task scheduling and reduces the overall system performance. To solve this problem, a loop detection algorithm will be proposed in the solution to handle this situation.

[0050] For the calculation delay, let Indicates the CPU clock frequency of the edge server. Indicates the number of CPU cycles required to process each bit of data. The computational delay of a task can be expressed as:

[0051] in, Indicates the task With the task The dependencies between Representation container Processing tasks The amount of data generated. Sum item Indicates all predecessor tasks to the task Total data input.

[0052] For transmission delay, the complete task processing flow involves the vehicle sending a service request to the edge server located at the nearest base station, which receives and processes the request. Since the service consists of multiple components, the edge server may not deploy all related containers at the same time, so communication between containers on different servers is required, and finally the server where the last container is located returns the result to the vehicle. Since the feedback information is usually small, the time required for the edge server to send the calculation result back to the vehicle is ignored. At this time, the communication delay is mainly composed of the communication delay between the vehicle and the server and the communication delay between containers.

[0053] The vehicle transmits the input data to the edge server in the base station through the wireless uplink channel. Indicates vehicle At the current location and with the edge server The channel gain between the two. Given the transmission power of a vehicle In this case, the uplink data transmission rate from vehicle to base station can be defined as:

[0054] in is the system bandwidth, is the noise power, For Server The inter-cell interference power of the base station. The data transmission between the vehicle and the base station adopts the IEEE802.11p protocol. To simplify the analysis, we assume that by assigning an orthogonal frequency channel to each vehicle, the co-channel interference between vehicles can be ignored, that is, .

[0055] Channel Gain It is expressed as:

[0056] in Indicates vehicle With edge servers The distance between is the path loss exponent, represents the path loss, is the Rayleigh fading channel coefficient. In order to accurately capture the signal propagation characteristics, we use the free space path loss model to represent large-scale fading and the Rayleigh fading model to represent small-scale fading.

[0057] vehicle The size is The data is sent to the edge server The transmission delay is:

[0058] in, Indicates the uplink data transmission rate from vehicle to base station.

[0059] If the base station closest to the vehicle does not contain the first required container, the receiving base station forwards the information to the corresponding base station. Assuming the channel bandwidth between base stations is Fixed, set represents the number of hops between base stations, then the communication delay between containers can be expressed as:

[0060] vehicle To the person in charge of handling the task The total communication delay of the container transmitting data can be expressed as:

[0061] in, Indicates the closest vehicle base station.

[0062] In summary, for the task and , if the task Depends on the task , then the delay It is expressed as:

[0063] in Indicates communication delay. and If they are located on different servers, there will be transmission delays ; If they are on the same server, the transmission delay is zero because no cross-server communication is required and the delay depends only on the execution order. Indicates the task processing delay.

[0064] For Vehicles The total delay of task completion can be calculated by summing the delays of all key tasks using the following formula:

[0065] in, Represents all tasks on the critical path.

[0066] In order to reasonably allocate the resource requirements of containers, a resource usage model based on computing resources (CPU and memory) is introduced. The resource consumption of a is expressed as the weighted sum of its CPU and memory usage:

[0067] in, and is a non-negative weight coefficient used to balance the importance of different resource types. For CPU-intensive tasks, can be given higher weights; for memory-intensive tasks, It can be given priority.

[0068] Single edge server The total load is the sum of the loads of all deployed containers on the server, and its expression is:

[0069] In order to reflect the degree to which the server load deviates from the average value, the load variance is introduced and defined as:

[0070] in, Indicates the total number of edge servers and the average load Expressed as

[0071] This method can evaluate the load balancing degree between servers. indicates a more even load distribution, while a larger This indicates that some servers are overloaded while other server resources are idle.

[0072] In an edge computing environment, the goal of the system is to optimally allocate network and computing resources to efficiently schedule user-generated tasks. To ensure that tasks are completed on time, the tasks must meet Here, container migration in the Internet of Vehicles is defined as a constrained optimization problem, where the goal is to complete as many tasks as possible on time while ensuring load balancing among servers and satisfying server storage availability constraints and consistency requirements between tasks and containers.

[0073] Task completion rate It is defined as the ratio of the number of tasks completed on time within a given time window to the total number of assigned tasks, that is:

[0074] If the condition is satisfied (i.e. the task is completed within its deadline), then Takes 1, otherwise 0.

[0075] To simplify the model and reduce solution complexity, try changing the variables and Represented as a queue decision variable First, reload the task offloading variable Rewritten as:

[0076] If the task Assigned to the server Any queue on .

[0077] Next, re-migrate the container variables Rewrite as

[0078] If the container Any tasks in the , then the container Migrated to the server .

[0079] Through the above transformation, the traditional task-container mapping and container-server mapping are transformed into a unified task-server mapping, reducing the number of decisions that need to be made.

[0080] In summary, the container migration optimization model can be written as:

[0081]

[0082] in, and is the weight coefficient, is the task completion rate, which indicates the proportion of tasks completed on time within a specific time window. Indicates the degree of server imbalance; is a binary variable, representing the container k Whether it has been migrated to the server n , is a binary variable, indicating the task i Whether it is offloaded to the server n , It is an indicator function. When the condition in the brackets is met, the value is 1, otherwise it is 0. For container k The set of tasks you are responsible for, tasks For task collection part of For Server n The number of queues, Indicates the task i On the server n The queue p The execution location in is the total number of servers; Indicates the total number of tasks, Representation Server n In the queue p Maximum capacity on K Indicates the total number of containers. Representation container k Required storage resources, Representation Server n storage capacity.

[0083] This model represents the maximum task completion rate and minimize load imbalance , thereby improving the overall effect of container migration and task offloading in edge computing environments. and Used to weight task completion rate and system load fluctuation and balance their impact during optimization.

[0084] In this example, while the proposed optimization model aims to maximize the task completion rate and minimize the load imbalance, it is equally important to balance the benefits of container migration and its associated costs over a longer time frame. Frequent migrations may bring additional overhead without generating corresponding benefits. Therefore, container migration does not need to occur in every time slot. In the long run, the balance between the migration frequency and its benefits is crucial to evaluate the overall effectiveness of the container migration strategy. Mathematically, it is necessary to consider the system in the time period The average system performance of the current migration strategy is calculated according to the following formula:

[0085] in, express The average system performance over the time period, Indicated in The objective function of the container migration optimization model at each moment is: Indicates the time period The number of migrations within .

[0086] The performance of the migration solution shows the system performance over a longer period of time, whether it can bring performance improvements when container migration is needed, and reduce the costs caused by ineffective migration.

[0087] In this embodiment, the vehicle flow fluctuation value is calculated according to the following formula:

[0088] in, Indicates the number of active servers in the current or next time slot. Indicates n Change in the number of vehicles on active servers, Average of all active servers' vehicle population changes.

[0089] It should be noted that active servers refer to the set of servers that actually provide services to vehicles and participate in task processing within a specific time period. Their status will be dynamically adjusted due to changes in vehicle movement and task distribution, and is used to reflect the distribution of vehicles at different locations at current or future times.

[0090] During the specific implementation process, through real-time monitoring of vehicle locations and trajectory prediction, the changes in the number of vehicles within the coverage of each active server are counted, so as to calculate the location-based vehicle flow fluctuation value, and use the vehicle flow fluctuation value and migration threshold to determine whether task container migration is required, thereby optimizing server load balancing while maintaining service continuity.

[0091] In this embodiment, the migration threshold is determined by Bayesian optimization, including: Construct an evaluation function, whose expression is as follows:

[0092] in, and is a non-negative weight coefficient, is the migration frequency, is the task completion rate; According to the evaluation function, the Gaussian process is used to fit the posterior distribution of the observed data of the current migration threshold parameter, and based on the expected improvement as the acquisition function, the optimal adjustment direction of the migration threshold parameter in each iteration is calculated according to the following formula; By iteratively optimizing the evaluation function and adjusting the migration threshold parameters, the optimal migration threshold that minimizes the evaluation function value is finally found.

[0093] In this embodiment, the RIME algorithm based on loop detection is used to solve the container migration optimization model and generate a migration strategy. However, the RIME algorithm is designed for minimization tasks. In order to solve this problem, the original maximization problem is converted into a minimization problem by taking the opposite of the objective function as the fitness value. During the optimization process, the algorithm approaches the maximum value of the original objective function by minimizing the converted fitness value. In addition, a loop detection mechanism is introduced into the algorithm to ensure that the task dependencies are solvable, thereby avoiding potential deadlock problems. This mechanism improves the efficiency of the heuristic algorithm by excluding infeasible solutions and directing the search to feasible candidate solutions. Specifically: Initialize the population set R , migrate the variables in the container optimization model As a population R i ; Perform loop detection on each population individual. If no loop is detected, calculate each population individual R i The initial fitness value F ( R i ), if a loop is detected, the current population individual is assigned a positive infinity as a penalty term; Generate random numbers b 2 ,when b 2 < hour, is the current iteration number, A is the maximum iteration number, and the soft frost strategy is used to update the individual positions of the population; Recalculate the fitness values ​​of the updated population individuals, and update the individuals with the best fitness values ​​as the new global optimal solution; Repeat the above steps until the maximum number of iterations is reached or the convergence condition is met, output the current global optimal solution, and generate a migration strategy.

[0094] In this embodiment, in order to solve the circular dependency problem, a loop detection mechanism is proposed, which can effectively identify the circular dependency in the task graph and promptly eliminate infeasible scheduling schemes. For each population individual, loop detection is performed: Traverse the tasks in each population individual. If the current task is already in the node set used to store the current recursive path R p In the case where a loop exists, if the current task is already in the set of nodes that have been visited V s If the current task is not in the set, then the task is considered to have been detected; R p and collection V s , add the tasks to V s and R p middle; Traverse the dependent tasks of the current task. If there is no loop in the dependent tasks of the current task, remove the current task from the collection. R p Removed.

[0095] In this embodiment, the soft frost strategy is used to update the individual positions of the population, and its expression is as follows:

[0096] in, Indicated in a In the iteration i The dimension is j Updated position on; Indicates that the current global optimal solution is in dimension j Position on; For the interval Random numbers within is the direction factor, It is the angle parameter that is dynamically adjusted with the number of iterations; For environmental factors, is a preset constant value; For the interval Random numbers within For the i The upper limit of the search space of individuals in a population in dimension j, Indicates i The lower bound of the search space of individuals in a population in dimension j.

[0097] In this embodiment, after the soft frost strategy is adopted to update the position of the individuals in the population, the following steps are also included: Normalize the current fitness value of the current population individual to obtain the normalized fitness value ; Generate random numbers b 3 ,when b 3 < When , the hard frost strategy is adopted to update the individual positions of the population to the global optimal value, and its expression is as follows: .

[0098] The RIME algorithm based on loop detection is used to solve the optimization model, which greatly enhances the solution quality and enables each container migration to reach a higher level under different vehicle scales. Figure 4 As shown, Figure 4 (a) is a comparison chart of the task completion rate of the RIME algorithm based on loop detection provided by an embodiment of the present invention and other solutions, Figure 4 (b) is a comparison diagram of the load balancing effect of the RIME algorithm based on loop detection provided by an embodiment of the present invention and other solutions, Figure 4 (c) is a comparison chart of the objective function values ​​of the RIME algorithm based on loop detection provided by an embodiment of the present invention and other solutions. Compared with the baseline method, the RIME algorithm can improve the system performance by up to 47%. Its advantages are obvious at a glance.

[0099] like Figure 5 As shown, Figure 5 This is an example diagram comparing the effects of the adaptive migration method provided by the embodiment of the present invention with other methods. The bar chart shows the performance indicators of continuous migration, geographic-aware migration, fixed-interval migration (time intervals of 5 and 10), and adaptive migration solutions. The present invention not only excels in maintaining average system performance, but also ensures that each migration can bring a significant improvement in system performance, fully demonstrating its flexibility and efficiency. The adaptive container migration strategy based on traffic flow changes can perfectly balance the number of migrations and system benefits, and can accurately identify the appropriate migration time regardless of how traffic flow changes. Containers are no longer limited to providing an operating environment for a single task. This shift significantly improves the resource utilization of the system.

[0100] At the same time, the traditional strategy of container migration for a single vehicle trajectory is no longer applicable to the new scenario where containers support multiple tasks. To this end, an adaptive container migration strategy based on vehicle flow changes and based on the overall perspective of the Internet of Vehicles system is proposed. Practice has proved that the effect of this strategy is significantly improved, providing a better solution for container migration in the Internet of Vehicles environment.

[0101] Example 3 like Figure 6 As shown, this embodiment proposes an adaptive container migration system, which is applied to the adaptive container migration method as described in the above embodiment, and includes: a prediction module 100, a calculation module 200, a judgment module 300 and a migration module 400.

[0102] Among them, the prediction module 100 is used to construct and obtain the current position of the car and predict the position of the car in the next time step; the calculation module 200 is used to calculate the vehicle flow fluctuation value according to the current position and predicted position of the car; the judgment module 300 is used to judge whether the vehicle flow fluctuation value is less than the migration threshold; if so, maintain the current deployment; if not, build a container migration optimization model, and use the RIME algorithm based on loop detection to solve the container migration optimization model and generate a migration strategy; the migration module 400 is used to migrate the container from the current server to the target server according to the migration strategy.

[0103] It should be noted that the above explanation of the embodiment of the adaptive container migration method is also applicable to the adaptive container migration system of this embodiment, and will not be repeated here.

[0104] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0105] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0106] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0107] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0108] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0109] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. An adaptive container migration method, characterized in that: include: Get the current position of the car and predict the position of the car in the next time step; Calculate the vehicle flow fluctuation value based on the current position and predicted position of the car; Determine whether the vehicle flow fluctuation value is less than the migration threshold; if so, maintain the current deployment; If not, a container migration optimization model is constructed, and the RIME algorithm based on loop detection is used to solve the container migration optimization model and generate a migration strategy; Migrate the container from the current server to the target server according to the migration strategy.

2. The adaptive container migration method according to claim 1, characterized in that: The expression of the container migration optimization model is as follows: in, and is the weight coefficient, is the task completion rate, which indicates the proportion of tasks completed on time within a specific time window. Indicates the degree of server imbalance; is a binary variable, representing the container k Whether it has been migrated to the server n , is a binary variable, indicating the task i Whether it is offloaded to the server n , It is an indicator function. When the condition in the brackets is met, the value is 1, otherwise it is 0. For container k The set of tasks you are responsible for, tasks For task collection part of For Server n The number of queues, Indicates the task i On the server n The queue p The execution location in is the total number of servers; Indicates the total number of tasks, Representation Server n In the queue p Maximum capacity on K Indicates the total number of containers. Represents a container k Required storage resources, Representation Server n storage capacity.

3. The adaptive container migration method according to claim 1, characterized in that: According to the following formula, calculate the vehicle flow fluctuation value: in, Indicates the number of active servers in the current or next time slot. Indicates n Change in the number of vehicles on active servers, Average of all active servers' vehicle population changes.

4. The adaptive container migration method according to claim 1, characterized in that: The method also includes determining a migration threshold by Bayesian optimization, including: Construct an evaluation function, whose expression is as follows: in, and is a non-negative weight coefficient, is the migration frequency, is the task completion rate; According to the evaluation function, the Gaussian process is used to fit the posterior distribution of the observed data of the current migration threshold parameter, and based on the expected improvement as the acquisition function, the optimal adjustment direction of the migration threshold parameter in each iteration is calculated according to the following formula; By iteratively optimizing the evaluation function and adjusting the migration threshold parameters, the optimal migration threshold that minimizes the evaluation function value is finally found.

5. The adaptive container migration method according to claim 1, characterized in that: The RIME algorithm based on loop detection is used to solve the container migration optimization model and generate a migration strategy, including: Initialize the population set R , migrate the variables in the container optimization model As a population R i ; Perform loop detection on each population individual. If no loop is detected, calculate each population individual R i The initial fitness value F ( R i ), if a loop is detected, the current population individual is assigned a positive infinity as a penalty term; Generate random numbers b 2 ,when b 2< hour, is the current iteration number, A is the maximum iteration number, and the soft frost strategy is used to update the individual positions of the population; Recalculate the fitness values ​​of the updated population individuals, and update the individuals with the best fitness values ​​as the new global optimal solution; Repeat the above steps until the maximum number of iterations is reached or the convergence condition is met, output the current global optimal solution, and generate a migration strategy.

6. The adaptive container migration method according to claim 5, characterized in that: Perform loop detection on each population individual, including: Traverse the tasks in each population individual. If the current task is already in the node set used to store the current recursive path R p In the case where a loop exists, if the current task is already in the set of nodes that have been visited V s If the current task is not in the set, then the task is considered to have been detected; R p and collection V s , add the tasks to V s and R p middle; Traverse the dependent tasks of the current task. If there is no loop in the dependent tasks of the current task, remove the current task from the collection. R p Removed.

7. The adaptive container migration method according to claim 5, characterized in that: The soft frost strategy is used to update the individual positions of the population. The expression is as follows: in, Indicated in a In the iteration i The dimension is j Updated position on; Indicates that the current global optimal solution is in dimension j Position on; For the interval Random numbers within is the direction factor, It is the angle parameter that is dynamically adjusted with the number of iterations; For environmental factors, is a preset constant value; For the interval Random numbers within For the i The upper limit of the search space of individuals in a population in dimension j, Indicates i The lower bound of the search space of individuals in a population in dimension j.

8. The adaptive container migration method according to claim 5, characterized in that: After the soft frost strategy is adopted to update the positions of the individuals in the population, the method further comprises: Normalize the current fitness value of the current population individual to obtain the normalized fitness value ; Generate random numbers b 3 ,when b 3< When , the hard frost strategy is adopted to update the individual positions of the population to the global optimal value, and its expression is as follows: 。 9. The adaptive container migration method according to claim 1, further comprising: The average system performance of the current migration strategy is calculated according to the following formula: in, express The average system performance over the time period, Indicated in The objective function of the container migration optimization model at each moment is: Indicates the time period The number of migrations within .

10. An adaptive container migration system, characterized in that: include: The prediction module is used to construct and obtain the current position of the car and predict the position of the car in the next time step; A calculation module, used for calculating the vehicle flow fluctuation value according to the current position and predicted position of the vehicle; A judgment module is used to judge whether the vehicle flow fluctuation value is less than the migration threshold; if so, the current deployment is maintained; If not, a container migration optimization model is constructed, and the RIME algorithm based on loop detection is used to solve the container migration optimization model and generate a migration strategy; The migration module is used to migrate the container from the current server to the target server according to the migration strategy.

Citation Information

Patent Citations

  • Two-dimensional time scale container scheduling method and system

    CN114035889A

  • Wind speed prediction system based on state recognition RIME-DLEM multivariable time sequence prediction

    CN117932232A

  • Planning vehicle computational unit migration based on mobility prediction

    US20200249039A1

Cited By

  • Edge computing resource dynamic allocation and energy consumption optimization method in Internet of Vehicles environment

    CN120692579A