An edge service migration method for task continuity
By combining the GAN model and the Q-Learning algorithm, the edge service migration method prepares the service state on the target server in advance, which solves the problems of long interruption time and high energy consumption in edge service migration, and achieves service continuity and efficient migration.
Patent Information
- Application Number
- CN202411394575.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Existing edge service migration methods suffer from long interruption times and high data transmission energy consumption due to service discontinuity issues caused by user mobility and limited edge server coverage. In particular, the service needs to be paused during the synchronization process, resulting in excessively long service interruption times.
A GAN model is used to predict user movement trajectories, and the Q-Learning algorithm is used to determine the optimal migration strategy and migration location. Service status is prepared on the target server in advance by reproducing the state, and service operation logs are used for synchronization to ensure that service synchronization is completed before the formal migration.
It reduces service downtime, lowers data transmission energy consumption, ensures service continuity and responsiveness, and improves user experience.
Smart Images

Figure CN119356811B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of resource allocation, and particularly relates to an edge service migration method for task continuity. BACKGROUND
[0002] Edge service migration is to migrate the service from one edge server to another server that can better meet the user's demand in the edge computing environment. The main problem to be solved is the service response discontinuity caused by user mobility. Specifically, the conflict between the limited coverage of edge servers and the mobility of user terminals leads to a sharp decline in service quality, and even the running edge service may appear to be interrupted. Service migration can be divided into stateless migration and stateful migration. The former only redirects the user's request to a new server and is not affected by the previous request and state. The latter needs to ensure that the service completely recovers to the state before migration and continues to provide services for users after migration, so it is called real-time migration. Stateful service migration is the premise to ensure service continuity.
[0003] Currently, the service migration method to solve the service discontinuity problem caused by user mobility and the limited coverage of edge servers needs to complete two tasks, one is migration decision making, and the other is migration implementation. The purpose of migration decision making is to determine when the running service needs to be migrated and where to migrate. Using optimization algorithms or reinforcement learning algorithms to select the optimal target server with the time delay and energy consumption in the migration process as the optimization target is the main direction of current research. Migration implementation needs to determine the way the service migrates, and the key is to ensure the consistency of the service running state before and after migration. In recent years, the method of copying and transferring the running state of the service to the target server through the container to restore and continue running is usually used. The stateful service migration method through the container can be divided into two categories, one is state replication, and the other is state reproduction.
[0004] State replication is a method of copying the state of a service in the source environment to the target environment. During migration, the current service state is first snapped on the original server, including data in memory, variable values, file system state, etc. The generated snapshot is transmitted to the target server and restored in the target server. State reproduction is a method of recreating a service in a target environment rather than directly copying the state of the source environment. The method of implementing 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 log information of the service on the original server, then transmit the log to the target server, the target server parses the log and executes the commands in it in order, and restores the service to the original state.
[0005] In existing research, migration decision and migration implementation are usually studied separately, and there is a clear sequence between the two. For example, some researchers propose a service migration strategy based on Markov decision process, and then propose a pre-dump service migration method using the hierarchical characteristics of containers. Some researchers propose to predict the future target trajectory of users according to the historical trajectory of user movement, then determine the list of alternative base stations according to the target trajectory and obtain the optimal migration base station and the optimal service migration path, and dynamically update the service remediation migration according to the migration comprehensive time.
[0006] In summary, the current research on service migration methods still has the following problems: the existing service synchronization method takes the running state of the current service on the original server as the target state for service synchronization, and if the service is still running during synchronization, 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 long interruption time. The mobility of users is not considered, and users are constantly moving during the entire migration process. The location of the user has a great influence on the selection of the server and the quality of service. The state replication method requires a large amount of data transmission, which will cause a large transmission energy consumption, which is one of the reasons for the long service interruption time. SUMMARY
[0007] Therefore, the purpose of the present application is to propose an edge service migration method for task continuity, which optimizes the entire migration workflow by combining trajectory prediction and state reproduction technology. The trajectory prediction determines the migration time and migration location in advance, which will cause the service interruption time to be too long. The work arrangement that will cause the service interruption time to be too long is completed before the formal migration of the service, fully considering the mobility of users while reducing the interruption time of the service. Finally, the stateful service migration method of state reproduction is adopted, which reduces the data transmission amount between servers and reduces the data transmission energy consumption.
[0008] The technical means adopted by the present application are as follows:
[0009] A task continuity-oriented edge service migration method, comprising the following steps:
[0010] S1. In a migration scenario, a GAN model is used to predict a user movement trajectory, and a predicted trajectory is obtained; the user movement trajectory is predicted using a deep learning model.
[0011] S2. It is judged whether the last point of the predicted trajectory is beyond the coverage range of the server, if not, returning to S1, if yes, executing S3;
[0012] S3. The migration time and migration position are determined according to the predicted trajectory;
[0013] S4. Based on the migration position and server information, a Q-Learning algorithm is used to solve an optimal migration strategy; the service running state at the migration time is calculated according to the current service running state and server information, the service running state is constructed into a service running log, the service running log comprises a running time and a service running state, and the service running log is written into a service log file;
[0014] S5. The original server transmits the service log file and service migration time to the target server, issues a migration instruction to the target server, requires the target server to complete service recovery work and determines to perform communication link switching work at the migration time;
[0015] S6. After accepting the migration instruction and service log file, the target server newly creates a container and allocates memory and processor resources to the container, then parses the service log file and extracts commands therein, collects related resources, and executes the commands in sequence in the container, when all the commands are executed, it means that the service is prepared to a predetermined state on the target server;
[0016] S7. When the time reaches the migration time, the user has also entered the coverage range of the target server, communication link switching work is performed, then the request is redirected to the new target server by updating the network routing configuration, the target server continues to provide services for the user, and the application program on the original server is deleted after ensuring that the service can respond normally.
[0017] Further, in S1, the migration scenario is composed of a mobile user, an edge server and a service being run.
[0018] Further, in S1, the predicted user movement trajectory is composed of positions of eight future time points of the user, and is represented as Tra={(t1,loc1),…(t i ,loc i ),…(t8,loc8)} where ti loc represents the time of the i th point i loc represents the position of the i th time point.
[0019] Further, S2 specifically comprises the following steps:
[0020] loc8, and the current server location loc mec , and compares l with the server coverage radius r, when l>r, S3 is executed, otherwise, returns to S1.
[0021] Further, S3 specifically comprises the following steps:
[0022] loc, and compares l with the server coverage radius r, when l<r, the position of the trajectory point is taken as the migration position point loc mig , the migration position point loc mig corresponding time as the migration time t mig .
[0023] Further, S4 specifically comprises the following steps:
[0024] S41, solving the optimal migration strategy;
[0025] The migration strategy D is defined as a matrix of size MxN, where M represents the maximum number of tasks, and N represents the number of edge servers;
[0026]
[0027] wherein, D j,i represents whether the j th service Task j is migrated to the server MEC i for execution, D j,i takes the value of 0 or 1, respectively representing that Task j is not migrated to MEC i for execution and is migrated to MEC i for execution;
[0028] The service migration model is established with service data transmission delay and data transmission energy consumption as optimization objectives, and the data transmission delay calculation formula between service Task j and server MEC i is as follows:
[0029]
[0030] wherein, T j,i represents data transmission delay, dataj Service Task representing user requests j The amount of data to be transmitted, V i Representative server MEC i Data transfer rate between the user and the data transfer rate, V i The calculation formula is as follows:
[0031]
[0032] Among them, B i Representative server MEC i The corresponding available bandwidth of the transmission channel, p i Representative server MEC i The corresponding base station transmit power, g represents the channel power gain, d i Represents the migration location point loc mig With server MEC i The distance between them, where δ represents the channel loss coefficient and σ represents the noise power;
[0033] Service Task j To the server MEC i The formula for calculating 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 Data represents the energy consumption generated during the migration process. mig d represents the amount of data migrated. mig P represents the distance between the source server and the target server. i This 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] Where D represents the migration strategy, α represents the latency weight, β represents the energy consumption weight, and the optimization objective is to minimize the total cost of each migration.
[0040] Then, based on the migration location and relevant server information, the Q-Learning algorithm is used to find the optimal target server;
[0041] S42. Calculate the service running status at the migration time;
[0042] The server collects relevant information of memory, CPU, bandwidth and current running progress of the service, and obtains the running progress of the service at the migration time point through V i , S' is obtained, and the calculation formula of S' is as follows:
[0043]
[0044] Wherein, S represents the current service running progress, S' represents the service running progress at the migration time point, V i represents the data transmission rate between the current server and the user, t is the difference between the migration time point t mig and the current time, data task represents the total data volume of the service.
[0045] The application further provides a storage medium, which comprises a stored program, wherein the program performs any one of the edge service migration methods for task continuity when running.
[0046] The application further provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor performs any one of the edge service migration methods for task continuity by running the computer program.
[0047] Compared with the prior art, the application has the following advantages:
[0048] The application optimizes the whole migration workflow by combining trajectory prediction and state reproduction technology. The migration time point and migration position are determined in advance through trajectory prediction, so that the work that will cause long service interruption time is completed before the formal migration of the service, the user mobility is fully considered, and the service interruption time is reduced; finally, the stateful service migration mode of state reproduction is adopted, so that the data transmission amount between servers is reduced, and the data transmission energy consumption is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0050] Figure 1 The method flowchart of the application.
[0051] Figure 2 The migration scene diagram of the application.
[0052] Figure 3 Workflow diagram for cold migration method.
[0053] Figure 4 Workflow diagram for pre-dump service migration.
[0054] Figure 5 Workflow diagram for the present invention. DETAILED DESCRIPTION
[0055] In order to make the persons skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the persons skilled in the art without creative labor should belong to the protection scope of the present application.
[0056] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be exchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units 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 server switching work after suspending the service, including file copying, data transmission, service recovery, communication link switching, etc., and has the problem of long service interruption time. The present application 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 moving trajectory of the current mobile user, determines the migration time and migration location of the service according to the predicted trajectory and server coverage range. Then, the selection of the optimal migration decision and the preparation work of the migration implementation are performed concurrently, that is, the optimal target server is selected according to the migration location using the Q-Learning algorithm and the service synchronization work is implemented using the improved LR. The improved LR actively determines the running state of the service at the time of communication link switching according to the migration time, and prepares the service to this state in advance on the target server, which realizes the completion of all service synchronization work before formal migration, solves the problem of service synchronization difference caused by the running service during data transmission, and also ensures the normal response of the service during service synchronization. Finally, only communication link switching is needed at the migration time, which shortens the service interruption time, ensures the continuity of service response, and reduces the energy consumption during data transmission.
[0058] The present application considers the dynamic migration problem of resource transmission service in the edge computing scenario, and the entire migration system is composed of multiple edge servers and a group of users using mobile terminals. There is an overlap between the server coverage ranges to ensure that all areas can be covered. The users are using online services provided by edge servers. It is assumed that each edge server has the relevant resources required by the service, that is, each server can provide the service for the user.
[0059] The application improves the LR log replay migration method. Before migration, the server actively determines the service running state at the time of communication link switching, 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 reach the synchronization state. In order to achieve this purpose, the application determines a future time point as the migration time according to trajectory prediction, and calculates the service running state at the migration time according to the current processing capacity of the server, the network transmission speed, the current running state of the service and other information, and takes the state as the service running state at the time of communication link switching. According to the characteristics of the service running state represented by the service running log according to the state reproduction method, the application writes the calculated service running state into the service running log in the form of a command, and then transmits the log to the target server. When the target server executes all the state reproduction commands according to the log, it means that the services on the two servers reach the synchronization state. In the whole process of using the improved LR method to synchronize the service, each work does not need to interrupt the service, and the service can always respond normally, so as to ensure the service continuity in the process.
[0060] As shown in Figure 1 , the application provides an edge service migration method for task continuity, comprising the following steps:
[0061] S1, predicting the user mobile trajectory by using a GAN model;
[0062] First of all, the whole migration scene is composed of a mobile edge computing network communication scene composed of a mobile user, an edge server and a running service.
[0063] In order to avoid the energy consumption caused by frequent migration and prevent the service interruption caused by the user moving out of the current server coverage range, the method of the application judges whether the service should be migrated by means of real-time user mobile trajectory prediction. The server will collect the user's mobile trajectory in real time, and make a trajectory prediction every time interval, as follows.
[0064] The application uses a GAN model to predict the user mobile trajectory. GAN is a deep learning model based on generator and discriminator. Through the mutual opposition of the two networks, the prediction result tends to the true value. The model has become an effective method in the field of mobile trajectory prediction because of its advantages of being able to process complex data, generating diversity and strong adaptability. The server will make a trajectory prediction every time interval according to the user's historical mobile trajectory. The trajectory predicted by the application is composed of the positions of eight future time points of the user, represented as Tra={(t1,loc1),…(t i ,loc i ),…(t8,loc8)},where t i represents the time of the i th point, loci the position representing the ith time point.
[0065] S2, judging whether the last point of the predicted trajectory exceeds the server coverage range;
[0066] After obtaining the predicted trajectory Tra, the distance l between the position loc8 of the eighth point and the position loc mec of the currently-provided server is calculated, and compared with the server coverage radius r, when l>r, S3 is started, otherwise, S1 is returned.
[0067] S3, determining the migration time and the migration position according to the predicted trajectory;
[0068] When to migrate and where to migrate are two important problems to be solved by the migration decision, because the user is always in a moving state whether to migrate or not, both the service interruption time in the migration process and the service response delay after the migration are minimized, and it is an indispensable part to guarantee the service continuity that the user can be served after the migration.
[0069] The present application has three purposes for determining the migration time and the migration position according to the predicted trajectory, one is to fully consider the mobility of the user, so that the migration position is closer to the user position after the migration, thereby guaranteeing the reliability of the migration decision result; the second is to determine the migration time in advance, and reserve time for completing service synchronization; the third is to calculate the service running state according to the migration time, and prepare for subsequent use and improvement of LR to implement service migration.
[0070] According to the predicted trajectory Tra, the distance l between each trajectory point and the server is calculated in reverse order, and compared with the server coverage radius r, when l mig , the position of the trajectory point is taken as the migration position point loc mig , and the time corresponding to the point is taken as the migration time t j,i , so that the user can be served after the migration.
[0071] S4, solving the optimal migration strategy and calculating the service running state of the migration time;
[0072] (1) solving the optimal migration strategy
[0073] Firstly, the migration strategy D is defined as a matrix with a size of MxN, wherein M represents the maximum number of tasks, and N represents the number of edge servers.
[0074]
[0075] wherein D j,i represents the jth service Task jWhether to migrate to the server MEC i D j,i is 0 or 1, respectively representing Task j not migrating to the MEC i executing on the server and migrating to the MEC i executing on the server.
[0076] Then, a service migration model is established with service data transmission delay and data transmission energy consumption as optimization objectives. The data transmission delay between the service Task j and the server MEC i is calculated according to formula (1).
[0077]
[0078] Among them, T j,i represents the data transmission delay, data j represents the amount of data required to be transmitted by the user's requested service Task j , V i represents the data transmission rate between the server MEC i and the user, which is calculated according to formula (2).
[0079]
[0080] Among them, B i represents the available bandwidth of the corresponding transmission channel of the server MEC i , p i represents the transmission power of the corresponding base station of the server MEC i , g represents the channel power gain, d i represents the distance between the migration location point loc mig and the server MEC i , δ represents the channel loss coefficient, and σ represents the noise power.
[0081] The data transmission energy consumption when the service Task j migrates to the server MEC i 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 generated during migration, data mig represents the amount of migrated data, d mig represents the distance between the source server and the target server, and P iThe transmission power of a wired link between the representative servers.
[0084] The model objective function is as follows:
[0085]
[0086] Alpha+beta=1, (alpha>0, beta>0) (5)
[0087] Wherein D represents a migration strategy, alpha and beta respectively represent the weight of delay and energy consumption, and the optimization target is the minimum total cost of each migration.
[0088] Then, the optimal target server is obtained by using a Q-Learning algorithm according to the migration position and the related information of the server. The Q-Learning algorithm is a traditional reinforcement learning algorithm, which is suitable for solving decision-making problems with discrete action space. Compared with using an optimization algorithm to solve the migration strategy, the reinforcement learning algorithm can better adapt to complex and variable edge environments, and can also take into account long-term return problems, which is beneficial to improve the performance of the whole migration system.
[0089] (2) calculating the service running state at the migration time
[0090] The server collects related information such as memory, cpu, bandwidth and the current running progress of the service, and obtains the service running progress at the migration time through formula (2), (6).
[0091]
[0092] Wherein S and S' respectively represent the current service running progress and the service running progress at the migration time, V i Represents the data transmission rate between the current server and the user, t is the difference between the migration time t mig And the current time, data task Represents the total data volume of the service.
[0093] The present application aims at the resource transmission type service migration scene, and takes the service running progress at the migration time as the running state of the service at the migration time. The state reproduction stateful service migration method is adopted, the virtualization tool used is a Docker container, each service runs on the server in the unit of container, each container generates a log at the moment of starting, after obtaining the service running state at the migration time, the server collects the log file of the service, then builds the calculated service running state into a service running log, including running time and service running state, and writes it into the log file of the service.
[0094] S5, transmitting data and notifying the target server;
[0095] After obtaining the migration strategy and the service log file at the migration time, the server transmits the log file and the service migration time to the target server through a wired link between servers, sends a migration instruction to the target server, and requires the target server to complete service recovery and determine the communication link switching work at the migration time.
[0096] The data transmission of the process is the main cause of energy consumption, and service recovery only needs to transmit the service running log to the target server, and then the target server replays according to the log. Generally, the log file is much smaller than the service data and resources, and the energy consumption is also smaller.
[0097] S6, the target server recovers the service to the predetermined state;
[0098] After receiving the instruction and the log information, the target server first creates a container and allocates memory and processor resources to the container, then parses the log and extracts the commands in the log, collects related resources, and executes the commands in the container in sequence. When all the commands are executed, it means that the service on the target server is ready to the predetermined state.
[0099] Compared with state replication, the method of using log command replay to complete service recovery work consumes more time, but the present application uses trajectory prediction to set a future time point as the migration time, and calculates the service running state at the migration time, and places the service recovery work before the formal migration. Therefore, although the service recovery consumes time, it does not cause the service interruption time to be too long.
[0100] S7, switching the server;
[0101] When the time reaches the migration time, the user has also entered the coverage range of the target server, and the communication link switching work can be performed. Then, by updating the network routing configuration, the request is redirected to the new target server, and the target server continues to provide services for the user. After ensuring that the service can respond normally, the application program on the original server is deleted. The process belongs to communication switching, which will cause temporary service interruption, and the interruption time is the communication link switching time.
[0102] In summary, the edge service migration method for task continuity provided by the application realizes data transmission, service recovery and other work in the service migration process before formal migration through trajectory prediction and improved LR, and service interruption time is compressed to only include communication link switching time, which is affected by factors including network topology, physical distance, server load, network traffic and the like. In the 5G scenario, the communication link switching time range is 30ms-80ms through multiple service migration simulations, and services generally have a cache function, and cache data can continue to provide services for users for about 1000ms when the network is disconnected. Therefore, using the application for service migration can greatly reduce the service interruption time, and the service experience of users will not be significantly affected during this period, thereby improving the user service experience and effectively ensuring service continuity.
[0103] The application proposes a new dynamic edge service migration method based on trajectory prediction and state reproduction to solve the service interruption problem in the service migration process. The method proposed by the application is evaluated from two aspects of energy consumption and time delay, the time delay includes migration delay and service response delay, and the energy consumption mainly refers to the energy consumption caused by data transmission in the migration process. Since the application mainly improves the entire migration workflow to achieve better results, the application is compared with two other migration methods from two aspects of workflow and experimental data to prove the optimization of the workflow of the application and the effectiveness of energy consumption and time delay. The migration scene diagram of the application is shown in Figure 2
[0104] I. Workflow comparison
[0105] The typical service migration methods include cold migration method and pre-dump service migration method. The migration method proposed by the application is compared with the two methods in terms of workflow to illustrate what improvements are made in the workflow of the application compared with the existing methods, thereby realizing a great reduction in service interruption time.
[0106] 1. Cold migration method
[0107] The migration workflow diagram of the cold migration method is shown in Figure 3 As shown in the figure, the method starts server selection work when deciding to migrate, and then starts service suspension, data backup, data transmission and other work step by step according to the flow of the state replication service migration method. After the target server receives the relevant data, it starts to reproduce the service on the server. After the service synchronization work is completed, the server is switched, and the target server continues to provide the service for the user. The cold migration method needs to stop the service after selecting the target server, and can continue only after the entire migration process is completed. The migration delay includes data copying time, data transmission time, service recovery time and communication link switching time. The cold migration method uses the user's location before migration to select the server, and the user is still moving during the migration process, which results in that the selected server is not necessarily optimal, and may cause an increase in service response delay to some 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 an improvement on the cold migration method, and the migration work flow is as shown in the figure. Figure 4 In view of the problem of long service stop time in the cold migration method, the incremental synchronization method is used to transmit all image layer data and most of the base layer data to the target server before service suspension by using the container layering feature. This can greatly reduce the data transmission amount during service interruption, thereby reducing the migration delay. The migration delay of the method includes the time of synchronizing the remaining base layer data and the communication link switching time. The base layer data is data generated during service running, and changes with the running of the service. Therefore, when synchronizing this part of data, the method will transmit the data changed in the last transmission time multiple times, and only the last time will stop the service to transmit the remaining data. Although the method reduces the migration delay, it increases the energy consumption of data transmission.
[0110] 3. Method of the present application
[0111] The migration work flow of the method of the present application is as shown in the figure. Figure 5As shown, trajectory prediction is used to obtain the user's movement trajectory over a future period. Based on this trajectory, a suitable migration point is selected, ensuring that service reproduction on the target server is completed before reaching that point. During this period, the service runs continuously without interruption, only pausing when communication links are switched at the migration point. Therefore, the migration latency of this invention only includes the communication link switching time. Furthermore, this invention uses the migration point determined by trajectory prediction to select the target server, which is closer to the user's actual location upon completion of the migration, facilitating the selection of the optimal target server and reducing service response latency. This invention employs a state reproduction service synchronization method, which does not require the transmission of large amounts of static and dynamic data resources; only the service operation logs need to be transmitted to the target server, reducing energy consumption to some extent.
[0112] II. Comparative Analysis of Experimental Data
[0113] The comparative experiments in this paper were conducted on a Linux system installed on Windows 11. 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 CRUI 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 metrics compared in this paper are latency and energy consumption. Latency includes migration latency and response latency. Migration latency represents the service interruption time, which is mainly determined by the amount of work required after the service interruption. In the experiment, it is obtained by calculating the time difference between the start and end of the service interruption, as shown in formula (7). Response latency represents the response time of the user's request to the target server. It is determined by factors such as the server's performance, the power of the base station, and the distance between the user and the server, and 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 data transmitted during the migration and is calculated by formula (3).
[0116] T mig =t over -t start (7)
[0117] Where T mig Represents migration delay, t over The time t represents the end time of the service interruption. start T represents the start time of the service interruption. j Representing MEC j The response latency between the user and the system, where data represents the amount of data requested by the user.
[0118] (2) Comparative experiment
[0119] The present application is directed to the problem of too long service interruption time in service migration process, based on trajectory prediction and state reproduction technology, the traditional migration method is improved and the work flow is optimized, the time delay and energy consumption of service migration are reduced. In order to prove its effectiveness, two typical service migration methods of cold migration method and pre-dump migration method are compared, 20 migration tests are carried out using three methods respectively, the average value of each index is calculated, and the experimental results are shown in Table 1.
[0120] Table 1 Experimental comparison results table
[0121]
[0122] As can be seen from Table 1, the present application completes the related work of service recovery in advance, so that the migration time delay is shortened by 99.3% compared with the cold migration method, and by 95.3% compared with the pre-dump migration method. From the perspective of response time delay, the user position obtained by trajectory prediction is closer to the actual user position at the time of migration completion, so the response time delay of the server selected from this position is also shortened by 6.6% compared with the other two ways, and the service quality is improved, and the phenomenon of user moving beyond the current service range during migration is also avoided. In terms of energy consumption, the present application uses the state reproduction method, and the data is mainly transmitted in the form of log, which reduces the data transmission amount compared with the container, and the energy consumption of the present application is reduced by 75.1% compared with the cold migration method, and by 76.2% compared with the pre-dump method.
[0123] In summary, the time delay and energy consumption of the present application are significantly reduced compared with the other two migration methods, and the reduction of energy consumption is beneficial to the operator to save energy and relieve the energy pressure of the edge server, and the shortening of time delay can improve the service quality and improve the user experience, especially the significant reduction of service interruption time delay, which effectively guarantees the service continuity.
[0124] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for edge service migration oriented to task continuity, characterized in that, The method comprises the following steps: S1, in a migration scenario, a GAN model is used to predict a user moving track to obtain a predicted track; S2, it is judged whether the last point of the predicted track is beyond the coverage range of a server, if not, returning to S1, if yes, performing S3; S3, a migration time and a migration position are determined according to the predicted track; S4, based on the migration position and server information, a Q-Learning algorithm is used to solve an optimal migration strategy; According to the current running state of the service and the server information, the running state of the service at the migration time is calculated, the service running state is constructed into a service running log, the service running log comprises a running time and a service running state, and the service running log is written into a service log file; S41, the optimal migration strategy is solved; Defining migration policy For one Size of the matrix, where Represents the maximum number of tasks, Represents the number of edge servers; wherein, represents the first service whether to migrate to the server for execution, the value of which is 0 or 1, respectively representing not migrating to the server for execution and migrating to the server for execution; A service migration model is established with service data transmission delay and data transmission energy consumption as optimization objectives and server between the data transmission delay calculation formula is as follows: wherein, representing the data transmission latency, representing the service requested by the user the amount of data to be transmitted, representing the server and the data transmission rate between the user, The calculation formula is as follows: wherein, representative server corresponding transmission channel available bandwidth, representative server corresponding base station transmit power, representative channel power gain, representative migration location point distance between the server , representative channel loss coefficient, representative noise power; Service To the server The formula for calculating the data transmission energy consumption during migration is as follows: wherein, represents the energy consumption generated in the migration process, represents the amount of migration data, represents the distance between the source server and the target server, represents the transmission power of the wired link between the servers; The objective function of the service migration model is as follows: wherein, represents a migration policy, represents a latency weight, represents an energy consumption weight, and the optimization objective is to minimize the total cost of each migration; Then, the optimal target server is obtained by using a Q-Learning algorithm according to the migration position and the related information of the server; S42, the service running state at the migration time is calculated; The server collects relevant information of memory, CPU, bandwidth and current running progress of the service, and obtains the running progress of the service at the migration moment through , , The calculation formula is as follows: wherein, represents the current service running progress, represents the service running progress at the migration time, represents the current data transmission rate between the server and the user, is the total data amount of the service, is the difference between the migration time and the current time, represents the total data amount of the service; S5, the original server transmits the service log file and the service migration time to the target server, issues a migration instruction to the target server, requires the target server to complete the service recovery work and determines to perform the communication link switching work at the migration time; S6, after accepting the migration instruction and the service log file, the target server newly creates a container and allocates memory and processor resources to the container, then analyzes the service log file and extracts the commands therein, collects related resources, and executes the commands in sequence in the container, when all the commands are executed, it means that the service is prepared to the predetermined state on the target server; S7, when the time reaches the migration time, the user has also entered the coverage range of the target server, the communication link switching work is performed, then the request is redirected to the new target server by updating the network routing configuration, the target server continues to provide the service for the user, and after ensuring that the service can respond normally, the application program on the original server is deleted.
2. The method of claim 1, wherein, In S1, the migration scenario is composed of a mobile user, an edge server and a running service.
3. The method of claim 1, wherein, In S1, the predicted user movement trajectory is composed of the user's future eight time point positions, denoted as wherein represents the time of the point, represents the position of the time point.
4. The method of claim 1, wherein, S2 specifically comprises the following steps: calculating a distance between the last point of the predicted user movement trajectory and the current server location and the server location currently serving the user and comparing the distance to a server coverage radius when S3 is performed, otherwise returning to S1. 5. The method of claim 1, wherein, S3 specifically comprises the following steps: The distance between each trajectory point and the server is calculated in reverse order from the seventh trajectory point , and compared with the server coverage radius When , the position of the trajectory point is taken as the migration position point The corresponding time is taken as the migration time . 6. A storage medium, characterized by The storage medium comprises a stored program, wherein the program runs to execute the edge service migration method for task continuity in any one of claims 1 to 5.
7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the edge service migration method for task continuity in any one of claims 1 to 5 by running the computer program.
Citation Information
Patent Citations
Edge service active migration method based on mobility prediction
CN116208608A