A service migration method based on priority and spatiotemporal trajectory prediction

By constructing user feature vectors and relationship interaction trajectory graphs, combined with the Transformer and DQN algorithms, user movement trajectories are predicted and service migration decisions are made. This solves the problems of network performance degradation and resource waste in cloud-edge scenarios, and achieves low-latency, high-reliability service migration.

CN118264670BActive Publication Date: 2025-09-23NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410117730.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2025-09-23
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

In the cloud-edge scenario, user mobility causes network performance degradation and service interruption problems. Existing migration methods cannot effectively meet users' low latency and high reliability requirements, and computing resources are seriously wasted.

Method used

By constructing user feature vectors and relationship interaction trajectory graphs, using the Transformer model to predict user movement trajectories, combining service priority and the DQN algorithm to make service migration decisions and optimize the service migration process.

Benefits of technology

It improves the accuracy of user movement trajectory prediction, reduces service costs, and ensures users' low-latency and high-reliability service needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118264670B_ABST
    Figure CN118264670B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of service migration technology and discloses a service migration method based on priority and spatiotemporal trajectory prediction, including: constructing service resource requirements and initial distribution feature vectors and initial user feature vectors, calculating service priorities, constructing user interaction relationship trajectory graphs, constructing multi-space user interaction relationship trajectory graphs, constructing time-series user interaction relationship trajectory graphs, processing the spatiotemporal trajectory graphs through a Transformer model to output feature representations, and concatenating the feature vectors to obtain feature vectors. An MLP decoder is used to convert the feature vectors into two-dimensional coordinates in the real world to obtain the user's future movement trajectory; and based on the service priority and the user's future movement trajectory, service migration decisions are made through reinforcement learning. This method can predict the user's movement trajectory and, at the same time, make migration decisions based on the priority of the service required by the user to meet the user's low-latency, high-reliability service needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of service migration, and in particular relates to a service migration method based on priority and spatiotemporal trajectory prediction. Background Art

[0002] In cloud-edge-device scenarios, service migration accompanied by user mobility is a significant issue, as the limited coverage of a single edge server conflicts with the mobility of user terminals, potentially leading to degraded network performance, a sharp drop in QoS, and even interruption of ongoing services. To ensure service continuity during user migration, seamless service migration is crucial. When a user moves outside the edge server's service area, two scenarios need to be considered: 1) Continuing to run the service on the current edge server: Even if the user moves to another area, the service still runs on the current edge server. In this case, data is exchanged with the mobile user via the cloud or other edge servers. This can lead to increased data transmission costs; 2) Migrating the service to an edge server in the new area: In the case of a user moving to another area, the service can be migrated to an edge server in the new area. This may incur certain migration costs, but it can better adapt to user mobility.

[0003] Most existing migration methods rely on mobility prediction to determine the target server for service migration and begin computational migration before a communication handoff occurs. However, edge servers have limited resources, and in most cases, user service needs cannot be migrated to the same edge server due to node load. Furthermore, user needs often change over time, resulting in a phased nature of their service demands. Deploying all required services on the edge server that covers each user can result in a waste of computing resources. Summary of the Invention

[0004] To address the above technical issues, the present invention provides a service migration method based on priority and spatiotemporal trajectory prediction. This method predicts users' movement trajectories by mining their spatial interactions and the impact of their historical trajectories on future trajectories. Simultaneously, migration decisions are made based on the priority of the services required by the users to meet their service needs with low latency and high reliability.

[0005] In order to achieve the above object, the present invention is achieved through the following technical solutions:

[0006] The present invention is a service migration method based on priority and spatiotemporal trajectory prediction, which includes the following steps:

[0007] Step 1: Construct a user feature vector based on the user's geographical location;

[0008] Step 2: Based on the user feature vector constructed in step 1, construct a user relationship interaction trajectory graph;

