A 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, and efficient and continuous service migration is achieved, improving user experience and resource utilization.

CN119854303BActive Publication Date: 2025-06-20JIANGXI NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510322366.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-06-20
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

In a mobile edge computing environment, the high mobility of users leads to low service migration accuracy, poor real-time performance, insufficient service continuity and large latency.

Method used

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.

Benefits of technology

Improve the accuracy and real-time nature of service migration, ensure service continuity and low latency, improve user experience, and optimize the utilization rate of edge computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854303B_ABST
    Figure CN119854303B_ABST
Patent Text Reader

Abstract

The present invention discloses a service migration method and system based on user trajectory prediction, which relates to the field of service migration in a mobile edge environment. The method includes: collecting urban road network data, user historical long-term trajectory data, and user short-term trajectory data, and predicting the user's future trajectory through the STG-Informer model; based on the distance between the user's future trajectory and the current edge server, determining whether service migration is required; if migration is required, selecting a target migration node with the optimal comprehensive reputation value according to the user's future trajectory, and planning the best migration path through a graph search algorithm to achieve real-time service migration; otherwise, as the user moves, incorporating the trajectory points into the user short-term trajectory data, re-predicting the user's future trajectory, and determining whether service migration is required. This method can effectively reduce service latency and improve resource utilization rate, and is applicable to scenarios such as intelligent transportation and mobile edge computing, providing users with a seamless service experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of service migration in a mobile edge environment, and particularly 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' demands for real-time computing and low-latency services are increasing continuously. The traditional cloud computing model often fails to meet the requirements of efficient service delivery, especially in a mobile environment where the changes in users' 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 users' dynamic behaviors and environmental changes. However, in practical applications, factors such as users' trajectories, speeds, and movement patterns are often dynamically changing, and these changes have important impacts on service migration decisions and path selections. To better meet the needs of mobile users, intelligent technologies such as trajectory prediction, trust evaluation, 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. The method includes: determining the predicted trajectory of the user according to the user's trajectory data and location data; confirming the historical trajectory deviation degree according to the predicted trajectory and the real trajectory; then determining the target predicted trajectory according to the historical trajectory deviation degree; determining a list of alternative 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 list of alternative base stations; and 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 update. However, adjusting the predicted trajectory through the historical trajectory deviation degree involves a large amount of calculations, including trajectory prediction, comprehensive matching degree calculation, and path score calculation, which may increase the computational burden of the system, especially when the number of users or the number of base stations is large, resulting in certain deficiencies in trajectory prediction accuracy. Summary of the Invention

[0004] To solve the technical problems of low accuracy, poor real-time performance, insufficient service continuity, and large latency in service migration in a scenario with high user mobility in an edge computing environment, 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 latency, thereby enhancing the user experience and optimizing the utilization rate of edge computing resources.

[0005] In a first aspect, a service migration method based on user trajectory prediction is provided, including:

[0006] Collect urban road network data, users' historical long-term trajectory data, and users' short-term trajectory data;

[0007] Predict the future trajectory of the user through the STG-Informer (Spatio-Temporal Graph-Informer) model based on the collected users' historical long-term trajectory data and the users' short-term trajectory data;

[0008] Judge whether service migration is needed based on the predicted future trajectory of the user;

[0009] If migration is needed, select the optimal target migration node and obtain the best migration path according to the future trajectory of the user, and perform real-time migration of the service; otherwise, incorporate the real-time moving trajectory points into the users' short-term trajectory data as the user moves, re-predict the future trajectory of the user, and judge whether service migration is needed.

[0010] Further, the predicting the future trajectory of the user through the STG-Informer model based on the collected users' historical long-term trajectory data and the users' short-term trajectory data includes:

[0011] Perform preprocessing operations on the users' historical long-term trajectory data and the users' short-term trajectory data, and unify the trajectory point format. The trajectory point is represented as:

[0012] ;

[0013] Wherein, is represented as the th trajectory point, is the unique identifier of the trajectory point, is the timestamp of the trajectory point, are the longitude and latitude of the trajectory point respectively;

