Task continuity-oriented edge service migration method
Patent Information
- Application Number
- CN202411394575.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-08
Smart Images

Figure CN119356811A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource allocation, and in particular to an edge service migration method oriented to task continuity. Background Art
[0002] Edge service migration is the migration of services from one edge server to another server that can better meet user needs in an edge computing environment. The main problem it solves is the discontinuous service response caused by user mobility. Specifically, the conflict between the limited coverage of the edge server and the mobility of the user terminal leads to a sharp decline in service quality, and even interruptions in running edge services. Service migration can be divided into stateless migration and stateful migration. The former only redirects user requests to a new server and will not be affected by previous requests and states; the latter needs to ensure that after the migration is completed, the service is fully restored to the state before the migration and continues to provide services to users. Therefore, it is called real-time migration. Stateful service migration is the prerequisite for ensuring service continuity.
[0003] At present, the service migration method to solve the service discontinuity problem caused by user mobility and limited edge server coverage needs to complete two tasks: one is migration decision making, and the other is migration implementation. The purpose of migration decision is to determine when and where to migrate the running services that need to be migrated. Taking the latency and energy consumption in the migration process as the optimization target, using optimization algorithms or reinforcement learning algorithms to select the optimal target server is the main direction of current research. Migration implementation requires deciding how to migrate the service and achieving service synchronization between the original server and the target server. The key is to ensure the consistency of the service running status before and after migration. In recent years, research usually uses containers to copy and transmit the running status of the service to the target server for recovery and continuation. The stateful service migration method through containers can be divided into two categories, one is state replication and the other is state reproduction.
[0004] State replication is a method of completely copying the state of the service in the source environment to the target environment. When migrating, first generate a snapshot of the current service running state on the original server, including data in memory, variable values, file system status, etc., transfer the generated snapshot to the target server, and restore it on the target server. State reproduction is a method of recreating the service in the target environment, rather than directly copying the state of the source environment. The method to achieve service synchronization is to replay the service running log on the target server, so it is also called LR log replay migration. This method usually includes the following steps: first collect the service log information on the original server, then transfer the log to the target server, the target server parses the log and executes the commands in sequence to restore the service to its original state.
[0005] In existing research, most of them study migration decision and migration implementation separately, and there is an obvious sequential relationship between the two. For example, some researchers proposed a service migration strategy based on Markov decision process, and then proposed a pre-dump service migration method by using the layered characteristics of containers. Some researchers also proposed to predict the user's future target trajectory based on the historical trajectory of the user's movement, and then determine the list of alternative base stations based on the target trajectory and obtain the optimal migration base station and the optimal service migration path, and dynamically update the service remedial migration according to the comprehensive migration time.
[0006] In summary, the current research on service migration methods still has the following problems: the existing service synchronization methods all use the running state of the current service on the original server as the target state of service synchronization to carry out synchronization. If the service is still running during the synchronization process, there will be a service state synchronization difference. In order to ensure the consistency of the service, the service has to be suspended to complete the final synchronization, so there will be a problem of long interruption time. Insufficient consideration is given to user mobility. During the entire migration process, users are constantly moving, and the user's location has a great impact on the selection of servers and service quality. The state replication method requires a large amount of data to be transmitted, which will cause a large transmission energy consumption, which is also one of the reasons for the long service interruption time. Summary of the invention
[0007] In view of this, the purpose of the present invention is to propose an edge service migration method oriented to task continuity, which optimizes the entire migration workflow by combining trajectory prediction and state reproduction technology; the migration time and migration location are determined in advance by trajectory prediction, and the work that will cause too long service interruption time is arranged to be completed before the service is officially migrated, which fully considers user mobility while also reducing the service interruption time; finally, a stateful service migration method with state reproduction is adopted to reduce the amount of data transmission between servers and reduce data transmission energy consumption.
[0008] The technical means adopted by the present invention are as follows:
[0009] A task continuity-oriented edge service migration method includes the following steps:
[0010] S1. In the migration scenario, the GAN model is used to predict the user's movement trajectory to obtain the predicted trajectory; the user's movement trajectory is predicted using a deep learning model.
[0011] S2, determine whether the last point of the predicted trajectory exceeds the coverage of the server, if not, return to S1, if yes, execute S3;
[0012] S3, determining the migration time and migration location according to the predicted trajectory;
[0013] S4. Based on the migration location and server information, the Q-Learning algorithm is used to solve the optimal migration strategy; the service operation status at the migration time is calculated according to the current operation status of the service and the server information, and the service operation status is constructed into a service operation log, which includes the operation time and the service operation status, and the service operation log is written into the service log file;
[0014] S5. The original server transmits the service log file and the service migration time to the target server, and issues a migration instruction to the target server, requiring the target server to complete the service recovery work and determine to perform the communication link switching work at the migration time;
[0015] S6. After receiving the migration instruction and the service log file, the target server creates a new container and allocates memory and processor resources to the container. Then, the target server parses the service log file and extracts the commands therein, collects relevant resources, and executes the commands in sequence in the container. When all commands are executed, it means that the service is ready to the predetermined state on the target server.
[0016] S7. When the time reaches the migration moment, the user has entered the coverage of the target server and the communication link is switched. Then, the request is redirected to the new target server by updating the network routing configuration. The target server continues to provide services to the user and deletes the application on the original server after ensuring that the service can respond normally.
[0017] Furthermore, in S1, the migration scenario consists of a mobile user, an edge server, and running services.
[0018] Furthermore, in S1, the predicted user movement trajectory is composed of the user's position at eight future time points, expressed as Tra = {(t1,loc1),…(t i ,loc i ),…(t8,loc8)}, where ti represents the time of the i-th point, loc i represents the position at the i-th time point.
[0019] Further, S2 specifically includes the following steps:
[0020] Calculate the distance l between the position loc8 of the last point of the predicted user movement trajectory and the position loc of the currently providing server, and compare l with the server coverage radius r. When l > r, execute S3; otherwise, return to S1. mec Between, and compare l with the server coverage radius r. When l > r, execute S3; otherwise, return to S1.
[0021] Further, S3 specifically includes the following steps:
[0022] For the trajectory points in the predicted trajectory, calculate the distance l between each trajectory point and the server one by one in reverse order from the seventh trajectory point, and compare it with the server coverage radius r. When l < r, take the position of this trajectory point as the migration position point loc mig , the migration position point loc mig The corresponding time as the migration moment t mig .
[0023] Further, S4 specifically includes the following steps:
[0024] S41, Solve the optimal migration strategy;
[0025] Define the migration strategy D as a matrix of size M×N, where M represents the maximum number of tasks and N represents the number of edge servers;
[0026]
[0027] Among them, D j,i represents whether the j-th service Task j is migrated to the server MEC i to execute, and the value of D j,i is 0 or 1, representing that Task j is not migrated to MEC i to execute and is migrated to MEC i to execute;
[0028] Establish a service migration model with the service data transmission delay and data transmission energy consumption as the optimization objectives. The data transmission delay calculation formula between the service Task j and the server MEC i is as follows:
[0029]
[0030] Among them, T j,i represents the data transmission delay, dataj Represents the service task requested by the user j The amount of data to be transmitted, V i Representative server MEC i The data transmission rate between the user and the i The calculation formula is as follows:
[0031]
[0032] Among them, B i Representative server MEC i The corresponding transmission channel available bandwidth, p i Representative server MEC i Corresponding to the base station's transmit power, g represents the channel power gain, d i Represents the migration location point loc mig MEC with Server i The distance between them, δ represents the channel loss coefficient, and σ represents the noise power;
[0033] Service Task j MEC to the server i The calculation formula for data transmission energy consumption during migration is as follows:
[0034] E j,i =data mig d mig P i
[0035] Among them, E j,i Represents the energy consumption during the migration process, data mig Represents the amount of migrated data, d mig Represents the distance between the source server and the target server, P i Represents the transmission power of the wired link between servers;
[0036] The objective function of the service migration model is as follows:
[0037]
[0038] α+β=1,(α>0,β>0)
[0039] Among them, D represents the migration strategy, α represents the delay weight, β represents the energy consumption weight, and the optimization goal is to minimize the total cost of each migration;
[0040] Then, the optimal target server is found using the Q-Learning algorithm based on the migration location and server-related information;
[0041] S42, calculating the service running status at the migration time;
[0042] The server collects information about memory, CPU, bandwidth, and the current running progress of the service, and uses V i , S' to obtain the service running progress at the time of migration. The calculation formula of S' is as follows:
[0043]
[0044] Among them, S represents the current service running progress, S' represents the service running progress at the migration time, and V i represents the current data transmission rate between the server and the user, and t is the migration time t mig The difference between the current time and data task Represents the total data volume of the service.
[0045] The present invention also provides a storage medium, which includes a stored program, wherein when the program is run, any of the above-mentioned edge service migration methods oriented to task continuity is executed.
[0046] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes any of the above-mentioned task continuity-oriented edge service migration methods through the computer program.
[0047] Compared with the prior art, the present invention has the following advantages:
[0048] The present invention optimizes the entire migration workflow by combining trajectory prediction and state reproduction technology. By using trajectory prediction to determine the migration time and migration location in advance, the work that will cause a long service interruption time is arranged to be completed before the service is officially migrated, fully considering user mobility while also reducing the service interruption time; finally, the stateful service migration method of state reproduction is adopted to reduce the amount of data transmission between servers and reduce the energy consumption of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1 The figure is a flow chart of the method of the present invention.
[0051] Figure 2 This is the migration scene diagram of the present invention.
[0052] Figure 3 The following is a workflow diagram of the cold migration method.
[0053] Figure 4 Workflow diagram for pre-staging service migration.
[0054] Figure 5 It is the work flow chart of the present invention. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0057] In the edge computing environment, the existing continuity-oriented service migration method needs to complete the server switching work after suspending the service, including file copying, data transmission, service recovery, communication link switching, etc., and there is a problem of long service interruption time. The present invention proposes an edge service migration method based on trajectory prediction and improved LR (Log-Replay Migration) for resource transmission service migration scenarios. The method first uses the GAN (Generative Adversarial Network) algorithm to predict the future movement trajectory of the current mobile user, and determines the migration time and migration location of the service according to the predicted trajectory and server coverage. Then, the selection of the optimal migration decision and the preparation for migration implementation are performed concurrently, that is, the Q-Learning algorithm is used to select the optimal target server according to the migration location and the improved LR is used to implement service synchronization. The improved LR will actively determine the running status of the service when the communication link is switched according to the migration time, and prepare the service to this state on the target server in advance, so as to complete all the work of service synchronization before the formal migration, solve the problem of poor service synchronization caused by the service still running during the data transmission process, and also ensure the normal response of the service during service synchronization. Finally, when the migration time is reached, only the communication link needs to be switched, which shortens the service interruption time, ensures the continuity of service response, and also reduces the energy consumption during data transmission.
[0058] The present invention considers the dynamic migration problem of resource transmission services in edge computing scenarios. The entire migration system consists of multiple edge servers and users who are using mobile terminals. There will be overlaps between the server coverage areas to ensure that all areas can be covered. Users are using online services provided by edge servers. It is assumed that each edge server has the relevant resources required for the service, that is, each server can provide the service to the user.
[0059] The present invention improves the LR log replay migration method. Before the migration, the server actively determines the service operation state when the communication link is switched, so that the target server prepares the service to the state in advance. When the service on the original server also runs to the state, it means that the services on the two servers have reached the synchronization state. In order to achieve this purpose, the present invention determines a future time point as the migration moment according to trajectory prediction, and calculates the service operation state at the migration moment according to the current processing capacity of the server, the network transmission speed, the current operation state of the service and other information, and uses the state as the service operation state when the communication link is switched. According to the characteristics of the state reproduction method using the service operation log to represent the service operation state, the present invention writes the calculated service operation state into the service operation log in the form of a command, and then transmits the log to the target server. When the target server executes all state reproduction commands according to the log, it means that the services on the two servers have reached the synchronization state. In the whole process of using the improved LR method for service synchronization, each work does not need to interrupt the service, and the service can always respond normally, thereby ensuring the service continuity in the process.
[0060] like Figure 1 As shown, the present invention provides an edge service migration method oriented to task continuity, comprising the following steps:
[0061] S1, using GAN model to predict user movement trajectory;
[0062] First, the entire migration scenario consists of a mobile edge computing network communication scenario consisting of mobile users, edge servers, and running services.
[0063] In order to avoid energy consumption caused by frequent migration and prevent service interruption caused by user movement beyond the current server coverage, the method of the present invention determines whether the service should be migrated by predicting the user's movement trajectory in real time. The server collects the user's movement trajectory in real time and makes a trajectory prediction at a time interval, as follows.
[0064] The present invention adopts the GAN model to predict the user's mobile trajectory. GAN is a deep learning model based on a generator and a discriminator. Through the confrontation between the two networks, the prediction results are constantly approaching the true value. This model has become an effective method in the field of mobile trajectory prediction because of its advantages such as being able to process complex data, generate diversity, and have strong adaptability. The server makes a trajectory prediction based on the user's historical mobile trajectory at every time interval. The trajectory predicted by the present invention consists of the user's position at eight future time points, expressed as Tra = {(t1,loc1),…(t i ,loc i ),…(t8,loc8)}, where t i represents the time of the i-th point, loci Represents the position at the i-th time point.
[0065] S2. Determine whether the last point of the predicted trajectory exceeds the server coverage range;
[0066] After obtaining the predicted trajectory Tra, calculate the distance l between the position loc8 of the eighth point and the position loc of the currently serving server, and compare it with the server coverage radius r. When l > r, start S3; otherwise, return to S1. mec To calculate the distance l between them and compare it with the server coverage radius r. When l > r, start S3; otherwise, return to S1.
[0067] S3. Determine the migration time and migration location according to the predicted trajectory;
[0068] When to migrate and where to migrate are two important issues that need to be solved in the migration decision. Since the user is always in a moving state whether to migrate or not, it is necessary to minimize the service interruption time during the migration process and also minimize the service response delay as much as possible after the migration is completed. And ensuring that the user can get service responses before and after the migration is an indispensable part of ensuring service continuity.
[0069] The purpose of using the predicted trajectory to determine the migration time and migration location in the present invention has three aspects. First, fully consider the mobility of the user, making the migration location closer to the user's position after the migration ends, so as to ensure the reliability of the migration decision result; second, determine the migration time in advance and reserve time to complete service synchronization; third, it is necessary to calculate the service running state according to the migration time to prepare for implementing service migration using the improved LR later.
[0070] According to the predicted trajectory Tra, calculate the distance l between each trajectory point and the server one by one in reverse order from the seventh point, and compare it with the server coverage radius r. When l < r, take the position of this trajectory point as the migration position point loc mig , and the time corresponding to this point as the migration time t mig , and selecting the target server through this position can ensure that the user can get service responses before and after the migration.
[0071] S4. Solve the optimal migration strategy and calculate the service running state at the migration time;
[0072] (1) Solve the optimal migration strategy
[0073] First, define the migration strategy D as a matrix of size M×N, where M represents the maximum number of tasks and N represents the number of edge servers.
[0074]
[0075] Where D j,i represents the j-th service Task jWhether to migrate to server MEC i Execute on, D j,i The value is 0 or 1, representing Task j Do not migrate to MEC i Execution and migration to MEC i Execute on.
[0076] Then, a service migration model is established with service data transmission delay and data transmission energy consumption as optimization targets. j and server MEC i The calculation formula of data transmission delay between is shown in formula (1).
[0077]
[0078] Among them, T j,i Represents the data transmission delay, data j Represents the service task requested by the user j The amount of data to be transmitted, V i Representative server MEC i The data transmission rate between the user and the receiver is calculated according to formula (2).
[0079]
[0080] Among them, B i Representative server MEC i The corresponding transmission channel available bandwidth, p i Representative server MEC i Corresponding to the base station's transmit power, g represents the channel power gain, d i Represents the migration location point loc mig MEC with Server i The distance between them, δ represents the channel loss coefficient, and σ represents the noise power.
[0081] Service Task j MEC to the server i The data transmission energy consumption during migration is calculated according to formula (3).
[0082] E j,i =data mig d mig P i (3)
[0083] E j,i Represents the energy consumption during the migration process, data mig Represents the amount of migrated data, d mig Represents the distance between the source server and the target server, P iRepresents the transmission power of the wired link between servers.
[0084] The model objective function is as follows:
[0085]
[0086] α+β=1, (α>0,β>0) (5)
[0087] Where D represents the migration strategy, α and β represent the weights of latency and energy consumption respectively, and the optimization goal is to minimize the total cost of each migration.
[0088] Then, the Q-Learning algorithm is used to find the optimal target server based on the migration location and server-related information. The Q-Learning algorithm is a traditional reinforcement learning algorithm that is suitable for solving discrete decision-making problems in action space. Compared with using optimization algorithms to solve migration strategies, reinforcement learning algorithms are more adaptable to complex and changing edge environments, while also taking into account long-term return issues, which is conducive to improving the performance of the entire migration system.
[0089] (2) Calculate the service running status at the time of migration
[0090] The server collects relevant information such as memory, CPU, bandwidth, and the current running progress of the service, and uses formulas (2) and (6) to calculate the service running progress at the time of migration.
[0091]
[0092] Where S and S' represent the current service running progress and the service running progress at the migration time, respectively. i represents the current data transmission rate between the server and the user, and t is the migration time t mig The difference between the current time and data task Represents the total data volume of the service.
[0093] The present invention is aimed at the resource transmission type service migration scenario, and the service running progress at the migration time is used as the running state of the service at the migration time. The stateful service migration method using state reproduction is adopted, and the virtualization tool used is the Docker container. Each service runs on the server as a container. Each container will generate a log at the moment of startup. After obtaining the service running state at the migration time, the server collects the log file of the service, and then constructs the calculated service running state into a service running log, including the running time and the service running state, and writes it into the log file of the service.
[0094] S5, transmit data and notify the target server;
[0095] After obtaining the migration strategy and the service log file at the migration time, the server will transmit the log file and the service migration time to the target server through the wired link between servers, and issue a migration instruction to it, requiring it to complete the service recovery work and determine to execute the communication link switching work at the migration time.
[0096] The data transmission in this process is the main cause of energy consumption. To reproduce the service, you only need to transmit the service's running log, and then the target server can replay it according to the log. Usually the log file is much smaller than the service's data and resources, and the energy consumption is also small.
[0097] S6. The target server resumes service to a predetermined state;
[0098] After receiving the instructions and log information, the target server will first create a new container and allocate memory and processor resources to it, then parse the log and extract the commands, collect related resources, and execute the commands in the container in sequence. When all commands are executed, it means that the service is ready to the predetermined state on the target server.
[0099] Compared with state replication, the time consumed by using the log command replay method to complete the service recovery work will be longer, but the present invention uses trajectory prediction to take a future time point as the migration moment, and calculates the service running status at the migration moment, and puts the service recovery work before the formal migration. Therefore, although the service recovery time is still long, it will not cause the service interruption time to be too long.
[0100] S7, switch server;
[0101] When the time reaches the migration moment, and the user has entered the coverage of the target server, the communication link switching can be carried out. Then, the request will be redirected to the new target server by updating the network routing configuration. The target server will continue to provide services to the user. After ensuring that the service can respond normally, the application on the original server will be deleted. This process is a communication switch, which will cause a temporary service interruption. The interruption time is the communication link switching time.
[0102] In summary, the edge service migration method for task continuity proposed in the present invention realizes data transmission, service recovery and other tasks in the service migration process before formal migration through trajectory prediction and improved LR, and compresses the service interruption time to only include the communication link switching time, which will be affected by factors including network topology, physical distance, server load, network traffic, etc. This article has been simulated for multiple service migrations in the 5G scenario, and the experimental results show that the communication link switching time range is between 30ms and 80ms, and the service generally has a cache function, and the cached data can continue to provide users with about 1000ms of service when the network is disconnected. Therefore, using the present invention for service migration can greatly reduce the service interruption time, and the user's service experience will not be significantly affected during this period, which improves the user's service experience and effectively ensures service continuity.
[0103] In response to the problem of service interruption during service migration, the present invention proposes a new dynamic edge service migration method based on trajectory prediction and state reproduction. The present invention mainly evaluates the method proposed in the present invention from two aspects: energy consumption and latency. The latency includes migration latency and service response latency, and the energy consumption mainly refers to the energy consumption caused by data transmission that may be included in the migration process. Since the present invention mainly achieves better results by improving the entire migration workflow, the present invention is compared with the other two migration methods from two aspects: workflow and experimental data to prove the optimization of the present invention in workflow and its effectiveness in energy consumption and latency. The migration scenario diagram of the present invention is shown in the figure below. Figure 2 shown.
[0104] 1. Workflow Comparison
[0105] Typical service migration methods include cold migration method and pre-dump service migration method. The following will analyze the workflows of the migration method proposed in the present invention and these two methods to illustrate what specific improvements the method of the present invention has made in the workflow compared to the existing methods, thereby achieving a significant reduction in service interruption delay.
[0106] 1. Cold Migration Method
[0107] The migration workflow diagram of the cold migration method is as follows: Figure 3As shown in the figure, the method starts the server selection work when deciding to migrate, and then gradually starts the service suspension, data backup, data transmission and other work according to the process of the state replication service migration method. After receiving the relevant data, the target server starts to reproduce the service on this server. After the service synchronization work is completed, the server is switched, and the target server continues to provide the service to the user, and deletes the application that has been stopped on the original server. The cold migration method needs to stop the service after selecting the target server, and can only continue after the entire migration process is completed. Its migration delay includes data copy time, data transmission time, service recovery time and communication link switching time. The cold migration method uses the user's location during pre-migration to select the server, and the user is still moving during the migration process, which results in the selected server not necessarily being the best, which may increase the service response delay to a certain extent. At the same time, since the complete state replication method needs to transmit a large amount of data, it also causes excessive energy consumption.
[0108] 2. Pre-dump service migration method
[0109] The pre-dump service migration method is a basic improvement on the cold migration method. Its migration workflow is as follows: Figure 4 As shown. In order to solve the problem of long service stop time in the cold migration method, the layered characteristics of containers are used to transfer all the image layer data and most of the base layer data to the target server by incremental synchronization before the service is suspended. This can greatly reduce the amount of data transmission during service interruption, thereby reducing the migration delay. The migration delay of this method includes the time to synchronize the remaining base layer data and the communication link switching time. The base layer data is the data generated during the service operation process, and it is constantly changing with the operation of the service. Therefore, when synchronizing this part of the data, this method will transmit the data that has changed in the last transmission time multiple times, and only the last time will the service be stopped to transmit the remaining data. Although this method reduces the migration delay, it increases the energy consumption of data transmission.
[0110] 3. The method of the present invention
[0111] The migration workflow of the method of the present invention is as follows: Figure 5As shown, trajectory prediction is used to obtain the user's movement trajectory in the future, and a suitable migration location point is selected according to the trajectory to ensure that the service is reproduced on the target server before this point. During this period of time, the service is always running without interruption, and the service response will only be suspended when the communication link is switched when the migration point is reached. Therefore, the migration delay of the present invention only includes the communication link switching time. In addition, the present invention uses the migration position determined by trajectory prediction to select the target server. This position is closer to the user's position when the migration is completed in the actual situation, which is conducive to selecting the optimal target server, thereby reducing the service response delay. The present invention adopts a service synchronization method of state reproduction, which does not need to transmit a large amount of static and dynamic data resources. It only needs to transmit the log records of the service operation to the target server, which reduces energy consumption to a certain extent.
[0112] 2. Comparative Analysis of Experimental Data
[0113] The comparative experiment in this paper was conducted in a Linux system installed in a Windows 11 system. The virtual machine was allocated 2GB of virtual memory and 2 virtual CPU cores. The physical machine was equipped with a Core i7-12900 processor and 16GB of memory. The CRIU version used was 3.16 and the Docker version was 20.10. The migration decision experiment was conducted in a Python 3.8 environment.
[0114] (1) Experimental evaluation indicators
[0115] The indicators compared in this paper are latency and energy consumption. Latency includes migration latency and response latency. Migration latency represents the interruption time of the service, which is mainly determined by the amount of work that needs to be done after the service is interrupted. In the experiment, it is obtained by calculating the time difference between the start and end of the service interruption. The calculation method is shown in formula (7); response latency represents the response time of the user's request to the target server, which is determined by factors such as the performance of the server, the power of the base station, and the distance between the user and the server. It is calculated by formulas (1) and (2); energy consumption refers to the energy consumption caused by transmitting data from the original server to the target server during the service migration process. It is mainly affected by the amount of migration transmission data and is calculated by formula (3).
[0116] T mig =t over -t start (7)
[0117] Where T mig represents the migration delay, t over Represents the end time of service interruption, t start Represents the service interruption start time, T j Representing MEC j The response delay between the client and the user, and data represents the amount of data requested by the user.
[0118] (2) Comparative experiment
[0119] Aiming at the problem of long service interruption time during service migration, the present invention improves the traditional migration method and optimizes the workflow based on trajectory prediction and state reproduction technology, thereby reducing the delay and energy consumption during service migration. In order to prove its effectiveness, an experimental comparison was conducted with two other typical service migration methods, the cold migration method and the pre-dump migration method. 20 migration tests were conducted using the three methods respectively, and the average values of each index were calculated. The experimental results are shown in Table 1.
[0120] Table 1 Experimental comparison results
[0121]
[0122] As can be seen from Table 1, the present invention completes the relevant work of service recovery in advance, so that the migration delay is shortened by 99.3% compared with the cold migration method and 95.3% compared with the pre-dump migration method. From the perspective of response delay, the user position obtained by trajectory prediction in the present invention is closer to the user position when the migration is completed in the actual situation. Therefore, the response delay of the server selected by this position is also shortened by 6.6% compared with the other two methods, which improves the service quality and avoids the phenomenon that the user moves beyond the current service range during the migration process. From the perspective of energy consumption, the present invention uses a state reproduction method, and data is mainly transmitted in the form of logs, which reduces the amount of data transmission compared to containers. Compared with the cold migration method, the energy consumption of the present invention is reduced by 75.1%, and compared with the pre-dump method, it is reduced by 76.2%.
[0123] In summary, the latency and energy consumption of the present invention are significantly reduced compared to the other two migration methods. The reduced energy consumption is beneficial for operators to save energy and alleviate the energy pressure of edge servers. The shortened latency can improve service quality and improve user experience, especially the significant reduction in service interruption latency, which effectively ensures service continuity.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A task continuity-oriented edge service migration method, characterized in that: The steps include: S1. In the migration scenario, the GAN model is used to predict the user's movement trajectory and obtain the predicted trajectory; S2, determine whether the last point of the predicted trajectory exceeds the coverage of the server, if not, return to S1, if yes, execute S3; S3, determining the migration time and migration location according to the predicted trajectory; S4, based on the migration location and server information, the Q-Learning algorithm is used to solve the optimal migration strategy; Calculate the service running status at the migration time according to the current running status of the service and the server information, construct the service running status into a service running log, the service running log includes the running time and the service running status, and write the service running log into the service log file; S5. The original server transmits the service log file and the service migration time to the target server, and issues a migration instruction to the target server, requiring the target server to complete the service recovery work and determine to perform the communication link switching work at the migration time; S6. After receiving the migration instruction and the service log file, the target server creates a new container and allocates memory and processor resources to the container. Then, the target server parses the service log file and extracts the commands therein, collects relevant resources, and executes the commands in sequence in the container. When all commands are executed, it means that the service is ready to the predetermined state on the target server. S7. When the time reaches the migration moment, the user has entered the coverage of the target server and the communication link is switched. Then, the request is redirected to the new target server by updating the network routing configuration. The target server continues to provide services to the user and deletes the application on the original server after ensuring that the service can respond normally.
2. The task continuity-oriented edge service migration method according to claim 1, characterized in that: In S1, the migration scenario consists of mobile users, edge servers, and running services.
3. The task continuity-oriented edge service migration method according to claim 1, characterized in that: In S1, the predicted user movement trajectory consists of the user's position at eight future time points, expressed as Tra = {(t1,loc1),…(t i ,loc i ),…(t8,loc8)}, where t i represents the time of the i-th point, loc i Represents the position of the i-th time point.
4. The task continuity-oriented edge service migration method according to claim 1, characterized in that: S2 specifically includes the following steps: Calculate the location loc8 of the last point of the predicted user movement trajectory and the location loc of the server currently providing services mec The distance l between them is compared with the server coverage radius r. When l>r, execute S3, otherwise return to S1.
5. The task continuity-oriented edge service migration method according to claim 1, characterized in that: S3 specifically includes the following steps: For the trajectory points in the predicted trajectory, calculate the distance l between each trajectory point and the server one by one in reverse order starting from the seventh trajectory point, and compare it with the server coverage radius r. When l < r, take the position of this trajectory point as the migration position point loc mig , the migration position point loc mig The corresponding time is taken as the migration time t mig .
6. The task continuity-oriented edge service migration method according to claim 1, characterized in that: S4 specifically includes the following steps: S41, solving the optimal migration strategy; Define the migration strategy D as an M×N matrix, where M represents the maximum number of tasks and N represents the number of edge servers; Among them, D j,i Represents the jth service Task j Whether to migrate to server MEC i Execute on, D j,i The value is 0 or 1, representing Task j Do not migrate to MEC i Execution and migration to MEC i Execute on; A service migration model is established with service data transmission delay and data transmission energy consumption as optimization targets, and service tasks are j and server MEC i The formula for calculating the data transmission delay between two packets is as follows: Among them, T j,i Represents the data transmission delay, data j Represents the service task requested by the user j The amount of data to be transmitted, V i Representative server MEC i The data transmission rate between the user and the i The calculation formula is as follows: Among them, B i Representative server MEC i The corresponding transmission channel available bandwidth, p i Representative server MEC i Corresponding to the base station's transmit power, g represents the channel power gain, d i Represents the migration location point loc mig MEC with Server i The distance between them, δ represents the channel loss coefficient, and σ represents the noise power; Service Task j MEC to the server i The calculation formula for data transmission energy consumption during migration is as follows: E j,i =data mig d mig P i Among them, E j,i Represents the energy consumption during the migration process, data mig Represents the amount of migrated data, d mig Represents the distance between the source server and the target server, P i Represents the transmission power of the wired link between servers; The objective function of the service migration model is as follows: α+β=1,(α>0,β>0) Among them, D represents the migration strategy, α represents the delay weight, β represents the energy consumption weight, and the optimization goal is to minimize the total cost of each migration; Then, the optimal target server is found using the Q-Learning algorithm based on the migration location and server-related information; S42, calculating the service running status at the migration time; The server collects information about memory, CPU, bandwidth, and the current running progress of the service, and uses V i , S' to obtain the service running progress at the time of migration. The calculation formula of S' is as follows: Among them, S represents the current service running progress, S' represents the service running progress at the migration time, and V i represents the current data transmission rate between the server and the user, and t is the migration time t mig The difference between the current time and data task Represents the total data volume of the service.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the task continuity-oriented edge service migration method described in any one of claims 1 to 6 is executed.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the task continuity-oriented edge service migration method described in any one of claims 1 to 6 by running the computer program.
Citation Information
Patent Citations
Computing migration method supporting Internet-of-vehicles applications in mobile edge computing environment
CN109600419A
Random task queuing unloading optimization method based on edge computing
CN111930436A
Edge service active migration method based on mobility prediction
CN116208608A
Edge service migration method and device, equipment and storage medium
CN116846962A
Mobile edge computing service migration method and system based on trajectory information
CN118102234A