[0009] Step 3: Based on the user relationship interaction trajectory graph constructed in step 2, a multi-space user interaction relationship trajectory graph is constructed, and the interaction features between users are obtained using the Transformer model. Specifically, the following steps are included:

[0010] Step 31: sort the user relationship interaction trajectory graph constructed in step 2 in chronological order, and then construct a multi-space user interaction relationship trajectory graph in a fully connected manner between each node;

[0011] Step 32: Based on the multi-space user interaction relationship trajectory diagram constructed in step 31, select people within a certain range of the user and use the Transformer model to obtain local spatial information. Select people outside the certain range of the user and use the Transformer model to obtain global spatial information.

[0012] Step 33: Combine the local information obtained in step 32 with the global information to obtain information about how the user is affected by other users in the current scene, and obtain the user's spatial features;

[0013] Step 4: Based on the user relationship interaction trajectory graph constructed in step 2, a time series user interaction relationship trajectory graph is constructed according to the user's historical movement trajectory. The user's time series features are extracted through the Transformer model.

[0014] Step 5: Based on the user's spatial and temporal features, the user's movement trajectory is predicted based on the user's spatiotemporal features:

[0015] Step 51: Concatenate the user's spatial features and temporal features to obtain the final feature vector;

[0016] Step 52: Use the MLP decoder to convert the feature vector obtained in step 51 into two-dimensional coordinates to obtain the user's position at the next moment. in Represents user u at time t i The longitude, Represents user u at time t i Latitude;

[0017] Step 53: Based on the predicted user movement trajectory, predict the time when the user arrives at the corresponding location;

[0018] Step 6: Construct service feature vector S = (s1, s2, ...s n ) and geographic region feature vector R=(r1,r2,…r m );

[0019] Step 7: Calculate the service priority based on the service feature vector and the geographic area feature vector constructed in step 6;

[0020] Step 8: Based on the service priority calculated in step 7 and the user movement trajectory predicted in step 5, a service migration decision is made through a DQN (deep Q-network);

[0021] In step 9, if the service does not migrate, the cloud or edge server exchanges data with the user; otherwise, the data is exchanged with the edge server after the service migration.

[0022] A further improvement of the present invention is that: in step 1, a user location feature vector is constructed according to the user's geographical location. in Represents user u at time t i The longitude, Represents user u at time t i The latitude.

[0023] A further improvement of the present invention is that: in step 2, based on the user feature vector constructed in step 1, a user relationship interaction trajectory graph G is constructed. t =(U t ,E t |W t ),in The node of the graph corresponds to user u i Position at time t The eigenvector of denoted by Represents a node and The edges between them represent the interactions between users, and the weights Represents a node and The degree of interaction between t Represents the weight relationship between all users.

[0024] A further improvement of the present invention is that in step 32, based on the multi-spatial user interaction relationship trajectory graph, people within a certain range of the user are selected and the Transformer model is used to obtain local spatial information, and people outside the certain range of the user are selected and the Transformer model is used to obtain global spatial information, including the following steps:

[0025] Step 321: User feature vector Mapping to coordinate space eigenvectors

[0026]

[0027] Then the coordinate space feature vector set of the user at the same time is in Represents user u i Position at time t;

[0028] Step 322: According to the definition of the Tramsformer model, the user's historical movement trajectory features are mapped into three feature vectors: Query, Key, and Value. For user u i The trajectory characteristics at time t are:

[0029]

[0030] where f Q ,f K ,f V is user u i ,i=1,2,…,N shared query, key, value mapping function;

[0031] Step 323: User u i The neighborhood pedestrian set is represented by P(i), which represents user u i There is an interactive relationship with the users in the neighborhood pedestrian set P(i), and the adjacency matrix A t Indicates that, and there is:

[0032]

[0033] in is the adjacency matrix A t The element in distance represents the maximum distance between two users with interactive relationship. If the distance between two users is less than distance, then there is an interactive relationship between them. According to the definition of Tramsformer model, all users with user u i People who have interactive relationships with user u i The impacts Att(i) produced are:

[0034]

[0035] where d k is the dimension of the vector, j∈P(i), and the node and The degree of interaction between use express;

[0036] Step 324: When considering the impact of different moments on the user trajectory, construct an adjacency matrix representing the impact at different moments based on the multi-space user interaction relationship trajectory graph.

[0037]

[0038] According to the adjacency matrix Get time t2 and Interactive Impact on time t1

[0039]

[0040] According to the process of obtaining local information in space, consider the user u who is not in the neighborhood pedestrian set P(i). i The global information in space is obtained by taking into account the influence of

[0041] A further improvement of the present invention is that step 4 constructs a time series user interaction trajectory graph based on the user relationship interaction trajectory graph constructed in step 2 and the user's historical movement trajectory, and extracts the user's time series features through the Transformer model, which specifically includes the following steps:

[0042] Step 41: Construct the user's trajectory features based on the user's historical movement trajectory in Represents user u i Position at time t;

[0043] Step 42: Map the user's trajectory features constructed in step 41 into three feature vectors. For user u i have:

[0044]

[0045] where f Q ,f K ,f V is user u i ,i=1,2,…,N shared query, key, value mapping function;

[0046] Step 43: Calculate user u through the Tramsformer model i The self-attention between the historical trajectories of user u is extracted i The time dimension movement pattern of , and the trajectory characteristics of different users after weighting by the attention mechanism are obtained:

[0047]

[0048] where d k is the dimension of the vector;

[0049] Step 44: Use residual connection to add the original feature vector to obtain the feature output of the time series Tramsformer module;

[0050] Step 45: The larger the time span from the current time t, the better for user u. i The smaller the current trajectory of user u, the time series is divided into two parts. i All historical trajectories before time t extract global time features, user u i Extract local time features from the historical trajectory before time t and fuse the two to get user u i The timing characteristics of .

[0051] A further improvement of the present invention is that the service feature vector and the geographic area feature vector constructed in step 7 are used to calculate the service priority, which specifically includes the following steps:

[0052] Step 71: Use the standard deviation of the two-dimensional random vector to calculate the dispersion degree D of the response service request distribution, d i Indicates services i Request distribution;

[0053] Step 72: Use density clustering algorithm to obtain service request frequency Service resource requirements in Indicates services n In area r j The request frequency, Indicates services n In area r j resource needs;

[0054] Step 73: Establish a service area preference based on the discrete degree of the service request distribution obtained in step 71 and the service area request frequency and service area resource demand obtained in step 72:

[0055]

[0056] in Indicates services i In area r j User preferences, α, β, γ are corresponding weights and α+β+γ=1;

[0057] Step 74: Based on the service area preference obtained in step 73, establish a service area priority judgment index:

[0058]

[0059] in Indicates services i In area r jPriority,

[0060] Services i Overall priority P(s i ) is calculated as follows:

[0061]

[0062] in Indicates services i In area r m The priority of R=(r1,r2,…r m ) represents a geographical area.

[0063] A further improvement of the present invention is that: Step 81, the deep reinforcement learning (DRL) process is modeled as a Markov decision process (MDP). In deep reinforcement learning, the MDP is expressed as (S, A, P, R), where S represents a finite set of possible states of the environment, A is a finite set of actions that the agent can perform, P describes the probability distribution of the environment transitioning to a new state under a given state and action, and R represents the immediate reward obtained by the agent under a given state and action;

[0064] Step 82: Resource status of the current time slot and service migration request usage vector in Represents the kth t The ratio of the remaining bandwidth of a decision time slot to the maximum bandwidth, Indicates services i In the kth t The migration request information for each decision slot includes the user's predicted arrival time, service downtime threshold, source node, target node, and memory size of the service to be migrated;

[0065] Step 83: Set the action space a t Defined as the kth t The service set that starts to migrate in the decision time slot is selected, and a part of the service migration scheme is screened according to the obtained service priority;