[0014] Construct the STG-Informer model based on the graph convolutional network, the Informer model, and the GRU (Gated Recurrent Unit) unit;

[0015] Repeatedly predict the trajectory point of the next moment through the STG-Informer model based on the users' short-term trajectory data until predicting the trajectory point of the future moment, and obtain the future trajectory of the user .

[0016] Further, the STG-Informer model includes long-term preference prediction, short-term intention prediction, and the fusion of long-term preference prediction and short-term intention prediction, including:

[0017] 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 ;

[0018] Use the Informer model self-attention mechanism to obtain the user's short-term intention position vector ;

[0019] Build a preference factor adjustment model based on GRU units to obtain preference factors that dynamically adjust long-term preferences and short-term intentions ;

[0020] 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:

[0021] ;

[0022] in, is the predicted position vector, is the preference factor, and .

[0023] 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:

[0024] 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:

[0025] ;

[0026] in, It is the set of trajectory points in the user's historical long-term trajectory data;

[0027] 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:

[0028] ;

[0029] in, is the adjacency matrix Mid-track point and The weight between is the trajectory point and the time interval between is the trajectory point and the access frequency between is the time weight decay coefficient, which is used to control the influence degree of the time interval;

[0030] Based on the user's historical long-term trajectory data, use the graph convolutional network to extract spatial dependencies from the location graph to capture the user's long-term preference for specific locations and obtain a high-dimensional representation of the long-term location. The calculation formula is:

[0031] ;

[0032] Among them, is the node feature matrix of the th layer of the graph convolutional network, is the degree matrix of the nodes, is the adjacency matrix, is the th layer of trainable weight matrix, is the Sigmoid function;

[0033] Based on the obtained high-dimensional representation of the long-term location, through average pooling operation, obtain the user's long-term preference location vector , and the calculation formula is:

[0034] ;

[0035] Among them, is the final feature representation after graph convolution.

[0036] Furthermore, using the self-attention mechanism of the Informer model to obtain the user's short-term intention location vector , including:

[0037] Using the self-attention mechanism of Informer to process the short-term trajectory data , by calculating the correlation between each time step, capture the user's local behavior pattern. The calculation formula is:

[0038] ;

[0039] Among them, are the 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.

[0040] Furthermore, a preference factor adjustment model is constructed based on GRU units to obtain preference factors for dynamically adjusting long-term preferences and short-term intentions , including:

[0041] Construct a preference factor adjustment model based on a two-layer GRU unit, and use the long-term preference position vector , short-term intention position vector and behavior fluctuation index as inputs, expressed as: , ;

[0042] Among them, , is the number of time steps, representing the last time point of the sequence, is the input dimension of each time step, is the standard deviation of the time interval of the trajectory points, is the mean of the time interval of the trajectory points;

[0043] The first layer of GRU inputs , and outputs the hidden state , and the calculation formula is:

[0044] ;

[0045] Among them, is the first layer of GRU units. The internal mechanism of GRU includes a reset gate and an update gate, and , is the number of time steps, is the dimension of the hidden state of the first layer of GRU units;

[0046] The second layer of GRU inputs the , and extracts the hidden state at the time step in the output state , and the calculation formula is:

[0047] ;

[0048] ;

[0049] Among them, , is the second layer of GRU units, is the number of time steps, is the dimension of the hidden state of the second layer of GRU units;

[0050] Input the into the fully connected layer for mapping to obtain the preference factor , the calculation formula is:

[0051] ;

[0052] Among them, , is the weight matrix of the hidden state in the fully connected layer, is the dimension of the hidden state of the second-layer GRU cell, is the bias term of the hidden state in the fully connected layer, is the Sigmoid function.

[0053] Furthermore, 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 trajectory point at the future moment is predicted to obtain the user's future trajectory , including:

[0054] Input the user's short-term trajectory data and the user's historical long-term trajectory data into the STG-Informer model to obtain the predicted position vector at the next moment ;

[0055] Use the fully connected layer to transform and map the predicted position vector , 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:

[0056] ;

[0057] Among them, is the weight matrix of the predicted position vector in the fully connected layer, is the bias term of the predicted position vector in the fully connected layer, is the normalization function;

[0058] Add the trajectory point at the next moment to the short-term trajectory data, and repeatedly predict the trajectory at the next moment until the trajectory point at the future moment is predicted to obtain the user's future trajectory , expressed as:

[0059] ;

[0060] Among them, is the trajectory point predicted for the future moment.

[0061] Furthermore, calculating the future The distance between the geographical location at a certain moment and the edge server used by the service at the current moment, and determine whether service migration is required, including:

[0062] Calculate the future distance between the trajectory point at a certain moment in the predicted future trajectory of the user and the edge server used by the service at the current moment , and compare the distance with the communication range of the edge server . The calculation formula is:

[0063] ;

[0064] ;

[0065] ;

[0066] ;

[0067] Among them, is the radius of the earth, are respectively the longitude and latitude of the user's geographical location at a future moment, are respectively the longitude and latitude of the geographical location of the edge server used by the service at the current moment, is the radian latitude of the user's future trajectory point, is the radian latitude of the edge server, is the radian longitude of the user's future trajectory point, is the radian longitude of the edge server, is the radian latitude difference between the user's future trajectory point and the edge server, is the radian longitude difference between the user's future trajectory point and the edge server;

[0068] Determine whether service migration is required. If > , it means that the user has moved away from the current edge server and service migration is required. If , it means that the user is still within the coverage range of the current edge server and service migration is not required.

[0069] Furthermore, the selection of the optimal target migration node and the acquisition of the best migration path according to the user's future trajectory include:

[0070] Based on the trajectory points at a future moment in the predicted future trajectory of the user, obtain the available edge servers around, and get the set of edge servers to be migrated;

[0071] Based on the set of edge servers to be migrated, select the edge server with the largest comprehensive reputation value as the optimal target migration node;

[0072] Set a reputation threshold for all available edge servers near the future trajectory of the user, and form a list of intermediate edge servers consisting of edge servers with a reputation value greater than the threshold;

[0073] Construct a graph network based on the list of intermediate edge servers and obtain the best migration path through a graph search algorithm.

[0074] Furthermore, the selection of the edge server with the largest comprehensive reputation value includes:

[0075] Calculate the comprehensive reputation value of the edge server based on the communication transmission delay, load balance, available memory resources, and effective service range of the edge server , and the calculation formula is:

[0076] ;

[0077] Among them, are the weight coefficients of load balance , available memory resources , communication transmission delay , and effective service range respectively, and .

[0078] Furthermore, the construction of the graph network based on the list of intermediate edge servers and obtaining the best migration path through a graph search algorithm includes:

[0079] Take the edge servers in the list of intermediate edge servers as graph nodes, and the transmission delay between edge servers as the weight of the edge. Use the graph search algorithm to calculate an optimal migration path , and the calculation formula is:

[0080] ;

[0081] ;

[0082] Among them, is the transmission delay of edge , including the transmission delays of the edge servers at both ends of edge , is the service migration path, is the graph network constructed from the list of intermediate edge servers , is the edge server with serial number , is the An edge server, For the edge server Bandwidth, For the edge server The number of users already connected to it.

[0083] Furthermore, the real-time migration of services further includes:

[0084] Migrate the service that the user is currently connected to in the edge server along the obtained best migration path to the optimal target migration node.

[0085] In a second aspect, a service migration system based on user historical trajectories and road network matching is provided, including:

[0086] A data collection module, a model construction module, a future trajectory prediction module, and a service migration module;

[0087] The data collection module is used to collect urban road network data, user historical long-term trajectory data, and user short-term trajectory data;

[0088] The model construction module is used to construct an STG-Informer model and train and optimize the STG-Informer model using the historical trajectory data in the data collection module;

[0089] 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 user short-term trajectory data in the data collection module;

