Service migration method and system based on user trajectory prediction
Through the STG-Informer model, the user's future trajectory is predicted and the service migration strategy is dynamically adjusted, which solves the problems of low accuracy and poor real-time service migration in the mobile edge computing environment, achieves service continuity and low latency, and improves user experience and edge computing resource utilization.
Patent Information
- Application Number
- CN202510322366.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-19
AI Technical Summary
In a mobile edge computing environment, high user mobility leads to low accuracy of service migration, poor real-time performance, insufficient service continuity and large latency.
By collecting the user's historical long-term trajectory data and short-term trajectory data, the user's future trajectory is predicted using the STG-Informer model, and dynamically determine whether service migration is needed based on the prediction results. If needed, select the optimal target migration node and obtain the optimal migration path to ensure service continuity and low latency.
Improve the accuracy and real-time of service migration, ensure service continuity and low latency, thereby improving user experience and optimizing the utilization of edge computing resources.
Smart Images

Figure CN119854303A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of service migration in a mobile edge environment, and in particular to a service migration method and system based on user trajectory prediction. Background Art
[0002] With the rapid development of MEC (Mobile Edge Computing) technology, users' demand for real-time computing and low-latency services is increasing. Traditional cloud computing models often fail to meet the needs of efficient service delivery, especially in mobile environments, where changes in user locations, network conditions, and edge server resources pose huge challenges. Traditional service migration methods mainly rely on static resource management and path planning strategies, ignoring user dynamic behavior and environmental changes. However, in practical applications, factors such as user trajectories, speeds, and mobility patterns often change dynamically, and these changes have an important impact on service migration decisions and path selection. In order to better meet the needs of mobile users, technologies such as intelligent trajectory prediction, trust assessment, and path optimization have gradually become the key to solving this problem.
[0003] The publication number is CN114554420A, and the name is a method for edge computing service migration based on trajectory prediction, which includes: determining the predicted trajectory of the user according to the user's trajectory data and location data; confirming the historical trajectory deviation according to the predicted trajectory and the actual trajectory; then determining the target predicted trajectory according to the historical trajectory deviation; determining the list of candidate base stations according to the target predicted trajectory; obtaining the optimal migration base station by calculating the comprehensive matching degree of each base station in the candidate base station list; determining the optimal service migration path by calculating the path score of the optimal migration base station; and realizing real-time update of the optimal migration base station. This method has significant advantages in reducing user waiting time and dynamic updating. However, adjusting the predicted trajectory by the historical trajectory deviation involves a large amount of calculation, including trajectory prediction, comprehensive matching degree calculation and path score calculation, which may increase the calculation burden of the system, especially when there are a large number of users or a large number of base stations, resulting in certain deficiencies in trajectory prediction accuracy. Summary of the invention
[0004] In order to solve the technical problems of low accuracy, poor real-time performance, insufficient service continuity and large delay in service migration in scenarios with high user mobility in edge computing environments, the present invention provides a service migration method and system based on user trajectory prediction to improve the accuracy and real-time performance of service migration, ensure service continuity and low delay, thereby improving user experience and optimizing the utilization of edge computing resources.
[0005] In a first aspect, a service migration method based on user trajectory prediction is provided, comprising: Collect urban road network data, user historical long-term trajectory data, and user short-term trajectory data; Predicting the user's future trajectory through the STG-Informer (Spatio-Temporal Graph-Informer, spatio-temporal graph attention trajectory prediction) model based on the collected historical long-term trajectory data of the user and the short-term trajectory data of the user; Determining whether service migration is required based on the predicted future trajectory of the user; If migration is required, the optimal target migration node and the optimal migration path are selected according to the user's future trajectory, and the service is migrated in real time; otherwise, as the user moves, the real-time moving trajectory points are incorporated into the user's short-term trajectory data, and the user's future trajectory is re-predicted to determine whether service migration is required.
[0006] Furthermore, predicting the user's future trajectory through the STG-Informer model based on the collected historical long-term trajectory data of the user and the short-term trajectory data of the user includes: The user's historical long-term trajectory data and the user's short-term trajectory data are preprocessed, and the trajectory point format is unified. The trajectory point is represented as: ; in, Expressed as Track points, is the unique identifier of the trajectory point, is the timestamp of the trajectory point, are the longitude and latitude of the trajectory points respectively; The STG-Informer model is built based on the graph convolutional network, the Informer model, and the GRU (Gated Recurrent Unit) unit; Based on the user's short-term trajectory data, the STG-Informer model is repeatedly used to predict the trajectory point at the next moment until the future is predicted. The trajectory point at the moment to obtain the user's future trajectory .
[0007] Furthermore, the STG-Informer model includes long-term preference prediction, short-term intention prediction, and fusion of long-term preference prediction and short-term intention prediction, including: The long-term preference position vector of the user that captures the user's historical long-term trajectory data is captured using a graph convolutional network ; Use the Informer model self-attention mechanism to obtain the user's short-term intention position vector ; Build a preference factor adjustment model based on GRU units to obtain preference factors that dynamically adjust long-term preferences and short-term intentions ; Based on the preference factor obtained Fusion of the long-term preference position vector and the short-term intention position vector Get the predicted position vector , the calculation formula is: ; in, is the predicted position vector, is the preference factor, and .
[0008] Furthermore, the long-term preference position vector of the user that captures the historical long-term trajectory data of the user using the graph convolutional network ,include: Construct an adjacency matrix based on the user's historical long-term trajectory data , initialize the adjacency matrix weight relationship, according to the adjacency matrix Build a location map , expressed as: ; in, It is the set of trajectory points in the user's historical long-term trajectory data; Based on the time intervals of different trajectory points in the user's historical long-term trajectory data and the frequency of access to the trajectory points To update the adjacency matrix The weight in is calculated as: ;
[0009] in, is the adjacency matrix Mid-track point and The weight between For trajectory points and The time interval between For trajectory points and The access frequency between is the time weight attenuation coefficient, which is used to control the influence of the time interval; Based on the user's historical long-term trajectory data, a graph convolutional network is used to extract the location graph Extract spatial dependencies, capture users’ long-term preferences for specific locations, and obtain high-dimensional representations of long-term locations. The calculation formula is: ; in, For graph convolutional network The node feature matrix of the layer, is the degree matrix of the node, is the adjacency matrix, For the The trainable weight matrix of the layer, is the Sigmoid function; Based on the high-dimensional representation of the long-term position obtained, the user's long-term preference position vector is obtained through average pooling operation. , the calculation formula is: ; in, It is the final feature representation after graph convolution.
[0010] Furthermore, the Informer model self-attention mechanism is used to obtain the user's short-term intention position vector ,include: Use the Informer self-attention mechanism to process the short-term trajectory data , by calculating the correlation between each time step, the user's local behavior pattern is captured. The calculation formula is: ; in, are query matrix, key matrix and value matrix respectively, is the dimension of the key vector, is the transposed matrix of the key matrix, is the normalization function.
[0011] Furthermore, the preference factor adjustment model is constructed based on the GRU unit to obtain the preference factors for dynamically adjusting long-term preferences and short-term intentions. ,include: Based on the double-layer GRU unit, a preference factor adjustment model is constructed, and the long-term preference position vector , short-term intention position vector and Behavioral Volatility Index As input, it is represented as: , ; in, , is the time step number, representing the last time point of the sequence, is the input dimension for each time step, is the standard deviation of the time intervals between trajectory points, is the mean time interval of trajectory points; First layer GRU input , output hidden state , the calculation formula is: ; in, is the first layer of GRU units, and the internal mechanism of GRU includes reset gate and update gate, and , is the number of time steps, is the dimension of the hidden state of the first layer GRU unit; The second layer GRU input is , extract the output status Medium time steps The hidden state of , the calculation formula is: ; ; in, , is the second layer GRU unit, is the number of time steps, is the dimension of the hidden state of the second layer GRU unit; The Input the fully connected layer for mapping to obtain the preference factor , the calculation formula is: ; in, , is the hidden state in the fully connected layer The weight matrix of is the dimension of the hidden state of the second layer GRU unit, is the hidden state in the fully connected layer The bias term, is the Sigmoid function.
[0012] Furthermore, the STG-Informer model is repeatedly used to predict the trajectory point at the next moment based on the user's short-term trajectory data until the future The trajectory point at the moment to obtain the user's future trajectory ,include: The user's short-term trajectory data and the user's historical long-term trajectory data are input into the STG-Informer model to obtain the predicted position vector at the next moment. ; Use a fully connected layer to transform the predicted position vector Transform the mapping, and then use the normalization function to take the trajectory point with the highest probability as the trajectory point at the next moment. The calculation formula is: ; in, Predicted position vector in the fully connected layer The weight matrix of Predicted position vector in the fully connected layer The bias term, is the normalization function; The trajectory point at the next moment is added to the short-term trajectory data, and the trajectory at the next moment is predicted repeatedly until the future The trajectory point at the moment to obtain the user's future trajectory , expressed as: ; in, To predict the future The trajectory point of time.
[0013] Furthermore, the future trajectory of the user is calculated based on the future trajectory of the user. The distance between the current geographic location and the edge server used by the current service is used to determine whether service migration is required, including: Calculate the future trajectory of the user based on the prediction The distance between the trajectory point at the moment and the edge server used by the service at the current moment , and compare the distance Communication range with edge servers The size is calculated as: ; ; ; ; in, is the radius of the Earth, For the future The longitude and latitude of the user's geographic location at the moment, are the longitude and latitude of the geographical location of the edge server used by the service at the current moment, The arc latitude of the user's future trajectory point, is the latitude of the edge server in radians, The arc longitude of the user's future trajectory point, is the longitude in radians of the edge server, is the latitude and arc difference between the user's future trajectory point and the edge server, The longitude difference in radians between the user's future trajectory point and the edge server; Determine whether service migration is necessary. > , it means that the user has moved away from the current edge server and needs service migration. , it means that the user is still within the coverage of the current edge server and does not need to migrate the service.
[0014] Furthermore, selecting the optimal target migration node and obtaining the optimal migration path according to the future trajectory of the user includes: Based on the predicted future trajectory of the user The trajectory point at the time obtains the available edge servers around and obtains the set of edge servers to be migrated; Based on the set of edge servers to be migrated, selecting an edge server with the largest comprehensive reputation value as the optimal target migration node; Setting a reputation threshold for all available edge servers near the future trajectory of the user, and forming an intermediate edge server list with edge servers greater than the reputation threshold; A graph network is constructed based on the intermediate edge server list to obtain the best migration path through a graph search algorithm.
[0015] Further, the selecting the edge server with the largest comprehensive reputation value includes: Calculate the comprehensive reputation of the edge server based on the communication transmission delay, load balancing, available memory resources, and effective service range of the edge server , the calculation formula is: ; in, Load Balancing , available memory resources , Communication transmission delay , Effective service scope The weight coefficient of .
[0016] Furthermore, the step of constructing a graph network based on the intermediate edge server list and obtaining an optimal migration path through a graph search algorithm includes: The edge servers in the intermediate edge server list are used as graph nodes, and the transmission delay between edge servers is used as the weight of the edge. The graph search algorithm is used to calculate an optimal migration path. , the calculation formula is: ; ; in, For edge The transmission delay of The transmission delay between the edge servers at both ends, To serve the migration path, The intermediate edge server list The constructed graph network, The serial number is The edge server, The first Edge servers, For edge servers bandwidth, For edge servers The number of users who have logged in.
[0017] Furthermore, the real-time migration of services also includes: The service in the edge server currently connected by the user is migrated to the optimal target migration node along the obtained optimal migration path.
[0018] In the second aspect, a service migration system based on user historical trajectory and road network matching is provided, including: Data collection module, model building module, future trajectory prediction module, and service migration module; The data collection module is used to collect urban road network data, user historical long-term trajectory data and user short-term trajectory data; The model building module is used to build the STG-Informer model and use the historical trajectory data in the data collection module to train and optimize the STG-Informer model; The future trajectory prediction module is used to predict the user's future trajectory based on the STG-Informer model in the model construction module according to the user's historical long-term trajectory data and the user's short-term trajectory data in the data collection module; The service migration module is used to determine whether service migration is required based on the future trajectory of the user predicted by the future trajectory prediction module. If migration is required, the optimal target migration node is selected and the optimal migration path is obtained to migrate the service in real time. Otherwise, as the user moves, the trajectory point is incorporated into the user's short-term trajectory data in the data collection module, and the user's future trajectory is re-predicted to determine whether service migration is required.
[0019] Furthermore, the service migration module includes a service migration judgment submodule, an optimal target migration node selection submodule, an optimal migration path selection submodule, and a real-time service migration submodule; The service migration judgment submodule is used to calculate the distance between the geographical location at the future k moments and the geographical location at the current moment according to the future trajectory of the user predicted by the future trajectory prediction module, and judge whether service migration is needed; The optimal target migration node selection submodule is used to select the optimal target migration node according to the future trajectory of the user predicted by the future trajectory prediction module; The optimal migration path selection submodule is used to select the optimal migration path according to the future trajectory of the user predicted by the future trajectory prediction module; The real-time service migration submodule is used to migrate the service in the edge server currently connected by the user to the optimal target migration node obtained by the optimal target migration node selection submodule along the optimal migration path obtained by the optimal migration path selection submodule.
[0020] The beneficial effects of the present invention are:
[0021] 1. The present invention provides a service migration method based on user trajectory prediction. The preference factor adjustment model constructed by the GRU unit can dynamically adjust the user's long-term preferences and short-term intentions, so that the trajectory prediction is more in line with the user's real-time behavior pattern.
[0022] 2. The present invention provides a service migration method based on user trajectory prediction, which accurately predicts the user's future trajectory through the STG-Informer model, ensuring that the user is always within the coverage of the edge server during the movement process, avoiding service interruption caused by the user being away from the current edge server, thereby improving service continuity and user experience.
[0023] 3. The present invention provides a service migration method based on user trajectory prediction. By comprehensively considering the communication transmission delay, load balancing, available memory resources, and effective service range factors of the edge server, the edge server with the largest comprehensive reputation value is selected as the optimal target migration node. This method can effectively balance the load of the edge server and avoid the situation where some nodes are overloaded while other node resources are idle, thereby optimizing the utilization of edge computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flowchart diagram of a service migration method based on user trajectory prediction provided by an embodiment of the present invention.
[0025] Figure 2 It is a schematic diagram of the STG-Informer model structure provided by an embodiment of the present invention.
[0026] Figure 3This is a schematic diagram of a service migration system based on user trajectory prediction provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The exemplary embodiments of the present invention will be described in more detail below in conjunction with the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0028] With the rapid development of mobile Internet and the Internet of Things, users' location information and service needs are becoming more dynamic and complex. Traditional service deployment methods often have difficulty adapting to such dynamic changes, resulting in increased service delays and reduced user experience. Especially in edge computing environments, the real-time and responsiveness of services are critical. However, due to the location changes caused by user mobility, service migration becomes a key issue. How to accurately predict user trajectories and perform efficient service migration based on the prediction results has become a challenge that needs to be solved urgently.
[0029] Based on the above problems, the technical solution of the present invention collects historical long-term and short-term trajectory data of users, uses the STG-Informer model to predict the future trajectory of users, and dynamically determines whether service migration is needed based on the prediction results. If migration is required, the optimal target migration node and the optimal migration path are selected to ensure service continuity and low latency. At the same time, by updating user trajectory data in real time, prediction and migration decisions are continuously optimized to adapt to dynamically changing user behaviors and environments.
[0030] Example 1
[0031] A service migration method based on user trajectory prediction according to Embodiment 1 of the present invention includes: Collect urban road network data, user historical long-term trajectory data and user short-term trajectory data; predict the user's future trajectory through the STG-Informer model based on the collected user's historical long-term trajectory data and the user's short-term trajectory data; determine whether service migration is required based on the predicted user's future trajectory; if migration is required, select the optimal target migration node and obtain the optimal migration path according to the user's future trajectory, and migrate the service in real time; otherwise, merge the trajectory points into the user's short-term trajectory data as the user moves, re-predict the user's future trajectory and determine whether service migration is required.
[0032] Specifically, Figure 1 A schematic flow chart of a service migration method based on user trajectory prediction in Embodiment 1 of the present invention is shown, including: S1, collect urban road network data, user historical long-term trajectory data and user short-term trajectory data; For example, in the embodiment of the present invention, the urban road network map is based on Shanghai, with a longitude range of 120°52′ to 122°16′ east longitude and a latitude range of 30°42′ to 31°48′ north latitude. The user's historical trajectory data records a trajectory point every 30 seconds, for example: “[{31.23041,121.47370, 2021-06-19T08:00:00Z},{ 31.23150,121.47485,2021-06-19T08:00:30Z},{31.23260,121.47600,2021-06-19T08:01:00Z}]”; Deleting duplicate track points includes: If duplicate track points appear during the track recording process, for example, when the track points are recorded every 30 seconds, the user stops at the same location, and the latitude and longitude values of consecutive track points are the same, then these duplicate data are removed and the most representative track points are retained. For example, if the position is almost the same for two consecutive minutes, the second and subsequent track points can be regarded as duplicates and deleted. Removing abnormal data includes: Abnormal data includes that the user's track points jump too much, or the track points are located outside Shanghai. Timestamps are uniformly formatted, including: Timestamps of all track points are uniformly formatted in ISO 8601 format, such as 2021-02-06T08:04:12Z.
[0033] S2. Predicting the user's future trajectory through the STG-Informer model based on the collected historical long-term trajectory data of the user and the short-term trajectory data of the user; Furthermore, the step S2 predicts the user's future trajectory through the STG-Informer model based on the collected historical trajectory data and the user's short-term trajectory data, including: S2.1. Preprocess the historical long-term trajectory data of the user and the short-term trajectory data of the user, and unify the trajectory point format. The trajectory point is represented as: ; in, Expressed as Track points, is the unique identifier of the trajectory point, is the timestamp of the trajectory point, are the longitude and latitude of the trajectory points respectively; S2.2. Construct the STG-Informer model based on graph convolutional network, Informer model and GRU unit; S2.3, based on the user's short-term trajectory data, repeatedly predict the trajectory point at the next moment through the STG-Informer model until the future is predicted The trajectory point at the moment to obtain the user's future trajectory .
[0034] Furthermore, the STG-Informer model described in step S2.2 includes long-term preference prediction, short-term intention prediction, and fusion of long-term preference prediction and short-term intention prediction, including: S2.2.1. Using graph convolutional networks to capture the user's long-term preference position vector of the user's historical long-term trajectory data ; S2.2.2. Use the Informer model self-attention mechanism to obtain the user's short-term intention position vector ; S2.2.3. Build a preference factor adjustment model based on GRU units to obtain preference factors that dynamically adjust long-term preferences and short-term intentions ; S2.2.4, based on the obtained preference factor, the long-term preference and short-term intention are integrated to obtain the predicted position vector , the calculation formula is: ; in, is the predicted position vector, is the preference factor, and .
[0035] Furthermore, the long-term preference position vector of the user of the historical long-term trajectory data of the user captured by the graph convolutional network in step S2.2.1 ,include: Construct an adjacency matrix based on the user's historical long-term trajectory data , initialize the adjacency matrix weight relationship, according to the adjacency matrix Build a location map , expressed as: ; in, It is the set of trajectory points in the user's historical long-term trajectory data; Based on the time intervals of different trajectory points in the user's historical long-term trajectory data and the frequency of access to the trajectory points To update the adjacency matrix The weight in is calculated as: ; in, is the adjacency matrix Mid-track point and The weight between For trajectory points and The time interval between For trajectory points and The access frequency between is the time weight attenuation coefficient, which is used to control the influence of the time interval; Based on the user's historical long-term trajectory data, a graph convolutional network is used to extract the location graph Extract spatial dependencies, capture users’ long-term preferences for specific locations, and obtain high-dimensional representations of long-term locations. The calculation formula is: ; in, For graph convolutional network The node feature matrix of the layer, is the degree matrix of the node, is the adjacency matrix, For the The trainable weight matrix of the layer, is the Sigmoid function; Based on the high-dimensional representation of the long-term position obtained, the user's long-term preference position vector is obtained through average pooling operation. , the calculation formula is: ; in, It is the final feature representation after graph convolution.
[0036] Furthermore, the user's short-term intention position vector is obtained by using the self-attention mechanism of the Informer model as described in step S2.2.2 ,include: Use the Informer self-attention mechanism to process the short-term trajectory data , by calculating the correlation between each time step, the user's local behavior pattern is captured. The calculation formula is: ; in, are query matrix, key matrix and value matrix respectively, is the dimension of the key vector, is the transposed matrix of the key matrix, is the normalization function.
[0037] Furthermore, the preference factor adjustment model based on the GRU unit described in step S2.2.3 is constructed to obtain the preference factor for dynamically adjusting long-term preference and short-term intention ,include: Based on the double-layer GRU unit, a preference factor adjustment model is constructed, and the long-term preference position vector , short-term intention position vector and Behavioral Volatility Index As input, it is represented as: , ; in, , is the time step number, representing the last time point of the sequence, is the input dimension for each time step, is the standard deviation of the time intervals between trajectory points, is the mean time interval of trajectory points; First layer GRU input , output hidden state , the calculation formula is: ; in, is the first layer of GRU units, and the internal mechanism of GRU includes reset gate and update gate, and , is the number of time steps, is the dimension of the hidden state of the first layer GRU unit; The second layer GRU input is , extract the output status Medium time steps The hidden state of , the calculation formula is: ; ; in, , is the second layer GRU unit, is the number of time steps, is the dimension of the hidden state of the second layer GRU unit; The Input the fully connected layer for mapping to obtain the preference factor , the calculation formula is: ; in, , is the hidden state in the fully connected layer The weight matrix of is the dimension of the hidden state of the second layer GRU unit, is the hidden state in the fully connected layer The bias term, is the Sigmoid function.
[0038] Furthermore, in step S2.3, the STG-Informer model is repeatedly used to predict the trajectory point at the next moment based on the user's short-term trajectory data until the future trajectory point is predicted. The trajectory point at the moment to obtain the user's future trajectory ,include: The user's short-term trajectory data and the user's historical long-term trajectory data are input into the STG-Informer model to obtain the predicted position vector at the next moment. ; Use a fully connected layer to transform the predicted position vector Transform the mapping, and then use the normalization function to take the trajectory point with the highest probability as the trajectory point at the next moment. The calculation formula is: ; in, Predicted position vector in the fully connected layer The weight matrix of Predicted position vector in the fully connected layer The bias term, is the normalization function; The trajectory point at the next moment is added to the short-term trajectory data, and the trajectory at the next moment is predicted repeatedly until the future The trajectory point at the moment to obtain the user's future trajectory , expressed as: ; in, To predict the future The trajectory point of time.
[0039] S3. judging whether service migration is needed based on the predicted future trajectory of the user; Specifically, the step S3 of determining whether service migration is required based on the predicted future trajectory of the user includes: Calculate the future trajectory of the user based on the prediction The distance between the trajectory point at the moment and the edge server used by the service at the current moment , and compare the distance Communication range with edge servers The size is calculated as: ; ; ; ; in, is the radius of the Earth, For the future The longitude and latitude of the user's geographic location at the moment, are the longitude and latitude of the geographical location of the edge server used by the service at the current moment, The arc latitude of the user's future trajectory point, The edge server's latitude in radians, The arc longitude of the user's future trajectory point, is the longitude in radians of the edge server, is the latitude and arc difference between the user's future trajectory point and the edge server, The longitude difference in radians between the user's future trajectory point and the edge server; Determine whether service migration is necessary. > , it means that the user has moved away from the current edge server and needs service migration. , it means that the user is still within the coverage of the current edge server and does not need to migrate the service.
[0040] S4. If migration is required, the optimal target migration node and the optimal migration path are selected according to the future trajectory of the user, and the service is migrated in real time; Furthermore, the step S4 of selecting the optimal target migration node and obtaining the optimal migration path according to the future trajectory of the user includes: S4.1, based on the predicted future trajectory of the user The trajectory point at the time obtains the available edge servers around and obtains the set of edge servers to be migrated; S4.2. Based on the set of edge servers to be migrated, select an edge server with the largest comprehensive reputation value as the optimal target migration node; S4.3, setting a reputation threshold for all available edge servers near the future trajectory of the user, and forming an intermediate edge server list with edge servers greater than the reputation threshold; S4.4. Construct a graph network based on the intermediate edge server list and obtain the best migration path through a graph search algorithm.
[0041] Further, the step S4.2 of selecting the edge server with the largest comprehensive reputation value includes: Calculate the comprehensive reputation of the edge server based on the communication transmission delay, load balancing, available memory resources, and effective service range of the edge server , the calculation formula is: ; in, Load Balancing , available memory resources , Communication transmission delay , Effective service scope The weight coefficient of The default values are 0.2, 0.3, 0.3, 0.2, and can be adjusted according to actual needs.
[0042] Furthermore, in step S4.4, constructing a graph network based on the intermediate edge server list and obtaining the best migration path through a graph search algorithm includes: The edge servers in the intermediate edge server list are used as graph nodes, and the transmission delay between edge servers is used as the weight of the edge. The graph search algorithm is used to calculate an optimal migration path. , the calculation formula is: ; ; in, For edge The transmission delay of The transmission delay between the edge servers at both ends, To serve the migration path, The intermediate edge server list The constructed graph network, The serial number is The edge server, The first Edge servers, For edge servers bandwidth, For edge servers The number of users who have logged in.
[0043] Exemplarily, the communication transmission delay, load balancing, available memory resources, and effective service range of the edge server in this embodiment include: The communication transmission delay is calculated as follows: ; in, is the communication delay of the edge server, is the edge server bandwidth, is the sending power of the edge server, is the channel fading coefficient of the edge server, is the average noise power of the edge server channel; The load balancing calculation formula is: ; in, For load balancing of edge servers, is the current load of the edge server, is the maximum load of all edge servers, is the current task queue length or the response time for processing requests, is the maximum task queue length of all edge servers; The available memory resources are calculated as follows: ; in, is the available memory resources of the edge server, The current available memory of the edge server, is the maximum available memory for all edge servers, is the current memory usage, is the maximum memory usage of all edge servers; The effective service range is calculated as follows: ; in, is the effective service range of the edge server, is the coverage of the edge server, is the maximum coverage of all edge servers, The number of users currently served in the effective service range, The maximum number of connected users served by the edge server.
[0044] Furthermore, the real-time migration of services also includes: The service in the edge server currently connected by the user is migrated to the optimal target migration node along the obtained optimal migration path.
[0045] S5. As the user moves, the trajectory points are incorporated into the user's short-term trajectory data, and the user's future trajectory is re-predicted and whether service migration is required.
[0046] Exemplarily, the trajectory point at the next time point predicted based on the STG-Informer model is added to the user's short-term trajectory data, and the process jumps to step S2 to re-predict the user's future trajectory, and then enters step S3 to determine whether service migration is required.
[0047] Example 2
[0048] like Figure 2 As shown, a schematic diagram of the structure of the STG-Informer model involved in Example 2 of the present invention includes: (1) input layer, (2) graph convolutional network, (3) Informer model, and (4) preference factor adjustment model; (1) Input layer, used to input user historical long-term trajectory data and user short-term trajectory data; (2) Graph convolutional network, which is used to process the user's historical long-term trajectory data in the input layer, build an adjacency matrix based on the user's historical long-term trajectory data, and dynamically update the weights in the adjacency matrix; based on the trajectory points and adjacency matrix in the user's historical long-term trajectory data Build a location map , extract spatial dependencies from the location graph of user trajectory points, capture the user's long-term preference for a specific location, use convolutional networks to obtain the feature vectors of location nodes in the location graph and propagate them, and use the fully connected layer to obtain the user's long-term historical graph convolution features based on the feature vectors of location nodes in the location graph. By averaging the graph convolution features, the long-term preference vector is obtained. ; Specifically, in this example, the input feature dimension of the graph convolutional network is 64, and the output feature dimension is 128.
[0049] (3) Informer model, which is used to process the user short-term trajectory data in the input layer. The short-term trajectory is processed using the Informer self-attention mechanism with 4 attention heads. The attention score is calculated through the multi-head attention mechanism, and the short-term trajectory is weighted and summed to obtain the short-term intention vector. .
[0050] (4) Preference factor adjustment model, which converts the long-term preference vector and short-term intent vector The fused features are concatenated and fused through a fully connected layer. The fused feature dimension is 128. The fused features are input to a two-layer GRU unit, including GRU1 and GRU2. The hidden layer dimensions of GRU1 and GRU2 are both 64, and the internal mechanism of the GRU unit includes a reset gate and an update gate. The output state of GRU2 is The hidden state of the last time step in Input to the fully connected layer for mapping to obtain the preference factor .
[0051] Furthermore, in this embodiment, the preference factor output by the preference factor adjustment model (4) is (2) Long-term preference vector for the output of graph convolutional network , and (3) the short-term intention vector output by the Informer model Perform weighted summation to obtain the predicted position vector ; Then pass the position vector through a fully connected layer Perform the transformation mapping and then pass the normalization function , take the trajectory point with the highest probability as the trajectory point of the next moment, and output the trajectory point of the next moment, and the dimension of the trajectory point is 2, including longitude and latitude.
[0052] Example 3
[0053] like Figure 3 As shown, a service migration system based on user trajectory prediction according to Embodiment 3 of the present invention includes: a data collection module, a model building module, a future trajectory prediction module and a service migration module; The data collection module is used to collect urban road network data, user historical long-term trajectory data and user short-term trajectory data; The model building module is used to build the STG-Informer model and use the historical trajectory data in the data collection module to train and optimize the STG-Informer model; The future trajectory prediction module is used to predict the user's future trajectory based on the STG-Informer model in the model construction module according to the user's historical long-term trajectory data and the user's short-term trajectory data in the data collection module; The service migration module is used to determine whether service migration is required based on the future trajectory of the user predicted by the future trajectory prediction module. If migration is required, the optimal target migration node is selected and the optimal migration path is obtained to migrate the service in real time. Otherwise, as the user moves, the trajectory point is incorporated into the user's short-term trajectory data in the data collection module, and the user's future trajectory is re-predicted to determine whether service migration is required.
[0054] Furthermore, the service migration module includes a service migration judgment submodule, an optimal target migration node selection submodule, an optimal migration path selection submodule, and a real-time service migration submodule; The service migration judgment submodule is used to calculate the future trajectory of the user according to the future trajectory predicted by the future trajectory prediction module. The distance between the geographic location at that moment and the current geographic location is used to determine whether service migration is required; The optimal target migration node selection submodule is used to select the optimal target migration node according to the future trajectory of the user predicted by the future trajectory prediction module; The optimal migration path selection submodule is used to select the optimal migration path according to the future trajectory of the user predicted by the future trajectory prediction module; The real-time service migration submodule is used to migrate the service in the edge server currently connected by the user to the optimal target migration node obtained by the optimal target migration node selection submodule along the optimal migration path obtained by the optimal migration path selection submodule.
[0055] The specific implementation method of this embodiment is the same as that of Embodiment 1, which will not be repeated here. Please refer to the description of Embodiment 1 for details.
[0056] Those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.
[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A service migration method based on user trajectory prediction, characterized in that: include: Collect urban road network data, user historical long-term trajectory data, and user short-term trajectory data; Predicting the user's future trajectory through the STG-Informer model based on the collected historical long-term trajectory data of the user and the short-term trajectory data of the user; Determining whether service migration is required based on the predicted future trajectory of the user; If migration is required, the optimal target migration node and the best migration path are selected according to the future trajectory of the user, and the service is migrated in real time; Otherwise, as the user moves, the real-time moving trajectory points are incorporated into the user's short-term trajectory data, and the user's future trajectory is re-predicted to determine whether service migration is required.
2. A service migration method based on user trajectory prediction as claimed in claim 1, characterized in that: The predicting of the user's future trajectory through the STG-Informer model based on the collected historical long-term trajectory data of the user and the short-term trajectory data of the user includes: The user's historical long-term trajectory data and the user's short-term trajectory data are preprocessed, and the trajectory point format is unified. The trajectory point is represented as: ; in, Expressed as Track points, is the unique identifier of the trajectory point, is the timestamp of the trajectory point, are the longitude and latitude of the trajectory points, respectively; Construct the STG-Informer model based on graph convolutional network, Informer model and GRU unit; Based on the user's short-term trajectory data, the STG-Informer model is repeatedly used to predict the trajectory point at the next moment until the future is predicted. The trajectory point at the moment to obtain the user's future trajectory .
3. A service migration method based on user trajectory prediction as claimed in claim 2, characterized in that: The STG-Informer model includes long-term preference prediction, short-term intention prediction, and fusion of long-term preference prediction and short-term intention prediction, including: The long-term preference position vector of the user that captures the user's historical long-term trajectory data is captured using a graph convolutional network ; Use the Informer model self-attention mechanism to obtain the user's short-term intention position vector ; Build a preference factor adjustment model based on GRU units to obtain preference factors that dynamically adjust long-term preferences and short-term intentions ; Based on the preference factor obtained Fusion of the long-term preference position vector and the short-term intention position vector Get the predicted position vector , the calculation formula is: ; in, is the predicted position vector, is the preference factor, and .
4. A service migration method based on user trajectory prediction as claimed in claim 3, characterized in that: The long-term preference position vector of the user capturing the historical long-term trajectory data of the user using a graph convolutional network ,include: Construct an adjacency matrix based on the user's historical long-term trajectory data , initialize the adjacency matrix weight relationship, according to the adjacency matrix Build a location map , expressed as: ; in, It is the set of trajectory points in the user's historical long-term trajectory data; Based on the time intervals of different trajectory points in the user's historical long-term trajectory data and the frequency of access to the trajectory points To update the adjacency matrix The weight in is calculated as: ; in, For trajectory points and The time interval between For trajectory points and The access frequency between is the time weight attenuation coefficient, which is used to control the influence of the time interval; Based on the user's historical long-term trajectory data, a graph convolutional network is used to extract the location graph Extract spatial dependencies, capture users’ long-term preferences for specific locations, and obtain high-dimensional representations of long-term locations. The calculation formula is: ; in, For graph convolutional network The node feature matrix of the layer, is the degree matrix of the node, is the adjacency matrix, For the The trainable weight matrix of the layer, is the Sigmoid function; Based on the high-dimensional representation of the long-term position obtained, the user's long-term preference position vector is obtained through average pooling operation. , the calculation formula is: ; in, It is the final feature representation after graph convolution.
5. A service migration method based on user trajectory prediction as claimed in claim 3, characterized in that: The Informer model self-attention mechanism is used to obtain the user's short-term intention position vector ,include: Use the Informer self-attention mechanism to process the short-term trajectory data , by calculating the correlation between each time step, the user's local behavior pattern is captured. The calculation formula is: ; in, are query matrix, key matrix and value matrix respectively, is the dimension of the key vector, is the transposed matrix of the key matrix, is the normalization function.
6. A service migration method based on user trajectory prediction as claimed in claim 3, characterized in that: The preference factor adjustment model is constructed based on the GRU unit to obtain the preference factors for dynamically adjusting long-term preferences and short-term intentions. ,include: Based on the double-layer GRU unit, a preference factor adjustment model is constructed, and the long-term preference position vector , short-term intention position vector and Behavioral Volatility Index As input, it is represented as: , ; in, , is the time step number, representing the last time point of the sequence, is the input dimension for each time step, is the standard deviation of the time intervals between trajectory points, is the mean time interval of trajectory points; First layer GRU input , output hidden state , the calculation formula is: ; in, is the first layer of GRU units, and the internal mechanism of GRU includes reset gate and update gate, and , is the number of time steps, is the dimension of the hidden state of the first layer GRU unit; The second layer GRU input is , extract the output status Medium time steps The hidden state , the calculation formula is: ; ; in, , is the second layer GRU unit, is the number of time steps, is the dimension of the hidden state of the second layer GRU unit; The Input the fully connected layer for mapping to obtain the preference factor , the calculation formula is: ; in, , is the hidden state in the fully connected layer The weight matrix of is the dimension of the hidden state of the second layer GRU unit, is the hidden state in the fully connected layer The bias term, is the Sigmoid function.
7. A service migration method based on user trajectory prediction as claimed in claim 2, characterized in that: The STG-Informer model is repeatedly used to predict the trajectory point at the next moment based on the user's short-term trajectory data until the future The trajectory point at the moment to obtain the user's future trajectory ,include: The user's short-term trajectory data and the user's historical long-term trajectory data are input into the STG-Informer model to obtain the predicted position vector at the next moment. ; Use a fully connected layer to transform the predicted position vector Transform the mapping, and then use the normalization function to take the trajectory point with the highest probability as the trajectory point at the next moment. The calculation formula is: ; in, Predicted position vector in the fully connected layer The weight matrix of Predicted position vector in the fully connected layer The bias term, is the normalization function; The trajectory point at the next moment is added to the short-term trajectory data, and the trajectory at the next moment is predicted repeatedly until the future The trajectory point at the moment to obtain the user's future trajectory , expressed as: ; in, To predict the future The trajectory point of time.
8. A service migration method based on user trajectory prediction as claimed in claim 1, characterized in that: The determining whether service migration is required based on the predicted future trajectory of the user includes: Calculate the future trajectory of the user based on the prediction The distance between the trajectory point at the moment and the edge server used by the service at the current moment , and compare the distance Communication range with edge servers size; Determine whether service migration is necessary. > , it means that the user has moved away from the current edge server and needs service migration. , it means that the user is still within the coverage of the current edge server and does not need to migrate the service.
9. A service migration method based on user trajectory prediction as claimed in claim 1, characterized in that: The selecting the optimal target migration node and obtaining the optimal migration path according to the future trajectory of the user includes: Based on the predicted future trajectory of the user The trajectory point at the time obtains the available edge servers around and obtains the set of edge servers to be migrated; Based on the set of edge servers to be migrated, selecting an edge server with the largest comprehensive reputation value as the optimal target migration node; Setting a reputation threshold for all available edge servers near the future trajectory of the user, and forming an intermediate edge server list with edge servers greater than the reputation threshold; A graph network is constructed based on the intermediate edge server list to obtain the best migration path through a graph search algorithm.
10. A service migration method based on user trajectory prediction according to claim 9, characterized in that: The step of selecting the edge server with the largest comprehensive reputation value includes: Calculate the comprehensive reputation of the edge server based on the communication transmission delay, load balancing, available memory resources, and effective service range of the edge server , the calculation formula is: ; in, Load Balancing , available memory resources , Communication transmission delay , Effective service scope The weight coefficient of .
11. A service migration method based on user trajectory prediction according to claim 9, characterized in that: The step of constructing a graph network based on the intermediate edge server list and obtaining an optimal migration path through a graph search algorithm includes: The edge servers in the intermediate edge server list are used as graph nodes, and the transmission delay between edge servers is used as the weight of the edge. The graph search algorithm is used to calculate an optimal migration path. , the calculation formula is: ; in, For edge The transmission delay of The transmission delay between the edge servers at both ends, To serve the migration path, The intermediate edge server list The constructed graph network, The serial number is edge server.
12. A service migration method based on user trajectory prediction according to claim 1, characterized in that: The real-time migration of services includes: The service in the edge server currently connected by the user is migrated to the optimal target migration node along the obtained optimal migration path.
13. A service migration system based on user trajectory prediction, comprising a data collection module, a model building module, a future trajectory prediction module and a service migration module, characterized in that: The data collection module is used to collect urban road network data, user historical long-term trajectory data and user short-term trajectory data; The model building module is used to build the STG-Informer model and use the historical trajectory data in the data collection module to train and optimize the STG-Informer model; The future trajectory prediction module is used to predict the user's future trajectory based on the STG-Informer model in the model construction module according to the user's historical long-term trajectory data and the user's short-term trajectory data in the data collection module; The service migration module is used to determine whether service migration is required based on the future trajectory of the user predicted by the future trajectory prediction module. If migration is required, the optimal target migration node is selected and the optimal migration path is obtained to migrate the service in real time. Otherwise, as the user moves, the trajectory point is incorporated into the user's short-term trajectory data in the data collection module, and the user's future trajectory is re-predicted to determine whether service migration is required.
14. A service migration system based on user trajectory prediction according to claim 13, characterized in that: The service migration module includes a service migration judgment submodule, an optimal target migration node selection submodule, an optimal migration path selection submodule, and a real-time service migration submodule; The service migration judgment submodule is used to calculate the future trajectory of the user according to the future trajectory predicted by the future trajectory prediction module. The distance between the geographic location at that moment and the current geographic location is used to determine whether service migration is required; The optimal target migration node selection submodule is used to select the optimal target migration node according to the future trajectory of the user predicted by the future trajectory prediction module; The optimal migration path selection submodule is used to select the optimal migration path according to the future trajectory of the user predicted by the future trajectory prediction module; The real-time service migration submodule is used to migrate the service in the edge server currently connected by the user to the optimal target migration node obtained by the optimal target migration node selection submodule along the optimal migration path obtained by the optimal migration path selection submodule.
Citation Information
Patent Citations
Long-time-sequence freight volume prediction method based on multi-attribute enhanced graph convolution-Informer model
CN113487066A
Edge computing service migration method based on trajectory prediction
CN114554420A
Urban rail transit short-time passenger flow prediction method considering sudden factors
CN116128122A
Mobile edge computing service migration method and system based on trajectory information
CN118102234A
Multi-user service migration method based on mobile edge computing
CN118102393A
Cited By
Service migration method and system based on vehicle track and road network matching
CN120223709A
A service migration method and system based on vehicle trajectory and road network matching
CN120223709B
Edge computing task dynamic migration method supporting service continuity
CN120407128A