[0066] Step 84: At the start of migration, if the migration bandwidth and migration path do not meet the constraints, the service migration fails and a penalty is given. And then continue to decide when to migrate the service. The shorter the service downtime, the greater the reward. The reward function of service migration is:

[0067]

[0068] Where α is a fixed positive number that controls the size of the reward, and ω is a fixed positive number that serves as a penalty for migration failure. is a small positive number that is used to penalize a service for a failed migration attempt;

[0069] Step 85: During DQN model training, the loss function for estimating performance is:

[0070]

[0071] Among them, θ t ,θ t ′ Represents time slot k t The neural network parameters of the Q network and the target Q network, γ is the discount factor, and the loss function is the mean square error between the estimated Q value and the target Q value. The smaller the loss function, the better the model performance evaluation. The parameters of the neural network updated using the gradient descent algorithm are:

[0072]

[0073] in and θ t Represents the parameters of the neural network before and after the Q network is updated, and β is the step size parameter;

[0074] Step 86: Use DQN to determine the migration timing of services in the user prediction mobile scenario. When the user starts to move, predict the user's arrival time, collect service migration information, and obtain service migration requirements. When the user has not reached the next entry node, select the service migration plan with the highest reward based on the current state, and allocate migration bandwidth and migration path for the service. In the time slot between two decision time slots, first check whether the user has reached the next entry node. If so, check whether the service downtime meets the constraints. If the constraints are met, the service migration is successful, otherwise it fails. Then, release the service whose life cycle has expired and release resources, and deploy a new service.

[0075] The beneficial effects of the present invention are:

[0076] The service migration method of the present invention combines the spaces at multiple moments, fully considers the impact of the historical movement trajectories of adjacent users on the target user, and constructs a multi-space user interaction relationship trajectory map.

[0077] At the same time, the present invention constructs a historical trajectory map of the user, extracts the time characteristics of the user's movement trajectory, and improves the accuracy of the user's movement trajectory prediction by fusing the temporal and spatial characteristics. The calculated service priority is combined with information about the user's future movement trajectory and service resource requirements, and service migration decisions are made through reinforcement learning to ensure the user's service experience quality and reduce service costs, thereby meeting the user's low-latency and high-reliability service needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 It is a flow chart of the service migration method of the present invention.

[0079] Figure 2 This is a trajectory prediction framework diagram based on the Tramsformer model of the present invention.

[0080] Figure 3 This is a framework diagram of the deep learning DQN algorithm based on the present invention. DETAILED DESCRIPTION

[0081] The following diagrams illustrate embodiments of the present invention. For clarity, many practical details are included in the following description. However, it should be understood that these practical details are not intended to limit the present invention. In other words, in some embodiments of the present invention, these practical details are not essential.

[0082] like Figure 1-3 As shown, the present invention is a service migration method based on priority and spatiotemporal trajectory prediction, and its overall process is as follows Figure 1 As shown, the specific steps include:

[0083] Step 1: Feature Engineering: Based on the user’s geographic location, construct the user’s feature vector, service and geographic region feature vector as input to the subsequent network.

[0084] In a scenario, the number of users n = 500, the number of edge servers m = 80, and the user's feature vector is constructed based on the user's geographical location. in Represents user u at time t i The longitude, Represents user u at time t i Construct service feature vector S = (s1, s2, ...s n ), construct the geographic region feature vector R = (r1, r2, ... r m ).

[0085] Step 2: Based on the user location feature vector constructed in step 1, construct the user relationship interaction trajectory graph G t =(U t ,E t |W t ),in The node of the graph corresponds to user u i Position at time t The eigenvector represented by Represents a node and The edges between them represent the interactions between users, and the weights Represents a node and The degree of interaction between Represents a node and The degree of interaction between t Represents the weight relationship between all users.

[0086] Step 3: Based on the user relationship interaction trajectory graph constructed in step 2, a multi-space user interaction relationship trajectory graph is constructed, and the interaction features between users are obtained using the Transformer model. Specifically, the following steps are included:

[0087] Step 31: sort the user relationship interaction trajectory graph constructed in step 2 in chronological order, and then construct a multi-space user interaction relationship trajectory graph in a fully connected manner between each node;

[0088] Step 32: Based on the multi-spatial user interaction trajectory graph, select people within a certain range of the user and use the Transformer model to obtain local spatial information. Select people outside the certain range of the user and use the Transformer model to obtain global spatial information. This includes the following steps:

[0089] Step 321: User feature vector Mapping to coordinate space eigenvectors

[0090]

[0091] Then the coordinate space feature vector set of the user at the same time is in Represents user u i Position at time t;

[0092] Step 322: According to the definition of the Tramsformer model, the user's historical trajectory features are mapped into three feature vectors: Query, Key, and Value. For user u i The trajectory characteristics at time t are:

[0093]

[0094] where f Q ,f K ,f V is user u i ,i=1,2,…,N shared query, key, value mapping function;

[0095] Step 323: User u i The neighborhood pedestrian set is represented by P(i), which represents user u i There is an interactive relationship with the users in the neighborhood pedestrian set P(i), and the adjacency matrix At Indicates that, and there is:

[0096]

[0097] in is the adjacency matrix A t The element in distance represents the maximum distance between two users with interactive relationship. If the distance between two users is less than distance, then there is an interactive relationship between them. According to the definition of Tramsformer model, all users with user u i People who have interactive relationships with user u i The impacts Att(i) produced are:

[0098]

[0099] where d k is the dimension of the vector, j∈P(i), and the node With node The degree of interaction between use express;

[0100] Step 324: When considering the impact of different moments on the user trajectory, construct an adjacency matrix representing the impact at different moments based on the multi-space user interaction relationship trajectory graph.

[0101]

[0102] According to the adjacency matrix Get the t2 time and node Interactive Impact on time t1

[0103]

[0104] Thus, we can get the local information in space. According to the process of obtaining local information in space, we consider the user who is not in the neighborhood pedestrian set P(i) for user u. i The global information in space is obtained by taking into account the influence of

[0105] Step 33: Combine the local information obtained in step 32 with the global information to obtain information about how the user is affected by other users in the current scene, and obtain the user's spatial features;

[0106] Step 4: Based on the user relationship interaction trajectory graph constructed in step 2, a time series user interaction relationship trajectory graph is constructed according to the user's historical movement trajectory. The user's time series features are extracted through the Transformer model. The specific steps include the following:

[0107] Step 41: Construct the user's trajectory features based on the user's historical movement trajectory in Represents user u i Position at time t;

[0108] Step 42: Map the user's trajectory features constructed in step 41 into three feature vectors. For user u i have:

[0109]

[0110] where f Q ,f K ,f V is user u i ,i=1,2,…,N shared query, key, value mapping function;

[0111] Step 43: Calculate user u through the Tramsformer model i The self-attention between the historical trajectories of user u is extracted i The time dimension movement pattern of , and the trajectory characteristics of different users after weighting by the attention mechanism are obtained:

[0112]

[0113] where d k is the dimension of the vector;

[0114] Step 44: Use residual connection to add the original feature vector to obtain the feature output of the time series Tramsformer module;

[0115] Step 45: The larger the time span from the current time t, the better for user u. i The smaller the current trajectory of user u, the time series is divided into two parts. i All historical trajectories before time t extract global time features, user u i Extract local time features from the historical trajectory before time t and fuse the two to get user u i The timing characteristics of .

[0116] Step 5: Based on the spatial features of the user obtained in step 33 and the temporal features of the user obtained in step 4, the user's movement trajectory is predicted based on the user's spatiotemporal features: specifically:

[0117] Step 51: Concatenate the user's spatial features and temporal features to obtain the final feature vector;