[0090] The service migration module is used to determine whether service migration is required according to the user's future trajectory predicted by the future trajectory prediction module. If migration is required, select the optimal target migration node and obtain the best migration path to perform real-time migration of the service. Otherwise, as the user moves, incorporate the trajectory points into the user short-term trajectory data in the data collection module, re-predict the user's future trajectory, and determine whether service migration is required.

[0091] Furthermore, the service migration module includes a service migration judgment sub-module, an optimal target migration node selection sub-module, a best migration path selection sub-module, and a real-time service migration sub-module;

[0092] The service migration judgment sub-module is used to calculate the distance between the geographical location at the future k moment and the geographical location at the current moment according to the user's future trajectory predicted by the future trajectory prediction module, and determine whether service migration is required;

[0093] The optimal target migration node selection sub-module is used to select an optimal target migration node according to the future trajectory of the user predicted by the future trajectory prediction module;

[0094] The best migration path selection sub-module is used to select the best migration path according to the future trajectory of the user predicted by the future trajectory prediction module;

[0095] The real-time service migration sub-module is used to migrate the service in the edge server connected by the user at the current moment along the best migration path obtained by the best migration path selection sub-module to the optimal target migration node obtained by the optimal target migration node selection sub-module.

[0096] The beneficial effects of the present invention are as follows:

[0097] 1. A service migration method based on user trajectory prediction provided by the present invention can dynamically adjust the long-term preferences and short-term intentions of users through a preference factor adjustment model constructed by GRU units, making the trajectory prediction more in line with the real-time behavior patterns of users.

[0098] 2. A service migration method based on user trajectory prediction provided by the present invention accurately predicts the future trajectory of users through the STG-Informer model, ensuring that users are always within the coverage of edge servers during the movement process, avoiding service interruptions caused by users moving away from the current edge server, thereby improving the continuity of services and the user experience.

[0099] 3. A service migration method based on user trajectory prediction provided by the present invention selects the edge server with the largest comprehensive reputation value as the optimal target migration node by comprehensively considering factors such as communication transmission delay, load balancing, available memory resources, and effective service range of edge servers, which can effectively balance the load of edge servers, avoid the situation of some nodes being overloaded while other nodes have idle resources, thereby optimizing the utilization rate of edge computing resources. Brief Description of the Drawings

[0100] Figure 1 is a flowchart schematic diagram of a service migration method based on user trajectory prediction provided by an embodiment of the present invention.

[0101] Figure 2 is a schematic structural diagram of the STG-Informer model provided by an embodiment of the present invention.

[0102] Figure 3 is a schematic diagram of a service migration system based on user trajectory prediction provided by an embodiment of the present invention. Detailed Embodiments

[0103] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the 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 so that the present invention can be more thoroughly understood and the scope of the present invention can be fully conveyed to those skilled in the art.

[0104] With the rapid development of the mobile Internet and the Internet of Things, the location information and service requirements of users have become increasingly dynamic and complex. Traditional service deployment methods often struggle to adapt to such dynamic changes, resulting in increased service latency and a degraded user experience. Especially in the edge computing environment, the real-time nature and response speed of services are crucial. However, due to the location changes brought about by user mobility, service migration has become 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 addressed urgently.

[0105] Based on the above problems, the technical solution of the present invention collects long-term user historical trajectory data and short-term trajectory data, uses the STG-Informer model to predict the user's future trajectory, and dynamically determines whether service migration is required based on the prediction results. In the case of migration required, the optimal target migration node and the best migration path are selected to ensure service continuity and low latency. At the same time, by updating the user trajectory data in real time, the prediction and migration decisions are continuously optimized to adapt to the dynamically changing user behavior and environment.

[0106] Embodiment 1

[0107] A service migration method based on user trajectory prediction according to Embodiment 1 of the present invention includes:

[0108] Collect urban road network data, long-term user historical trajectory data, and short-term user trajectory data; predict the user's future trajectory based on the collected long-term user historical trajectory data and short-term trajectory data through the STG-Informer model; 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 best migration path according to the user's future trajectory, and perform real-time migration of the service; otherwise, incorporate the trajectory points into the short-term user trajectory data as the user moves, re-predict the user's future trajectory, and determine whether service migration is required.

[0109] Specifically, Figure 1 FIG. shows a schematic flow diagram of a service migration method based on user trajectory prediction in Embodiment 1 of the present invention, including:

[0110] S1. Collect urban road network data, long-term user historical trajectory data, and short-term user trajectory data;

[0111] Exemplarily, in the embodiments of the present invention, the urban road network map is based on Shanghai, with longitude range: from 120°52′ east longitude to 122°16′ east longitude; latitude range: from 30°42′ north latitude to 31°48′ north latitude. The historical trajectory data of the user records a trajectory point every 30 seconds. For example:

[0112] "[{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 trajectory points includes: If duplicate trajectory points appear during the trajectory recording process. For example, when recording trajectory points every 30 seconds, if the user stops at the same location and the longitude and latitude values of consecutive trajectory points are the same, then these duplicate data are removed, and the most representative trajectory point is retained. For example, if the positions are almost the same for two consecutive minutes, the second and subsequent trajectory points can be regarded as duplicates and deleted. Removing abnormal data includes: Abnormal data includes that the trajectory points of the user jump too much, or the trajectory points are located outside Shanghai. Uniform formatting of timestamps includes: The timestamps of all trajectory points are in the unified ISO 8601 format, such as 2021-02-06T08:04:12Z.

[0113] S2. Predict the future trajectory of the user through the STG-Informer model based on the collected long-term historical trajectory data and short-term trajectory data of the user;

[0114] Further, the predicting the future trajectory of the user through the STG-Informer model based on the collected historical trajectory data and short-term trajectory data of the user in step S2 includes:

[0115] S2.1. Perform preprocessing operations on the long-term historical trajectory data and short-term trajectory data of the user, and unify the trajectory point format. The trajectory point is represented as:

[0116] ;

[0117] Wherein, is represented as the th trajectory point, is the unique identifier of the trajectory point, is the timestamp of the trajectory point, are the longitude and latitude of the trajectory point respectively;

[0118] S2.2. Construct the STG-Informer model based on the graph convolutional network, Informer model, and GRU unit;

[0119] 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 .

[0120] 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:

[0121] 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 ;

[0122] S2.2.2. Use the Informer model self-attention mechanism to obtain the user's short-term intention position vector ;

[0123] 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 ;

[0124] 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:

[0125] ;

[0126] in, is the predicted position vector, is the preference factor, and .

[0127] 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:

[0128] 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:

[0129] ;

[0130] in, It is the set of trajectory points in the user's historical long-term trajectory data;

[0131] Based on the time intervals between different trajectory points in the user's long-term historical trajectory data and the access frequencies of the trajectory points to update the weights in the adjacency matrix The calculation formula is:

[0132] ;

[0133] where is the weight between trajectory points in the adjacency matrix and ; is the time interval between trajectory points and ; is the access frequency between trajectory points and ; is the time weight decay coefficient, used to control the influence degree of the time interval;

[0134] Based on the user's long-term historical trajectory data, use a graph convolutional network to extract spatial dependencies from the location graph to capture the user's long-term preferences for specific locations and obtain a high-dimensional representation of the long-term location. The calculation formula is:

[0135] ;

[0136] where is the node feature matrix of the -th layer of the graph convolutional network, is the degree matrix of the nodes, is the adjacency matrix, is the trainable weight matrix of the -th layer, is the Sigmoid function;

[0137] Based on the obtained high-dimensional representation of the long-term location, through average pooling operation, obtain the user's long-term preference location vector , and the calculation formula is:

[0138] ;

[0139] where is the final feature representation after graph convolution.

[0140] Furthermore, the obtaining of the user's short-term intention location vector by using the self-attention mechanism of the Informer model in step S2.2.2

[0141] Utilize the Informer self-attention mechanism to process the short-term trajectory data , capture the user's local behavior pattern by calculating the correlation between each time step, and the calculation formula is:

[0142] ;