[0118] Step 52: Use the MLP decoder to convert the feature vector obtained in step 51 into two-dimensional coordinates to obtain the user's position at the next moment. in Represents user u at time t i The longitude, Represents user u at time t i Latitude;

[0119] Step 53: Based on the predicted user movement trajectory, predict the time when the user arrives at the corresponding location;

[0120] Step 6: Construct service feature vector S = (s1, s2, ...s n ) and geographic region feature vector R=(r1,r2,…r m );

[0121] The service feature vector and geographic area feature vector constructed in step 7 are used to calculate the service priority, which specifically includes the following steps:

[0122] Step 71: Use the standard deviation of the two-dimensional random vector to calculate the dispersion degree D of the response service request distribution, d i Indicates services i Request distribution;

[0123] Step 72: Use density clustering algorithm to obtain service request frequency Service resource requirements in Indicates services n In area r j The request frequency, Indicates services n In area r j resource needs;

[0124] Step 73: Establish a service area preference based on the discrete degree of the service request distribution obtained in step 71 and the service area request frequency and service area resource demand obtained in step 72:

[0125]

[0126] in Indicates services i In area r j User preferences, α, β, γ are corresponding weights and α+β+γ=1;

[0127] Step 74: Based on the service area preference obtained in step 73, establish a service area priority judgment index:

[0128]

[0129] in Indicates services i In area r j Priority,

[0130] Services i Overall priority P(s i ) is calculated as follows:

[0131]

[0132] in Indicates services i In area r m The priority of R=(r1,r2,…r m ) represents a geographical area.

[0133] Step 8: Based on the service priority calculated in step 7 and the user's movement trajectory predicted in step 5, a service migration decision is made through a DQN (deep Q-network). Specifically:

[0134] Step 81: Model the deep reinforcement learning (DRL) process as a Markov decision process (MDP). In deep reinforcement learning, an MDP is represented as (S, A, P, R), where S represents a finite set of possible states of the environment, A is a finite set of actions that the agent can perform, P describes the probability distribution of the environment transitioning to a new state given a state and action, and R represents the immediate reward obtained by the agent given a state and action.

[0135] Step 82: Resource status of the current time slot and service migration request usage vector in Represents the kth t The ratio of the remaining bandwidth of a decision time slot to the maximum bandwidth, Indicates services i The migration request information at the tth decision time slot includes the user's predicted arrival time, service downtime threshold, source node, target node, and memory size of the service to be migrated;

[0136] Step 83: Set the action space a t Defined as the kth t The service set that starts to migrate in the decision time slot is selected, and a part of the service migration scheme is screened according to the obtained service priority;

[0137] Step 84: At the start of migration, if the migration bandwidth and migration path do not meet the constraints, the service migration fails and a penalty is given. And then continue to decide when to migrate the service. The shorter the service downtime, the greater the reward. The reward function of service migration is:

[0138]

[0139] Where α is a fixed positive number that controls the size of the reward, and ω is a fixed positive number that serves as a penalty for migration failure. is a small positive number that is used to penalize a service for a failed migration attempt;

[0140] Step 85: During DQN model training, the loss function for estimating performance is:

[0141]

[0142] Among them, θ t ,θ′ t Represents time slot k t The neural network parameters of the Q network and the target Q network, γ is the discount factor, and the loss function is the mean square error between the estimated Q value and the target Q value. The smaller the loss function, the better the model performance evaluation. The parameters of the neural network updated using the gradient descent algorithm are:

[0143]

[0144] in and θ t Represents the parameters of the neural network before and after the Q network is updated, and β is the step size parameter;

[0145] Step 86: Use DQN to determine the migration timing of services in the user prediction mobile scenario. When the user starts to move, predict the user's arrival time, collect service migration information, and obtain service migration requirements. When the user has not reached the next entry node, select the service migration plan with the highest reward based on the current state, and allocate migration bandwidth and migration path for the service. In the time slot between two decision time slots, first check whether the user has reached the next entry node. If so, check whether the service downtime meets the constraints. If the constraints are met, the service migration is successful, otherwise it fails. Then, release the service whose life cycle has expired and release resources, and deploy a new service.