[0143] wherein, are the 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.

[0144] Furthermore, in step S2.2.3, the preference factor adjustment model is constructed based on the GRU unit to obtain the preference factor for dynamically adjusting the long-term preference and short-term intention , including:

[0145] Construct a preference factor adjustment model based on a two-layer GRU unit, and use the long-term preference position vector , short-term intention position vector and behavior fluctuation index as inputs, which is expressed as: , ;

[0146] wherein, , is the number of time steps, representing the last time point of the sequence, is the input dimension of each time step, is the standard deviation of the time interval of the trajectory points, is the mean of the time interval of the trajectory points;

[0147] The first-layer GRU inputs , and outputs the hidden state , and the calculation formula is:

[0148] ;

[0149] wherein, is the first-layer GRU unit, and the internal mechanism of the GRU includes a reset gate and an update gate, and , is the number of time steps, is the dimension of the hidden state of the first-layer GRU unit;

[0150] The second-layer GRU inputs the above-mentioned , and extracts the hidden state of the time step in the output state , and the calculation formula is:

[0151] ;

[0152] ;

[0153] Among them, , 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;

[0154] Input the said into the fully connected layer for mapping to obtain the preference factor , and the calculation formula is:

[0155] ;

[0156] Among them, , is the weight matrix of the hidden state in the fully connected layer, is the dimension of the hidden state of the second-layer GRU unit, is the bias term of the hidden state in the fully connected layer, is the Sigmoid function.

[0157] Furthermore, in step S2.3, repeatedly predicting the trajectory point at the next moment through the STG-Informer model based on the user's short-term trajectory data until predicting the trajectory point at the future moment to obtain the user's future trajectory , including:

[0158] Input the user's short-term trajectory data and the user's historical long-term trajectory data into the STG-Informer model to obtain the predicted position vector at the next moment ;

[0159] Use the fully connected layer to transform and map the predicted position vector , 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:

[0160] ;

[0161] Among them, is the weight matrix of the predicted position vector in the fully connected layer, is the bias term of the predicted position vector in the fully connected layer, is the normalization function;

[0162] Add the trajectory point at the next moment to the short-term trajectory data, and repeatedly predict the trajectory at the next moment until the trajectory point at the future moment is predicted, and the future trajectory of the user is obtained , expressed as:

[0163] ;

[0164] where is the trajectory point for predicting the future moment.

[0165] S3. Determine whether service migration is required based on the predicted future trajectory of the user;

[0166] Specifically, determining whether service migration is required based on the predicted future trajectory of the user in step S3 includes:

[0167] Calculate the distance between the trajectory point at the future moment in the predicted future trajectory of the user and the edge server used by the service at the current moment , and compare the distance with the communication range of the edge server . The calculation formula is:

[0168] ;

[0169] ;

[0170] ;

[0171] ;

[0172] where is the radius of the earth, are the longitude and latitude of the user's geographical location at the future moment respectively, are the longitude and latitude of the geographical location of the edge server used by the service at the current moment respectively, is the radian latitude of the user's future trajectory point, is the radian latitude of the edge server, is the radian longitude of the user's future trajectory point, is the radian longitude of the edge server, is the radian latitude difference between the user's future trajectory point and the edge server, is the radian longitude difference between the user's future trajectory point and the edge server;

[0173] Determine whether service migration is required. If > , it indicates that the user has moved away from the current edge server and service migration is required. If , it indicates that the user is still within the coverage range of the current edge server and service migration is not required.

[0174] S4. If migration is required, select the optimal target migration node according to the future trajectory of the user and obtain the best migration path, and perform real-time migration of the service;

[0175] Further, in step S4, the selecting the optimal target migration node according to the future trajectory of the user and obtaining the best migration path includes:

[0176] S4.1. Obtain the surrounding available edge servers based on the trajectory points at the future time in the predicted future trajectory of the user to obtain a set of edge servers to be migrated;

[0177] S4.2. Based on the set of edge servers to be migrated, select the edge server with the largest comprehensive reputation value as the optimal target migration node;