[0146] In step 9, if the service does not migrate, the cloud or edge server exchanges data with the user; otherwise, the data is exchanged with the edge server after the service migration.

[0147] The service migration method of this invention predicts user movement trajectories by mining user spatial interactions and the impact of historical trajectories on future trajectories. Simultaneously, migration decisions are made based on the priority of the services required by the user, thereby meeting the user's needs for low-latency, high-reliability services.

[0148] The foregoing is merely an embodiment of the present invention and is not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.

Claims

1. A service migration method based on priority and spatiotemporal trajectory prediction, characterized by: The service migration method comprises the following steps: Step 1: Construct a user location feature vector based on the user's geographical location; Step 2: Based on the user location feature vector constructed in step 1, a user relationship interaction trajectory map is constructed; Step 3: Based on the user relationship interaction trajectory graph constructed in step 2, a multi-space user interaction relationship trajectory graph is constructed, and the interaction features between users are obtained using the Transformer model. Specifically, the following steps are included: Step 31: sort the user relationship interaction trajectory graph constructed in step 2 in chronological order, and then construct a multi-space user interaction relationship trajectory graph in a fully connected manner between each node; Step 32: Based on the multi-space user interaction relationship trajectory diagram constructed in step 31, select people within a certain range of the user and use the Transformer model to obtain local spatial information. Select people outside the certain range of the user and use the Transformer model to obtain global spatial information. Step 33: Combine the local information obtained in step 32 with the global information to obtain information about how the user is affected by other users in the current scene, and obtain the user's spatial features; Step 4: Based on the user relationship interaction trajectory graph constructed in step 2, a time series user interaction relationship trajectory graph is constructed according to the user's historical movement trajectory. The user's time series features are extracted through the Transformer model. Step 5: Based on the spatial features of the user obtained in step 33 and the temporal features of the user obtained in step 4, the user's movement trajectory is predicted based on the user's spatiotemporal features: specifically: Step 51: Concatenate the user's spatial features and temporal features to obtain the final feature vector; Step 52: Use the MLP decoder to convert the feature vector obtained in step 51 into two-dimensional coordinates to obtain the user's position at the next moment. in Represents user u at the next moment i The longitude, Represents user u at the next moment i Latitude; Step 53: Based on the predicted user movement trajectory, predict the time when the user arrives at the corresponding location; Step 6: Construct service feature vector S = (s1, s2, ...s n ) and geographic region feature vector R=(r1,r2,…r m ); Step 7: Calculate the service priority based on the service feature vector and the geographic area feature vector constructed in step 6; Step 8: Based on the service priority calculated in step 7 and the user's movement trajectory predicted in step 5, a service migration decision is made through a DQN (deep Q-network); In step 9, if the service does not migrate, the cloud or edge server exchanges data with the user; otherwise, the data is exchanged with the edge server after the service migration.

2. The service migration method based on priority and spatiotemporal trajectory prediction according to claim 1, characterized in that: In step 1, the user location feature vector is constructed based on the user's geographical location in Represents user u at time t i The longitude, Represents user u at time t i The latitude.

3. The service migration method based on priority and spatiotemporal trajectory prediction according to claim 1, characterized in that: In step 2, based on the user location feature vector constructed in step 1, a user relationship interaction trajectory graph G is constructed. t =(U t ,E t |W t ),in is the node of the graph, corresponding to user u i User location feature vector at time t Representation node and The edges between them represent the interactions between users, and the weights Representation node and The degree of interaction between Representation node and The degree of interaction between t Represents the weight relationship between all users.