[0178] S4.3. Set a reputation threshold for all available edge servers near the future trajectory of the user, and form an intermediate edge server list with edge servers whose reputation values are greater than the threshold;

[0179] S4.4. Construct a graph network based on the intermediate edge server list and obtain the best migration path through a graph search algorithm.

[0180] Further, in step S4.2, the selecting the edge server with the largest comprehensive reputation value includes:

[0181] Calculate the comprehensive reputation value of the edge server based on the communication transmission delay, load balance, available memory resources, and effective service range of the edge server , and the calculation formula is:

[0182] ;

[0183] where are the weight coefficients of load balance , available memory resources , communication transmission delay , and effective service range respectively, and , with default values of 0.2, 0.3, 0.3, 0.2, which can be adjusted according to actual situation requirements.

[0184] Further, the step of obtaining the optimal migration path through the graph search algorithm based on the intermediate edge server list in step S4.4 includes:

[0185] Regarding the edge servers in the intermediate edge server list as graph nodes and the transmission delay between edge servers as the weight of the edge, use the graph search algorithm to calculate an optimal migration path , and the calculation formula is:

[0186] ;

[0187] ;

[0188] Among them, is the transmission delay of edge , including the transmission delays of the edge servers at both ends of edge , is the service migration path, is the graph network constructed from the intermediate edge server list , is the edge server with serial number , is the th edge server passed on the service migration path, is the bandwidth of edge server , is the number of users already connected to edge server .

[0189] Exemplarily, in this embodiment, the communication transmission delay, load balance, available memory resources, and effective service range of the edge server include:

[0190] The communication transmission delay, and the calculation formula is:

[0191] ;

[0192] Among them, is the communication delay of the edge server, is the bandwidth of the edge server, is the transmission power of the edge server, is the channel fading coefficient of the edge server, is the average noise power of the edge server channel;

[0193] The load balance, and the calculation formula is:

[0194] ;

[0195] Among them, For the balanced load of the edge server, For the current load of the edge server, For the maximum load of all edge servers, For the current task queue length or the response time of processing requests, For the maximum task queue length of all edge servers;

[0196] The available memory resources, and the calculation formula is:

[0197] ;

[0198] Wherein, Is the available memory resource of the edge server, The current available memory of the edge server, Is the maximum available memory of all edge servers, Is the current memory utilization rate, Is the maximum memory utilization rate of all edge servers;

[0199] The effective service range, and the calculation formula is:

[0200] ;

[0201] Wherein, Is the effective service range of the edge server, Is the coverage range of the edge server, Is the maximum coverage range of all edge servers, Is the number of users currently served by the effective service range, Is the maximum number of connected users served by the edge server.

[0202] Furthermore, the real-time migration of the service further includes:

[0203] Migrate the service that the user connects to the edge server at the current moment along the obtained optimal migration path to the optimal target migration node.

[0204] S5. Incorporate 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.

[0205] Exemplarily, add the trajectory points predicted by the STG-Informer model at the next moment to the user's short-term trajectory data, jump to step S2 to re-predict the user's future trajectory, and then enter step S3 to determine whether service migration is required.

[0206] Embodiment 2

[0207] Such as Figure 2As shown in the figure, the schematic diagram of the STG-Informer model structure involved in Embodiment 2 of the present invention includes: (1) an input layer, (2) a graph convolutional network, (3) an Informer model, and (4) a preference factor adjustment model;

[0208] (1) The input layer is used to input the user's historical long-term trajectory data and the user's short-term trajectory data;

[0209] (2) The graph convolutional network is used to process the user's historical long-term trajectory data in the input layer, construct an adjacency matrix using the user's historical long-term trajectory data, and dynamically update the weights in the adjacency matrix; based on the trajectory points and the adjacency matrix in the user's historical long-term trajectory data Construct a location graph , extract spatial dependencies from the location graph of user trajectory points, capture the user's long-term preferences for specific locations, use a convolutional network to obtain the feature vectors of location nodes in the location graph and propagate them, and obtain the graph convolutional features of the user's historical long-term through a fully connected layer based on the feature vectors of location nodes in the location graph. By performing average pooling on the graph convolutional features, a 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.

[0210] (3) The Informer model is used to process the user's short-term trajectory data in the input layer, use the self-attention mechanism of the Informer to process the short-term trajectory, and the number of attention heads is 4; calculate the attention scores through the multi-head attention mechanism and perform weighted summation on the short-term trajectory to obtain a short-term intention vector .

[0211] (4) The preference factor adjustment model concatenates the long-term preference vector and the short-term intention vector , and performs feature fusion through a fully connected layer, and the fused feature dimension is 128. Input the fused features into 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; input the hidden state of the last time step in the output state of GRU2 into a fully connected layer for mapping to obtain a preference factor .

[0212] Furthermore, in this embodiment, by using the preference factor output by (4) the preference factor adjustment model to the long-term preference vector output by (2) the graph convolutional network, and Perform weighted summation to obtain the predicted position vector ; Then, pass the position vector through a fully connected layer for transformation mapping, and then through a normalization function , take the trajectory point with the highest probability as the trajectory point at the next moment, and output the trajectory point at the next moment, and the dimension of this trajectory point is 2, including longitude and latitude.

[0213] Embodiment 3

[0214] As Figure 3 shown, a service migration system based on user trajectory prediction involved in Embodiment 3 of the present invention includes: a data collection module, a model construction module, a future trajectory prediction module, and a service migration module;

[0215] The data collection module is used to collect urban road network data, user historical long-term trajectory data, and user short-term trajectory data;

[0216] The model construction module is used to construct an STG-Informer model and train and optimize the STG-Informer model using the historical trajectory data in the data collection module;

[0217] 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 user short-term trajectory data in the data collection module;

[0218] The service migration module is used to determine whether service migration is required according to the user's future trajectory predicted by the future trajectory prediction module. If migration is required, select the optimal target migration node and obtain the best migration path, and perform real-time service migration. Otherwise, as the user moves, incorporate the trajectory points into the user short-term trajectory data in the data collection module, re-predict the user's future trajectory, and determine whether service migration is required.

[0219] Further, the service migration module includes a service migration judgment sub-module, an optimal target migration node selection sub-module, a best migration path selection sub-module, and a real-time service migration sub-module;

[0220] The service migration judgment sub-module is used to calculate the distance between the geographical location at the future moment and the geographical location at the current moment according to the user's future trajectory predicted by the future trajectory prediction module, and determine whether service migration is required;

[0221] The optimal target migration node selection sub-module is used to select the optimal target migration node according to the user's future trajectory predicted by the future trajectory prediction module;

[0222] The optimal migration path selection sub-module is configured to select an optimal migration path according to the future trajectory of the user predicted by the future trajectory prediction module;

[0223] The real-time service migration sub-module is configured to migrate the service in the edge server connected by the user at the current moment along the optimal migration path obtained by the optimal migration path selection sub-module to the optimal target migration node obtained by the optimal target migration node selection sub-module.

[0224] The specific implementation method of this embodiment is the same as that of Embodiment 1, which will not be elaborated here, and reference may be made specifically to the description of Embodiment 1.

[0225] Those skilled in the art can understand that although some embodiments herein include certain features included in other embodiments rather than other features, the combination of features of different embodiments means that it is within the scope of the present invention and forms different embodiments.

[0226] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various 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; 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 ; 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.

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 1, 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.

4. A service migration method based on user trajectory prediction as claimed in claim 1, 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.

5. 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.

6. 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.

7. 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.

8. A service migration method based on user trajectory prediction as claimed in claim 7, 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 .

9. A service migration method based on user trajectory prediction as claimed in claim 7, 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.

10. The 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.

11. 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, the trajectory point is incorporated into the user's short-term trajectory data in the data collection module as the user moves, and the user's future trajectory is re-predicted to determine whether service migration is required; 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 ; 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.

12. A service migration system based on user trajectory prediction according to claim 11, 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