4. The service migration method based on priority and spatiotemporal trajectory prediction according to claim 3, characterized in that: In step 32, based on the multi-spatial user interaction relationship trajectory graph, people within a certain range of the user are selected and the Transformer model is used to obtain local spatial information. People outside the certain range of the user are selected and the Transformer model is used to obtain global spatial information. The steps include: Step 321: Mapping to coordinate space eigenvectors Then the coordinate space feature vector set of the user at the same time is Step 322: According to the definition of the Tramsformer model, the user's historical trajectory features are mapped into three feature vectors: Query, Key, and Value. For user u i The trajectory characteristics at time t are: where f Q ,f K ,f V is user u i ,i=1,2,…,N shared query, key, value mapping function; Step 323: User u i The neighborhood pedestrian set is represented by P(i), which represents user u i There is an interactive relationship with the users in the neighborhood pedestrian set P(i), and the adjacency matrix A t Indicates that, and there is: in is the adjacency matrix A t The element in distance represents the maximum distance between two users with interactive relationship. If the distance between two users is less than distance, then there is an interactive relationship between them. According to the definition of Tramsformer model, all users with user u i People who have interactive relationships with user u i The impacts Att(i) produced are: where d k is the dimension of the vector, j∈P(i), and the node With node The degree of interaction between use express; Step 324: When considering the impact of different moments on the user trajectory, construct an adjacency matrix representing the impact at different moments based on the multi-space user interaction relationship trajectory graph. According to the adjacency matrix Get the time t2 and the node Interactive Impact on time t1 Thus, we can get the local information in space. According to the process of obtaining local information in space, we consider the user u who is not in the neighborhood pedestrian set P(i). i The influence of , we can get the global information in space.

5. The service migration method based on priority and spatiotemporal trajectory prediction according to claim 1, characterized in that: Step 4: Based on the user relationship interaction trajectory graph constructed in step 2, a time series user interaction relationship trajectory graph is constructed according to the user's historical movement trajectory. The user's time series features are extracted through the Transformer model. The specific steps include the following: Step 41: Construct the user's trajectory features based on the user's historical movement trajectory in represents the location of user i at time t; Step 42: Map the user's trajectory features constructed in step 41 into three feature vectors. For user u i have: where f Q ,f K ,f V is user u i ,i=1,2,…,N shared query, key, value mapping function; Step 43: Calculate user u through the Tramsformer model i The self-attention between the historical trajectories of user u is extracted i The time dimension movement pattern of , and the trajectory characteristics of different users after weighting by the attention mechanism are obtained: where d k is the dimension of the vector; Step 44: Use residual connection to add the original feature vector to obtain the feature output of the time series Tramsformer module; Step 45: The larger the time span from the current time t, the better for user u. i The smaller the current trajectory of user u, the time series is divided into two parts. i All historical trajectories before time t extract global time features, user u i Extract local time features from the historical trajectory before time t and fuse the two to get user u i The timing characteristics of .

6. The service migration method based on priority and spatiotemporal trajectory prediction according to claim 1, characterized in that: The service feature vector and geographic area feature vector constructed in step 7 are used to calculate the service priority, which specifically includes the following steps: Step 71: Use the standard deviation of the two-dimensional random vector to calculate the dispersion degree D of the response service request distribution, d i Indicates services i Request distribution; Step 72: Use density clustering algorithm to obtain service request frequency Service resource requirements in Indicates services n In area r j The request frequency, Indicates services n In area r j resource needs; Step 73: Establish a service area preference based on the discrete degree of the service request distribution obtained in step 71 and the service area request frequency and service area resource demand obtained in step 72: in Indicates services i In area r j User preferences, α, β, γ are corresponding weights and α+β+γ=1; Step 74: Based on the service area preference obtained in step 73, establish a service area priority judgment index: in Indicates services i In area r j Priority, Services i Overall priority P(s i ) is calculated as follows: in Indicates services i In area r m The priority of R=(r1,r2,…r m ) represents a geographical area.

Citation Information

Patent Citations

  • Distributed service migration method for mobile edge computing

    CN113973113A

  • Multi-user service migration method based on location privacy perception

    CN116634419A