A service migration method and system based on vehicle trajectory and road network matching
Through a method based on vehicle trajectory and road network matching, the trajectory prediction model and road network matching algorithm are used, and the service migration path is optimized in combination with the Dijkstra algorithm, the accuracy and stability of service migration in vehicle mobile scenarios are solved, and the user experience is improved.
Patent Information
- Application Number
- CN202510716327.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-30
AI Technical Summary
In the service migration method in the vehicle mobile scenario, the prior art has problems such as inaccurate trajectory prediction, unoptimized migration path selection, poor adaptability of dynamic path changes, and large service interruption delays, which affect system stability and user experience.
By obtaining urban road network data and vehicle historical driving trajectory data, training trajectory prediction models, using road network matching algorithm to match the vehicle's future driving trajectory to the actual urban road, combining Dijkstra algorithm to obtain the minimum cost migration path, and selecting the optimal target migration server for service migration.
It improves the accuracy of vehicle's future driving trajectory prediction, enhances the reliability of path planning, optimizes service migration path selection, reduces delay and resource consumption during the migration process, and improves service continuity in the edge computing environment.
Smart Images

Figure CN120223709B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile edge computing service migration, and particularly to a service migration method and system based on vehicle trajectory and road network matching. Background Art
[0002] With the rapid development of intelligent transportation systems and vehicle networking technologies, the demand for service migration in vehicle movement scenarios is increasing day by day. During the movement of a vehicle, how to achieve seamless service migration to ensure the user experience has become an important challenge. Traditional service migration methods are usually based on static path planning or simple prediction models, which are difficult to adapt to the characteristics of dynamic vehicle movement, resulting in problems such as inaccurate migration path selection, high migration costs, and frequent service interruptions, affecting the stability of the system and the user experience.
[0003] The inventor found that in the prior art, the service migration method based on a fixed path lacks flexibility and cannot cope with path changes during dynamic vehicle movement, easily leading to migration failures; while the service migration method based on a simple prediction model has low prediction accuracy due to not considering the spatio-temporal characteristics of traffic patterns, and the migration path selection is not optimized, increasing the migration cost and delay. In addition, existing methods are difficult to dynamically adjust the migration strategy during service migration, easily causing service interruptions and affecting the stability of the system and the user experience. It can be seen that the service migration methods in the prior art have problems such as inaccurate prediction, unoptimized paths, and poor dynamic adaptability in vehicle movement scenarios, which are not conducive to the efficient migration of services and the improvement of the user experience. Summary of the Invention
[0004] A series of simplified concepts are introduced in the Summary of the Invention section, which will be further described in detail in the Detailed Description section. The Summary of the Invention section of the present invention does not mean to attempt to define the key features and essential technical features of the claimed technical solution, nor does it mean to attempt to determine the protection scope of the claimed technical solution.
[0005] To solve the technical problems of inaccurate trajectory prediction, unoptimized migration path selection, poor adaptability to dynamic path changes, and large service interruption delays in service migration in vehicle movement scenarios, the present invention provides a service migration method and system based on vehicle trajectory and road network matching.
[0006] In a first aspect, a service migration method based on vehicle trajectory and road network matching is provided, including:
[0007] Obtain urban road network data and vehicle historical driving trajectory data;
[0008] Based on the obtained vehicle historical driving trajectory data as training data, train a trajectory prediction model, and predict the future driving trajectory of the vehicle based on the trained trajectory prediction model;
[0009] Match the future driving trajectory of the vehicle to the actual urban road based on the road network matching algorithm to obtain the future vehicle road driving trajectory;
[0010] Based on the future vehicle road driving trajectory, obtain the minimum-cost migration path, and based on the future driving trajectory of the vehicle, synchronously migrate the service according to the actual movement of the vehicle;
[0011] The urban road network data includes: urban roads, basic attributes of urban roads, topological network structures, and affiliated facilities and points of interest.
[0012] Further, the obtaining of the urban road network data and the vehicle historical driving trajectory data further includes:
[0013] Preprocess the vehicle historical driving trajectory data, including: deleting duplicate vehicle trajectory points, clearing abnormal data, and complementing abnormal data based on linear interpolation method. At the same time, uniformly convert the timestamps of vehicle trajectory points into the standard time format to ensure that the trajectory information is complete and accurately concatenated in chronological order, forming a sequence of position points passed by the vehicle. The standard expression form of vehicle trajectory points is:
[0014] ;
[0015] wherein, represents the standard vehicle trajectory point, is the unique identification code of the vehicle trajectory point, is the vehicle trajectory point number, is the timestamp of the vehicle trajectory point, is the latitude coordinate of the vehicle trajectory point, is the longitude coordinate of the vehicle trajectory point.
[0016] Further, the using of the obtained vehicle historical driving trajectory data as training data includes:
[0017] Based on the timestamps of vehicle trajectory points in the vehicle historical driving trajectory data, classify whether the vehicle trajectory points are on weekdays, and divide them into weekday trajectory data and non-weekday trajectory data;
[0018] The training of the trajectory prediction model includes:
[0019] Using the divided working-day trajectory data and non-working-day trajectory data as the training datasets for each model in the trajectory prediction model, the Root Mean Square Error (RMSE) is used as the loss function to quantify the difference between the prediction and the true value, and the adaptive learning rate and momentum mechanism of the Adam (Adaptive Moment Estimation) optimizer are used to adjust the model parameters to balance the convergence speed and stability.
[0020] Furthermore, the trajectory prediction model is composed of a working-day trajectory prediction model and a non-working-day trajectory prediction model. Among them, the working-day trajectory prediction model is used to predict the future driving trajectory of vehicles on working days, and the non-working-day trajectory prediction model is used to predict the future driving trajectory of vehicles on non-working days.
[0021] Furthermore, the specific functions of the working-day trajectory prediction model include:
[0022] Perform a convolution operation on the time series of the input working-day trajectory data through a convolutional layer to extract local time features;
[0023] Based on the local time features, use BiLSTM (Bidirectional Long Short-Term Memory) to capture global and bidirectional dependencies, and at the same time understand the context information of the past and the future to generate a context vector containing time-dependent information;
[0024] Perform a weighted processing on the context vector containing time-dependent information through an attention mechanism, focus on important time steps and spatial positions, calculate attention scores and weights, and perform a weighted sum to obtain the final output;
[0025] Convert the final output into a prediction result through a fully connected layer to obtain the positions of continuous trajectory points, and obtain the future driving trajectory of the vehicle according to the output order.
[0026] Furthermore, the specific functions of the non-working-day trajectory prediction model include:
[0027] Use a sparse self-attention mechanism to encode the input non-working-day trajectory data to form a context vector;
[0028] Perform effective feature extraction on the context vector based on a feature extraction layer;
[0029] Based on the context vector after feature extraction, perform decoding through a fully connected layer and a multi-head self-attention layer to output a predicted vehicle driving trajectory vector;
[0030] The output layer converts the predicted vehicle driving trajectory vector into a probability index through a linear transformation layer, and uses the Softmax function to convert the probability index into a trajectory distribution probability, obtains the positions of continuous trajectory points, and outputs them in sequence to obtain the future driving trajectory of the vehicle.
[0031] Further, the matching of the future driving trajectory of the vehicle to the actual urban road by the road network matching algorithm includes:
[0032] Converting the obtained urban road network data into an urban graph model;
[0033] Based on the GPS points in the predicted future driving trajectory of the vehicle and the urban graph model, an observation sequence is defined, and the distances from each GPS point in the observation sequence to each road section are calculated one by one, and the road sections with distances less than the distance threshold are selected and included in the candidate road section set;
[0034] Based on the candidate road section set, calculate the observation probabilities of each candidate road section in the candidate road section set;
[0035] Calculate the initial probability based on the first GPS point in the future driving trajectory of the vehicle;
[0036] Based on the candidate road sections respectively matched by the GPS points in the observation sequence, calculate the state transition probability;
[0037] Use the Viterbi recursion to obtain the optimal path that best conforms to the GPS observation and road constraints and use it as the future vehicle road driving trajectory.
[0038] Further, the conversion into an urban graph model includes:
[0039] The nodes represent the intersections in the urban road, the edges represent the connections of the road sections in the urban road, and the urban graph model is represented as: ;
[0040] Wherein, is the set of intersections in the urban road, is the road section in the urban road set, , each road section is the intersection and the intersection the edge between, ;
[0041] The observation sequence is represented as: , which is used to represent the sequence of GPS points in the future driving trajectory of the vehicle arranged in chronological order, where, is the length of the time sequence, and , is the GPS points, including the geographical coordinates of the GPS points, are the longitude and latitude coordinates respectively;
[0042] The candidate road segment set is expressed as: ,in, For GPS points No. candidate sections, The number of road segments in the candidate road segment set for the first GPS point in the future driving trajectory of the vehicle;
[0043] The observation probability is calculated as follows:
[0044] ;
[0045] in, For GPS points Matching candidate road segments The observation probability of , is the candidate road segment set, For GPS points To candidate road section The vertical distance, Parameters that control distance attenuation;
[0046] The initial probability is calculated as follows:
[0047] ;
[0048] in, The first GPS point in the future trajectory of the vehicle Located on the candidate road section The initial probability of is the number of road segments in the candidate road segment set for the first GPS point in the future driving trajectory of the vehicle, , is the candidate road segment set, The first GPS point To candidate road section The vertical distance, Parameters that control distance attenuation;
[0049] The state transition probability is calculated as follows:
[0050] ;
[0051] in, Indicates adjacent GPS points and Match the state transition probability between candidate road segments, is the candidate road segment and the candidate road segment the shortest road network distance between them is the adjacent GPS points and the Euclidean distance between them is the transfer probability sensitive parameter
[0052] Furthermore, the use of Viterbi recursion means using the Viterbi algorithm for recursive path inference, including:
[0053] At , initialization is performed, including: based on the first GPS point in the predicted future driving trajectory of the vehicle , calculate the optimal probability of each candidate road segment
[0054] ;
[0055] Among them, is the optimal probability of the first GPS point matching the candidate road segment , is the initial probability that the first GPS point in the future driving trajectory of the vehicle is located in the candidate road segment , is the first GPS point matching the candidate road segment observation probability;
[0056] For , recursively calculate the optimal probability of each GPS point matching each candidate road segment:
[0057] ;
[0058] Among them, is the optimal probability of the GPS point matching the candidate road segment , is the GPS point matching the candidate road segment observation probability, is the previous GPS point matching the candidate road segment optimal probability, is the adjacent GPS points and the state transition probability between the matching candidate road segments;
[0059] Record the optimal source road segment of each GPS point and construct a backtracking table , , expressed as:
[0060] ;
[0061] Among them, represents the transfer from the previous candidate road section to the current candidate road section , represents the state transition probability between the adjacent GPS points and the matching candidate road section;
[0062] Based on the backtracking table , backtrack point by point to obtain the candidate road section with the optimal probability from the first GPS point to the last GPS point, and obtain the optimal path, which is expressed as: , where represents that the GPS point is located in the candidate road section , , is the observation sequence.
[0063] Furthermore, the obtaining of the minimum-cost migration path based on the future vehicle road driving trajectory includes:
[0064] Obtain the optimal target migration server;
[0065] Obtain the set of available edge servers around the future vehicle road driving trajectory;
[0066] Based on the set of available edge servers, construct a minimum-cost function, and use the Dijkstra algorithm to obtain the minimum-cost migration path.
[0067] Furthermore, the obtaining of the optimal target migration server includes:
[0068] Based on the geographical location of the last GPS point in the future vehicle road driving trajectory, obtain the available edge servers around the last moment, and substitute the parameters and network status information of each edge server into the migration preference function to solve and obtain the optimal target migration server;
[0069] The migration preference function has the following calculation formula:
[0070] ;
[0071] Among them, is the migration preference function, which is used to obtain the migration preference value of the edge server , is the available transmission bandwidth of the edge server , is the connected edge server The number of users, For the GPS points in the future vehicle road driving trajectory And the edge server The physical distance, For the edge server The maximum communication range, For the edge server The remaining computing power, Are the relevant weight parameters of bandwidth, number of users, distance, and computing power respectively. Preferably, The defaults are 0.2, 0.3, 0.3, and 0.2 respectively.
[0072] Further, the construction of the minimum cost function refers to the minimum cost function constructed based on the migration delay, computing delay, and communication delay of the edge server. The calculation formula of the minimum cost function is:
[0073] ;
[0074] Wherein, Is the migration delay, Is the computing delay, Is the communication delay, , , Is the set of available edge servers, Is the current edge server And the previous edge server The hop distance between, Is the data size of the offloading task migration, Is the total hop distance between the current edge server and the optimal target migration server.
[0075] Further, the use of the Dijkstra algorithm to obtain the minimum cost migration path includes:
[0076] Based on the Dijkstra algorithm, find the migration path from the current edge server to the optimal target migration server, calculate the minimum cost function value of each migration path based on the minimum cost function, evaluate the path feasibility, update the path set and the remaining data volume, and iterate until the migration requirement is met or there is no optional path to obtain the minimum cost migration path.
[0077] Further, the synchronization of service migration according to the actual movement of the vehicle includes:
[0078] If the actual movement of the vehicle does not deviate from the future vehicle road driving trajectory, the service will be migrated along the minimum-cost migration path. If the actual movement of the vehicle deviates from the future vehicle road driving trajectory, the future vehicle road driving trajectory of the matching vehicle will be re-predicted, the minimum-cost migration path will be obtained, and the service migration will be redeployed.
[0079] In a second aspect, a service migration system based on vehicle trajectory and road network matching is provided, including: a data acquisition module, a data set construction module, a future trajectory prediction module, a city road network matching module, and a service migration module, characterized in that:
[0080] The data acquisition module is used to obtain urban road network data and vehicle historical driving trajectory data;
[0081] The data set construction module is used to classify whether the vehicle trajectory points are on weekdays based on the timestamps of the vehicle trajectory points in the vehicle historical driving trajectory data, and divide them into weekday trajectory data and non-weekday trajectory data;
[0082] The future trajectory prediction module is used to use the weekday trajectory data and non-weekday trajectory data in the data set construction module as the training data of each model in the trajectory prediction model, train the trajectory prediction model, and predict the future driving trajectory of the vehicle based on the trained trajectory prediction model;
[0083] The city road network matching module is used to match the future driving trajectory of the vehicle to the actual urban road based on the road network matching algorithm to obtain the future vehicle road driving trajectory;
[0084] The service migration module is used to obtain the minimum-cost migration path based on the future vehicle road driving trajectory, and synchronously migrate the service according to the actual movement of the vehicle based on the future driving trajectory of the vehicle.
[0085] Further, the service migration module further includes: an optimal target migration server acquisition sub-module, a minimum-cost migration path acquisition sub-module, and a service migration judgment sub-module;
[0086] The optimal target migration server acquisition sub-module is used to obtain the available edge servers in the vicinity at the last moment according to the geographical location of the last GPS point in the future vehicle road driving trajectory matched by the city road network matching module, and substitute the parameters and network status information of each edge server into the migration preference function to solve and obtain the optimal target migration server;
[0087] The minimum-cost migration path acquisition sub-module is used to obtain the minimum-cost migration path by using the Dijkstra algorithm according to the future vehicle road driving trajectory matched by the city road network matching module;
[0088] The service migration judgment sub-module is used to judge whether the actual movement of the vehicle deviates from the future vehicle road driving trajectory matched by the urban road network matching module. If the actual movement of the vehicle deviates from the future vehicle road driving trajectory, the future vehicle driving trajectory is re-predicted through the future trajectory prediction module, and then the future vehicle road driving trajectory of the vehicle is re-matched by the urban road network matching module, and the minimum-cost migration path is obtained, and the service migration is redeployed; if the actual movement of the vehicle does not deviate from the future vehicle road driving trajectory, the service is migrated along the minimum-cost migration path.
[0089] The beneficial effects of the present invention are as follows:
[0090] A service migration method based on vehicle trajectory and road network matching provided by the present invention can improve the accuracy of predicting the future driving trajectory of a vehicle and adapt to the traffic pattern differences in different time periods by constructing a time-segmented trajectory prediction model according to the traffic pattern differences in different time periods.
[0091] A service migration method based on vehicle trajectory and road network matching provided by the present invention can accurately obtain the driving trajectory of a future vehicle on a real road by using a road network matching algorithm to match the predicted future driving trajectory of the vehicle to the actual urban road, enhancing the reliability of path planning.
[0092] A service migration method based on vehicle trajectory and road network matching provided by the present invention can optimize the selection of the service migration path, reduce the delay and resource consumption during the migration process, and improve the service continuity in the edge computing environment by selecting the optimal target migration server through a migration preference function and using the Dijkstra algorithm to obtain the migration path of the minimum-cost function value. Description of the Drawings
[0093] Figure 1 is a schematic flow chart of a service migration method based on vehicle trajectory and road network matching provided by an embodiment of the present invention.
[0094] Figure 2 is a schematic flow chart of obtaining the minimum-cost migration path based on the Dijkstra algorithm provided by an embodiment of the present invention.
[0095] Figure 3 is a schematic structural diagram of a trajectory prediction model provided by an embodiment of the present invention.
[0096] Figure 4 is a schematic diagram of a service migration system based on vehicle trajectory and road network matching provided by an embodiment of the present invention. Detailed Embodiments
[0097] The following elaborates on the preferred embodiments of the present invention in conjunction with the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0098] The historical trajectory data of users has significant spatio-temporal correlation, which is jointly affected by the user's movement pattern, road network structure, and environmental factors. Due to the spatial distribution characteristics of the trajectory, the optimal path of service migration also has certain regularity, and this implicit association is often not fully utilized.
[0099] In a complex urban traffic environment, the uncertainty of vehicle movement increases, the amount of trajectory data is huge, data noise increases, and at the same time, the influence of the topological structure of the road network on service migration is more complex. These factors make the traditional service migration method have obvious deficiencies in terms of the real-time performance, accuracy, and resource utilization efficiency of migration decision-making. Therefore, it is urgent to introduce new theories and technical means to improve the reliability and efficiency of the service migration scheme based on trajectory prediction, especially in a dynamically changing mobile edge environment, to ensure service continuity and optimize the user experience.
[0100] The service migration method based on vehicle trajectory and road network matching can analyze and mine the user's trajectory data in a mobile edge environment, predict the user's future location in advance during the user's movement, and provide an optimized solution for service migration.
[0101] The specific implementation of the technical solution of the present invention includes the following content:
[0102] Embodiment 1
[0103] A service migration method based on vehicle trajectory and road network matching involved in Embodiment 1 of the present invention includes:
[0104] Obtain urban road network data and vehicle historical driving trajectory data; use the obtained vehicle historical driving trajectory data as training data to train a trajectory prediction model, and predict the future driving trajectory of the vehicle based on the trained trajectory prediction model; match the future driving trajectory of the vehicle to the actual urban road using a road network matching algorithm to obtain the future vehicle road driving trajectory; based on the future vehicle road driving trajectory, obtain the minimum-cost migration path, and synchronously migrate the service according to the actual movement of the vehicle based on the future driving trajectory of the vehicle.
[0105] Specifically, Figure 1 The flowchart of a service migration method based on vehicle trajectory and road network matching in Application Embodiment 1 is shown, including:
[0106] S1. Obtain urban road network data and vehicle historical driving trajectory data.
[0107] The acquisition of urban road network data and vehicle historical driving trajectory data described in step S1 further includes:
[0108] The urban road network data includes: urban roads, basic attributes of urban roads, topological network structures, and affiliated facilities and points of interest.
[0109] Preprocessing the vehicle historical driving trajectory data includes: deleting duplicate vehicle trajectory points, clearing abnormal data, and complementing abnormal data based on linear interpolation method. At the same time, uniformly convert the timestamps of vehicle trajectory points into standard time formats to ensure that the trajectory information is complete and accurately concatenated in chronological order, forming a sequence of position points passed by the vehicle. The standard expression form of vehicle trajectory points is:
[0110] ;
[0111] Wherein, represents a standard vehicle trajectory point, is the unique identification code of the vehicle trajectory point, is the vehicle trajectory point number, is the timestamp of the vehicle trajectory point, is the latitude coordinate of the vehicle trajectory point, is the longitude coordinate of the vehicle trajectory point.
[0112] Exemplarily, in the embodiment of the present invention, the vehicle historical driving trajectory data is sourced from the actual GPS tracking records in Shanghai in 2007. The dataset shows 7 features including: taxi ID, time, longitude, latitude, included angle, instantaneous speed, and taxi passenger-carrying status; the urban road network data is based on Shanghai, and the longitude range of Shanghai is: 120°52′ to 122°16′ east longitude; the latitude range is: 30°42′ to 31°48′ north latitude. Preprocessing the vehicle historical driving trajectory data includes: standardizing the trajectory points recorded in the vehicle's historical trajectory data, removing redundant features, for example: "[aID=123, aNum=1, aTime=2007-02-20 04:33:12, aLon=121.468600, aLat=31.335000]". Deleting duplicate trajectory points includes: if duplicate trajectory points appear during the trajectory recording process and the longitude and latitude values of consecutive trajectory points are the same, then remove these duplicate data and retain the most representative trajectory points. For example, if the positions are almost the same for two consecutive minutes, the second point can be regarded as duplicate and deleted. Removing abnormal data includes: abnormal data includes that the trajectory points of the vehicle jump too much, or the trajectory points are located outside Shanghai. At the same time, according to the valid trajectory points before and after the trajectory abnormal point, linearly calculate the position of the missing point in time, and use the linear interpolation method to complement the abnormal trajectory point.
[0113] S2. Use the obtained vehicle historical driving trajectory data as training data to train a trajectory prediction model, and predict the future driving trajectory of the vehicle based on the trained trajectory prediction model.
[0114] In step S2, using the obtained vehicle historical driving trajectory data as training data includes:
[0115] Classify whether the vehicle trajectory points are on weekdays based on the timestamps of the vehicle trajectory points in the vehicle historical driving trajectory data, and divide them into weekday trajectory data and non-weekday trajectory data;
[0116] Training the trajectory prediction model includes:
[0117] Using the divided weekday trajectory data and non-weekday trajectory data as the training data sets of each model in the trajectory prediction model, using RMSE as the loss function to quantify the difference between the prediction and the true value, and adjusting the model parameters through the adaptive learning rate and momentum mechanism of the Adam optimizer to balance the convergence speed and stability.
[0118] In step S2, the trajectory prediction model is composed of a weekday trajectory prediction model and a non-weekday trajectory prediction model. Among them, the weekday trajectory prediction model is used to predict the future driving trajectory of the vehicle on weekdays, and the non-weekday trajectory prediction model is used to predict the future driving trajectory of the vehicle on non-weekdays.
[0119] Specifically, the specific functions of the weekday trajectory prediction model include:
[0120] Perform a convolution operation on the time series of the input weekday trajectory data through a convolution layer to extract local time features;
[0121] Based on the local time features, use BiLSTM to capture global and bidirectional dependencies, and at the same time understand the context information of the past and the future, and generate a context vector containing time-dependent information;
[0122] Perform a weighted process on the context vector containing time-dependent information through an attention mechanism, focus on important time steps and spatial positions, calculate the attention scores and weights, and perform a weighted sum to obtain the final output;
[0123] Convert the final output into a prediction result through a fully connected layer to obtain the positions of continuous trajectory points, and obtain the future driving trajectory of the vehicle according to the output order.
[0124] Specifically, the specific functions of the non-weekday trajectory prediction model include:
[0125] Encode the input non - working - day trajectory data using a sparse self - attention mechanism to form a context vector;
[0126] Perform effective feature extraction on the context vector based on the feature extraction layer;
[0127] Decode the context vector after feature extraction through a fully - connected layer and a multi - head self - attention layer to output a predicted vehicle driving trajectory vector;
[0128] The output layer converts the predicted vehicle driving trajectory vector into a probability index through a linear transformation layer, and uses a Softmax layer to convert the probability index into a trajectory distribution probability, obtains the positions of continuous trajectory points, and outputs in sequence to obtain the future driving trajectory of the vehicle.
[0129] S3. Match the future driving trajectory of the vehicle to the actual urban road based on a road network matching algorithm to obtain the future vehicle road driving trajectory.
[0130] In step S3, the process of matching the future driving trajectory of the vehicle to the actual urban road based on a road network matching algorithm to obtain the future vehicle road driving trajectory includes:
[0131] S3.1. Convert the obtained urban road network data into an urban graph model;
[0132] S3.2. Based on the GPS points in the predicted future driving trajectory of the vehicle and the urban graph model, define an observation sequence, calculate the distance from each GPS point in the observation sequence to each road section one by one, and select the road sections with a distance less than the distance threshold to be included in the candidate road section set;
[0133] S3.3. Calculate the observation probabilities of each candidate road section in the candidate road section set;
[0134] S3.4. Calculate the initial probability based on the first GPS point in the future driving trajectory of the vehicle;
[0135] S3.5. Calculate the state transition probability based on the candidate road sections respectively matched by the GPS points in the observation sequence;
[0136] S3.6. Use the Viterbi recursion to obtain the optimal path that best conforms to the GPS observations and road constraints and use it as the future vehicle road driving trajectory.
[0137] Specifically, the conversion into an urban graph model in step S3.1 includes:
[0138] Nodes represent intersections in urban roads, edges represent road section connections in urban roads, and the urban graph model is represented as: ;
[0139] Where, is a set of intersections in urban roads, is a section of urban road set, , each section is an intersection and intersection is the edge between, ;
[0140] The observed sequence is expressed as: , which is used to represent the sequence of GPS points in the future driving trajectory of the vehicle arranged in chronological order, where, is the length of the time series, and , is the th GPS point, including the geographical coordinates of the GPS point, are the longitude coordinate and the latitude coordinate respectively.
[0141] Specifically, the observed sequence described in step S3.2 is expressed as: , which is used to represent the sequence of GPS points in the future driving trajectory of the vehicle arranged in chronological order, where, is the length of the time series, and , is the th GPS point, including the geographical coordinates of the GPS point, are the longitude coordinate and the latitude coordinate respectively;
[0142] The candidate section set is expressed as: , where, is the GPS point 's th candidate section, is the number of sections in the candidate section set of the first GPS point in the future driving trajectory of the vehicle.
[0143] Specifically, the observed probability described in step S3.3 is calculated by the formula:
[0144] ;
[0145] Among them, is the observed probability that the GPS point matches the candidate section , , is the candidate section set, is the GPS point to the candidate section 's vertical distance, is the parameter to control the distance attenuation.
[0146] Specifically, for the initial probability described in step S3.4, the calculation formula is:
[0147] ;
[0148] wherein, is the first GPS point in the future driving trajectory of the vehicle located in the candidate section of the initial probability, is the number of sections in the candidate section set of the first GPS point in the future driving trajectory of the vehicle, , is the candidate section set, is the first GPS point to the candidate section of the vertical distance, is a parameter for controlling the distance attenuation.
[0149] Specifically, for the state transition probability described in step S3.5, the calculation formula is:
[0150] ;
[0151] wherein, represents the state transition probability between the adjacent GPS points and matching candidate sections, is the shortest road network distance between the candidate section and the candidate section , is the Euclidean distance between the adjacent GPS points and , is a transfer probability sensitive parameter.
[0152] Specifically, the Viterbi recursion described in step S3.6 refers to using the Viterbi algorithm for recursive path inference, including:
[0153] At , initialization is performed, including: based on the first GPS point predicted in the future driving trajectory of the vehicle, calculate the optimal probability of each candidate section;
[0154] ;
[0155] wherein, is the optimal probability of the first GPS point matching the candidate section , is the first GPS point in the future driving trajectory of the vehicle Located on the candidate road section The initial probability of The first GPS point Matching candidate road segments The probability of observation;
[0156] for , recursively calculate the optimal probability of each GPS point matching each candidate road segment:
[0157] ;
[0158] in, For GPS points Matching candidate road segments The optimal probability of For GPS points Matching candidate road segments The observation probability of The last GPS point Matching candidate road segments The optimal probability of For adjacent GPS points and Match the state transition probability between candidate road segments;
[0159] Record the optimal source road section for each GPS point and build a backtracking table , , expressed as:
[0160] ;
[0161] in, Indicates the number of candidate road segments from the previous one Transfer to the current candidate segment , Indicates adjacent GPS points and Match the state transition probability between candidate road segments;
[0162] Based on the lookback table , backtrack point by point, obtain the candidate road segment with the best probability from the first GPS point to the last GPS point, and get the optimal path, which is expressed as: ,in, Indicates a GPS point Located on the candidate road section , , is the observation sequence.
[0163] S4. Based on the future vehicle road driving trajectory, a minimum cost migration path is obtained, and based on the future vehicle driving trajectory and the actual movement of the vehicle, the service is synchronously migrated.
[0164] The step S4 of obtaining a minimum cost migration path based on the future vehicle road trajectory includes:
[0165] S4.1. Obtain the optimal target migration server;
[0166] S4.2. Obtain a set of available edge servers around the future vehicle road trajectory;
[0167] S4.3. Based on the set of available edge servers, a minimum cost function is constructed, and a minimum cost migration path is obtained using the Dijkstra algorithm.
[0168] Specifically, obtaining the optimal target migration server in step S4.1 includes:
[0169] Based on the geographic location of the last GPS point in the future vehicle's road trajectory, the available edge servers in the surrounding area at the last moment are obtained, and the parameters and network status information of each edge server are substituted into the migration optimization function to solve and obtain the optimal target migration server;
[0170] The migration optimization function is calculated as follows:
[0171] ;
[0172] in, Migration optimization function for obtaining edge servers The migration preference value of For edge servers Available transmission bandwidth, Connected Edge Server The number of users, is the GPS point in the future vehicle road trajectory With edge servers physical distance, For edge servers The maximum communication range, For edge servers Remaining computing power, They are the weight parameters related to bandwidth, number of users, distance, and computing power. The defaults are 0.2, 0.3, 0.3, and 0.2 respectively.
[0173] For example, in the embodiment of the present invention, the geographical location of the last GPS point of the future vehicle road driving trajectory is (31.237872, 121.470259), and the available edge servers around the location are obtained: edge servers , the number of user connections is 50, the bandwidth is 200 Mbps, the remaining computing power is 500 GFLOPS, the maximum communication range is 500 m, vehicle to edge server The physical distance is 200 m; edge server , the number of user connections is 50, the bandwidth is 300 Mbps, the remaining computing power is 700 GFLOPS, the maximum communication range is 600 m, vehicle to edge server The physical distance is 250 m; edge server , the number of user connections is 100, the bandwidth is 50 Mbps, the remaining computing power is 600 GFLOPS, the maximum communication range is 550 m, vehicle to edge server The physical distance is 180 m; They are 0.3, 0.3, 0.2, 0.2 respectively. According to the migration preference function, calculate the migration preference function values of each available edge server value, edge server The migration preference value of is 1.02, edge server The migration preference value of is 0.58, edge server The migration preference value of is 0.85. Therefore, edge server is used as the optimal target migration server.
[0174] Specifically, the construction of the minimum cost function described in step S4.3 refers to the minimum cost function constructed based on the migration delay, computing delay and communication delay of the edge server. The specific calculation formula of the minimum cost function is:
[0175] ;
[0176] Among them, is the migration delay, is the computing delay, is the communication delay, , , is the set of available edge servers, is the current edge server and the previous edge server The hop distance between them, is the data size of the offloading task migration, is the total hop distance between the current edge server and the optimal target migration server.
[0177] Furthermore, the migration delay, the calculation formula is:
[0178] ;
[0179] Among them, is the migration delay, Is the current edge server With the previous edge server The jump distance between is the migration delay coefficient;
[0180] The communication delay includes: the access delay between the mobile vehicle and the current edge server, and the return delay between the current edge server and the adjacent edge server. , communication delay , the calculation formula is:
[0181] ;
[0182] ;
[0183] in, For access delay, For return delay, The size of data migrated for the offload task, is the total hop distance between the current edge server and the optimal target migration server, is the average upload rate of the wireless channel;
[0184] The return delay is calculated as follows:
[0185] ;
[0186] in, For return delay, is the total hop distance between the current edge server and the optimal target migration server, is the bandwidth of the current edge server outgoing link, is the coefficient of return delay;
[0187] The calculation delay is calculated as follows:
[0188] ;
[0189] in, The CPU execution cycles required to perform the offload task, For edge servers workload, For edge servers The remaining computing power.
[0190] Specifically, the method of using the Dijkstra algorithm to find the minimum cost migration path in step S4.3 includes:
[0191] Find the migration path from the current edge server to the optimal target migration server based on the Dijkstra algorithm, calculate the minimum cost function values of each migration path based on the minimum cost function, evaluate the path feasibility, update the path set and the remaining data volume, and iterate until the migration requirement is met or there are no selectable paths to obtain the minimum cost migration path.
[0192] The synchronous migration of services according to the actual movement of the vehicle includes:
[0193] If the actual movement of the vehicle does not deviate from the future vehicle road driving trajectory, then migrate the service along the minimum cost migration path. If the actual movement of the vehicle deviates from the future vehicle road driving trajectory, then re-predict the future vehicle road driving trajectory of the matching vehicle, obtain the minimum cost migration path, and redeploy the service migration.
[0194] Specifically, as Figure 2 shown, the schematic flow chart of obtaining the minimum cost migration path based on the Dijkstra algorithm involved in Embodiment 1 of the present application specifically includes:
[0195] a1. Initialize the transmission path set S, including: Initialize the transmission path set as an empty set;
[0196] a2. Construct a weighted graph, including: Regarding the nodes and links in the network as a weighted graph, where the minimum cost function value of the link is used as the weight;
[0197] a3. Use the Dijkstra algorithm to find the shortest path , including: Use the Dijkstra algorithm to find the shortest path from to in the weighted graph ;
[0198] a4. Check whether the path exists, including: If the path does not exist, then return an empty set and an invalid time;
[0199] a5. Calculate the minimum bandwidth and the actual transmission time of the path , including: Calculate the minimum bandwidth of all links on the path , and calculate the actual transmission time according to the data volume and the total bandwidth ;
[0200] a6. Determine whether the path s meets the conditions, including: Regarding the path Add to the path set In the case where, if the path The minimum bandwidth of multiplied by the time threshold Is greater than the data volume , then return the path set And the time threshold , otherwise update the bandwidth on the path and continue to iteratively search for a new path;
[0201] a7. Update the remaining data volume Determine whether the conditions are met, including: updating the remaining data volume to be transmitted , continue to iteratively search for a new path until the conditions are met or there is no available path, and return the link with the minimum cost function value;
[0202] a8. Return the link with the minimum cost function value, that is, the minimum cost migration path.
[0203] Embodiment 2
[0204] As Figure 3 Shown, the schematic structural diagram of the trajectory prediction model involved in Embodiment 2 of the present application includes a weekday trajectory prediction model and a non-weekday trajectory prediction model;
[0205] Specifically, the weekday trajectory prediction model is constructed based on the BiLSTM model, and the non-weekday trajectory prediction model is constructed based on the Informer model;
[0206] Further, the weekday trajectory prediction model includes:
[0207] S211. Perform a convolution operation on the time series of the input weekday trajectory data through a convolution layer, and extract the correlation between consecutive time steps to obtain the local time features of the weekday trajectory data. The calculation formula is:
[0208] ;
[0209] Among them, Is the convolution kernel, Is the weight matrix of the convolution kernel, Is the loop variable inside the convolution kernel, Is the number of time steps covered by the convolution kernel, Represents the sliding window data of the input time series at the time step of , Is the bias term of the convolution layer, Is the output feature, ;
[0210] S212. For the local time features obtained in step S211, dimensionality reduction is then performed through the max pooling operation of the pooling layer, and then some neurons are randomly discarded through the dropout layer to prevent overfitting, obtaining the filtered local time features;
[0211] S213. The BiLSTM layer captures the global and bidirectional dependencies of the filtered local time features obtained in step S212, transmits information bidirectionally (forward and backward), and simultaneously understands the context information of the past and the future, outputting a context vector containing time-dependent information, expressed as:
[0212] ;
[0213] where, is the hidden state of the forward LSTM, is the hidden state of the backward LSTM;
[0214] S214. Based on the context vector output in step S212, the attention layer focuses on the most important time steps and spatial positions of the historical trajectory data. By calculating the weights between time steps, the attention mechanism assigns a weight value to each moment to obtain which moments or positions have the greatest impact on the final prediction result, and then outputs the weighted information;
[0215] S215. The fully connected layer converts the weighted information output in S213 into a prediction result, obtaining the positions of future consecutive trajectory points. The calculation formula is:
[0216] ;
[0217] where, is the predicted future driving trajectory of the vehicle, is the weight matrix of the fully connected layer, is the weighted information, is the bias term.
[0218] Exemplarily, in this embodiment, the BiLSTM model adopted by the weekday trajectory prediction model uses a two-layer BiLSTM structure, and each BiLSTM layer has 120 nodes for calculation; a Dropout layer is connected after each BiLSTM layer to avoid overfitting. After the second BiLSTM layer, an attention layer is connected. The attention mechanism will assign weights to each moment according to the importance of time information, and then transmit the result of the attention layer to the fully connected layer to convert the output value of the attention layer into a prediction value, and then output the prediction value. At the same time, the Adam optimizer is used to optimize the model parameters to obtain the weekday trajectory prediction model.
[0219] Furthermore, the non-weekday trajectory prediction model includes:
[0220] An encoder is used to encode the input non-working-day trajectory data to form a context vector; effective feature extraction is performed on the context vector based on a feature extraction layer; decoding is performed on the context vector after feature extraction through a fully connected layer and a multi-head self-attention layer with several layers, and finally a predicted vehicle driving trajectory vector is output; the predicted vehicle driving trajectory vector is converted into a probability index through a linear transformation layer, and the probability index is converted into a trajectory distribution probability using a Softmax function, and then the trajectory distribution probability is converted into a predicted value through a fully connected layer, and then the predicted value is output to obtain the positions of continuous trajectory points, and the future driving trajectory of the vehicle is obtained by outputting in sequence.
[0221] Embodiment 3
[0222] As Figure 4 shown, a service migration system based on vehicle trajectory and road network matching involved in Embodiment 3 of the present application includes:
[0223] Including: a data acquisition module, a data set construction module, a future trajectory prediction module, a city road network matching module, and a service migration module, characterized in that:
[0224] The data acquisition module is used to obtain urban road network data and vehicle historical driving trajectory data;
[0225] The data set construction module is used to classify whether the vehicle trajectory points are on working days based on the timestamps of the vehicle trajectory points in the vehicle historical driving trajectory data, and divide them into working-day trajectory data and non-working-day trajectory data;
[0226] The future trajectory prediction module is used to use the working-day trajectory data and non-working-day trajectory data in the data set construction module as the training data of each model in the trajectory prediction model, train the trajectory prediction model, and predict the future driving trajectory of the vehicle based on the trained trajectory prediction model;
[0227] The city road network matching module is used to match the future driving trajectory of the vehicle to the actual urban road based on a road network matching algorithm to obtain the future vehicle road driving trajectory;
[0228] The service migration module is used to obtain the minimum-cost migration path based on the future vehicle road driving trajectory, and synchronously migrate the service according to the actual movement of the vehicle based on the future driving trajectory of the vehicle.
[0229] Specifically, the service migration module further includes: an optimal target migration server acquisition sub-module, a minimum-cost migration path acquisition sub-module, and a service migration judgment sub-module;
[0230] The optimal target migration server acquisition sub-module is configured to obtain the last GPS point's geographical location in the future vehicle road driving trajectory matched by the urban road network matching module, acquire the available edge servers in the vicinity at the last moment, substitute the parameters and network status information of each edge server into the migration optimization function, and solve to obtain the optimal target migration server;
[0231] The minimum-cost migration path acquisition sub-module is configured to use the Dijkstra algorithm to obtain the minimum-cost migration path according to the future vehicle road driving trajectory matched by the urban road network matching module;
[0232] The service migration judgment sub-module is configured to determine whether the actual movement of the vehicle deviates from the future vehicle road driving trajectory matched by the urban road network matching module. If the actual movement of the vehicle deviates from the future vehicle road driving trajectory, the future vehicle driving trajectory is re-predicted through the future trajectory prediction module, then the future vehicle road driving trajectory of the vehicle is re-matched by the urban road network matching module, and the minimum-cost migration path is obtained, and the service migration is redeployed; if the actual movement of the vehicle does not deviate from the future vehicle road driving trajectory, the service is migrated along the minimum-cost migration path.
[0233] The specific implementation method of this embodiment is the same as that of Embodiment 1 and will not be elaborated here. For details, refer to the description of Embodiment 1.
[0234] 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.
[0235] 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 cause the essence of the corresponding technical solutions to 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 vehicle trajectory and road network matching, characterized in that The above includes: Obtaining urban road network data and historical vehicle driving trajectory data; Based on the obtained historical vehicle driving trajectory data as training data, training a trajectory prediction model, and predicting the future driving trajectory of the vehicle based on the trained trajectory prediction model; Based on a road network matching algorithm, matching the future driving trajectory of the vehicle to the actual urban road to obtain the future vehicle road driving trajectory; Based on the future vehicle road driving trajectory, obtaining the minimum-cost migration path, and based on the future driving trajectory of the vehicle, synchronously migrating the service according to the actual movement of the vehicle; The urban road network data includes: urban roads, basic attributes of urban roads, topological network structures, and affiliated facilities and points of interest; The trajectory prediction model is composed of a weekday trajectory prediction model and a non-weekday trajectory prediction model. Among them, the weekday trajectory prediction model is used to predict the future driving trajectory of the vehicle on weekdays, and the non-weekday trajectory prediction model is used to predict the future driving trajectory of the vehicle on non-weekdays; The specific functions of the weekday trajectory prediction model include: Performing a convolution operation on the time series of the input weekday trajectory data through a convolutional layer to extract local time features; Based on the local time features, using a BiLSTM to capture global and bidirectional dependencies, and at the same time understand the context information of the past and the future, to generate a context vector containing time-dependent information; Performing a weighted process on the context vector containing time-dependent information through an attention mechanism, focusing on important time steps and spatial positions, calculating attention scores and weights, and performing a weighted sum to obtain the final output; Converting the final output into a prediction result through a fully connected layer to obtain the positions of continuous trajectory points, and obtaining the future driving trajectory of the vehicle according to the output order; The specific functions of the non-weekday trajectory prediction model include: Using a sparse self-attention mechanism to encode the input non-weekday trajectory data to form a context vector; Performing effective feature extraction on the context vector based on a feature extraction layer; Based on the context vector after feature extraction, performing decoding through a fully connected layer and a multi-head self-attention layer to output a predicted vehicle driving trajectory vector; The output layer converts the predicted vehicle driving trajectory vector into a probability index through a linear transformation layer, and uses the Softmax function to convert the probability index into a trajectory distribution probability, obtains the positions of continuous trajectory points, and outputs them in order to obtain the future driving trajectory of the vehicle; The matching of the future driving trajectory of the vehicle to the actual urban road based on the road network matching algorithm to obtain the future vehicle road driving trajectory includes: Converting the obtained urban road network data into an urban graph model; Based on the GPS points in the predicted future driving trajectory of the vehicle and the urban graph model, defining an observation sequence, calculating the distance from each GPS point in the observation sequence to each road section one by one, and selecting the road sections with a distance less than the distance threshold to be included in the candidate road section set; Based on the candidate road section set, calculating the observation probabilities of each candidate road section in the candidate road section set; Calculating the initial probability based on the first GPS point in the future driving trajectory of the vehicle; Calculate the state transition probability based on the candidate road segments respectively matched by the GPS points in the observation sequence; Use the Viterbi recursion to obtain the optimal path that best matches the observations and road constraints and use it as the future vehicle road driving trajectory; The use of Viterbi recursion refers to using the Viterbi algorithm for recursive path inference, including: At this time, initialization is performed, including: calculating the optimal probability of each candidate road segment based on the first GPS point in the predicted future driving trajectory of the vehicle , and calculating the optimal probability of each candidate road segment; ; wherein, is the first GPS point matching candidate road segments optimal probability, is the first GPS point in the future driving trajectory of the vehicle located in the candidate road segment initial probability, is the first GPS point matching candidate road segments observation probability; For , recursively calculate the optimal probability of each GPS point matching each candidate road segment: ; Among them, is a GPS point and the optimal probability of matching the candidate road segment is the observation probability of the GPS point matching the candidate road segment is the optimal probability of the previous GPS point matching the candidate road segment is the state transition probability between the adjacent GPS point and the candidate road segment it matches; Record the optimal source road sections for each GPS point and construct a backtracking table , , expressed as: ; Among them, represents the transfer from the previous candidate road segment to the current candidate road segment , represents the state transition probability between adjacent GPS points and the matching candidate road segments; Based on the backtracking table , backtrack point by point to obtain the candidate road segments with the optimal probability from the first GPS point to the last GPS point, and obtain the optimal path, expressed as: , where represents the GPS point is located on the candidate road segment , , is the observation sequence.
2. A service migration method based on vehicle trajectory and road network matching according to claim 1, characterized in that: The acquisition of the urban road network data and the vehicle historical driving trajectory data further includes: Preprocess the vehicle historical driving trajectory data, including: deleting duplicate vehicle trajectory points, clearing abnormal data, and complementing the abnormal data based on linear interpolation method. At the same time, uniformly convert the timestamps of the vehicle trajectory points into the standard time format to ensure that the trajectory information is complete and accurately concatenated in chronological order, forming a sequence of position points passed by the vehicle. The standard vehicle trajectory point is expressed as: ; Among them, represents the standard vehicle trajectory point, is the unique identification code of the vehicle trajectory point, is the vehicle trajectory point number, is the timestamp of the vehicle trajectory point, is the latitude coordinate of the vehicle trajectory point, is the longitude coordinate of the vehicle trajectory point.
3. A service migration method based on vehicle trajectory and road network matching according to claim 1, characterized in that: The use of the acquired vehicle historical driving trajectory data as training data includes: Based on the timestamps of the vehicle trajectory points in the vehicle historical driving trajectory data, classify whether the vehicle trajectory points are on weekdays, and divide them into weekday trajectory data and non-weekday trajectory data; The training of the trajectory prediction model includes: Based on the divided weekday trajectory data and non-weekday trajectory data as the training data sets of each model in the trajectory prediction model, use RMSE as the loss function to quantify the difference between the prediction and the true value, and adjust the model parameters through the adaptive learning rate and momentum mechanism of the Adam optimizer to balance the convergence speed and stability.
4. A service migration method based on vehicle trajectory and road network matching according to claim 1, characterized in that: The conversion into a city graph model includes: Nodes represent intersections in urban roads, and edges represent the connections of road segments in urban roads. The urban graph model is represented as: ; Among them, is the set of intersections in urban roads, is the set of road segments in urban roads, , and each road segment is the edge between intersection and intersection ; The observed sequence, denoted as: , is used to represent the sequence of GPS points in the future driving trajectory of the vehicle arranged in chronological order, where is the length of the time series, and , is the -th GPS point, including the geographical coordinates of the GPS point, being the longitude coordinate and the latitude coordinate respectively; The candidate road segment set is expressed as: , where is a GPS point the th candidate road segment, is the number of road segments in the candidate road segment set of the first GPS point in the future driving trajectory of the vehicle; The observation probability, the calculation formula is: ; Among them, is a GPS point is the observation probability of the matching candidate road segment , , is the candidate road segment set is the GPS point to the candidate road segment is the vertical distance is the parameter for controlling the distance attenuation; The initial probability, the calculation formula is: ; wherein, is the first GPS point in the future driving trajectory of the vehicle is located in the candidate road section initial probability is the number of road sections in the candidate road section set of the first GPS point in the future driving trajectory of the vehicle , is the candidate road section set is the first GPS point to the candidate road section vertical distance is a parameter for controlling distance attenuation; The state transition probability, the calculation formula is: ; Among them, represents the state transition probability between adjacent GPS points and the matching candidate road segments, is the candidate road segment and the candidate road segment the shortest road network distance between them, is the adjacent GPS point and the Euclidean distance between them, is the transition probability sensitive parameter.
5. A service migration method based on vehicle trajectory and road network matching according to claim 1, characterized in that: Based on the future vehicle road driving trajectory, obtain the minimum-cost migration path, including: Obtain the optimal target migration server; Obtain the set of available edge servers around the future vehicle road driving trajectory; Based on the set of available edge servers, construct a minimum-cost function, and use the Dijkstra algorithm to obtain the minimum-cost migration path.
6. A service migration method based on vehicle trajectory and road network matching according to claim 5, characterized in that: The acquisition of the optimal target migration server includes: Based on the geographical location of the last GPS point in the future vehicle road driving trajectory, obtain the available edge servers around the last moment, and substitute the parameters and network status information of each edge server into the migration preference function to solve and obtain the optimal target migration server; The migration preference function, the calculation formula is: ; Among them, is the migration preference function, which is used to obtain the migration preference value of the edge server, is the available transmission bandwidth of the edge server , is the number of users connected to the edge server , is the physical distance between the GPS point in the future vehicle road driving trajectory and the edge server , is the maximum communication range of the edge server , is the remaining computing power of the edge server , are the relevant weight parameters of bandwidth, number of users carried, distance, and computing power respectively.
7. A service migration method based on vehicle trajectory and road network matching according to claim 5, characterized in that: Said construction of the minimum cost function refers to the minimum cost function constructed based on the migration delay, computing delay, and communication delay of the edge server. The calculation formula of the minimum cost function is as follows: ; Among them, is the migration delay, is the computing delay, is the communication delay, , , is the set of available edge servers, is the current edge server and the previous edge server the hop distance between them, is the data size of the offloading task migration, is the total hop distance between the current edge server and the optimal target migration server.
8. A service migration method based on vehicle trajectory and road network matching according to claim 5, characterized in that: Said using the Dijkstra algorithm to obtain the minimum cost migration path includes: Finding the migration path from the current edge server to the optimal target migration server based on the Dijkstra algorithm, calculating the minimum cost function values of each migration path based on the minimum cost function, evaluating the path feasibility, updating the path set and the remaining data volume, and iterating until the migration requirement is met or there is no optional path to obtain the minimum cost migration path.
9. A service migration method based on vehicle trajectory and road network matching according to claim 1, characterized in that: Said synchronously migrating the service according to the actual movement of the vehicle includes: If the actual movement of the vehicle does not deviate from the future vehicle road driving trajectory, the service is migrated along the minimum cost migration path. If the actual movement of the vehicle deviates from the future vehicle road driving trajectory, the future vehicle road driving trajectory of the matching vehicle is re-predicted, the minimum cost migration path is obtained, and the service migration is redeployed.
10. A service migration system based on vehicle trajectory and road network matching, comprising: A data acquisition module, a data set construction module, a future trajectory prediction module, a city road network matching module, and a service migration module, characterized in that: Said data acquisition module is used to obtain city road network data and vehicle historical driving trajectory data; Said data set construction module is used to classify whether the vehicle trajectory points are on weekdays based on the timestamps of the vehicle trajectory points in the vehicle historical driving trajectory data, and divide them into weekday trajectory data and non-weekday trajectory data; Said future trajectory prediction module is used to use the weekday trajectory data and non-weekday trajectory data in the data set construction module as the training data of each model in the trajectory prediction model, train the trajectory prediction model, and predict the future driving trajectory of the vehicle based on the trained trajectory prediction model; Said city road network matching module is used to match the future driving trajectory of the vehicle to the actual city road based on the road network matching algorithm to obtain the future vehicle road driving trajectory; Said service migration module is used to obtain the minimum cost migration path based on the future vehicle road driving trajectory, and synchronously migrate the service according to the actual movement of the vehicle based on the future driving trajectory of the vehicle; Said service migration module further includes: an optimal target migration server acquisition sub-module, a minimum cost migration path acquisition sub-module, and a service migration judgment sub-module; Said optimal target migration server acquisition sub-module is used to obtain the available edge servers around at the last moment according to the geographical location of the last GPS point in the future vehicle road driving trajectory matched by the city road network matching module, and substitute the parameters and network status information of each edge server into the migration preference function to solve and obtain the optimal target migration server; The minimum-cost migration path acquisition sub-module is used to obtain the minimum-cost migration path by using the Dijkstra algorithm according to the future vehicle road driving trajectory matched by the urban road network matching module; The service migration judgment sub-module is used to judge whether the actual movement of the vehicle deviates from the future vehicle road driving trajectory matched by the urban road network matching module. If the actual movement of the vehicle deviates from the future vehicle road driving trajectory, the future vehicle driving trajectory is re-predicted through the future trajectory prediction module, and then the future vehicle road driving trajectory of the vehicle is re-matched by using the urban road network matching module, and the minimum-cost migration path is obtained, and the service migration is redeployed; if the actual movement of the vehicle does not deviate from the future vehicle road driving trajectory, the service is migrated along the minimum-cost migration path; The specific functions of the weekday trajectory prediction model include: Performing a convolution operation on the time series of the input weekday trajectory data through a convolutional layer to extract local time features; Based on the local time features, using BiLSTM to capture global and bidirectional dependencies, and at the same time understand the past and future context information to generate a context vector containing time-dependent information; Performing weighted processing on the context vector containing time-dependent information through an attention mechanism, focusing on important time steps and spatial positions, calculating attention scores and weights, and performing weighted summation to obtain the final output; Converting the final output into a prediction result through a fully connected layer to obtain the positions of continuous trajectory points, and obtaining the future driving trajectory of the vehicle according to the output order; The specific functions of the non-weekday trajectory prediction model include: Encoding the input non-weekday trajectory data by using a sparse self-attention mechanism to form a context vector; Performing effective feature extraction on the context vector based on the feature extraction layer; Decoding the context vector after feature extraction through a fully connected layer and a multi-head self-attention layer to output a predicted vehicle driving trajectory vector; The output layer converts the predicted vehicle driving trajectory vector into a probability index through a linear transformation layer, and uses the Softmax function to convert the probability index into a trajectory distribution probability to obtain the positions of continuous trajectory points, and outputs them in order to obtain the future driving trajectory of the vehicle; Matching the future vehicle driving trajectory to the actual urban road based on the road network matching algorithm to obtain the future vehicle road driving trajectory, including: Converting the obtained urban road network data into an urban graph model; Based on the GPS points in the predicted future vehicle driving trajectory and the urban graph model, defining an observation sequence, calculating the distance from each GPS point in the observation sequence to each road section one by one, and selecting the road sections with a distance less than the distance threshold into the candidate road section set; Based on the candidate road section set, calculating the observation probability of each candidate road section in the candidate road section set; Calculating the initial probability based on the first GPS point in the future vehicle driving trajectory; Calculating the state transition probability based on the candidate road sections respectively matched by the GPS points in the observation sequence; Using the Viterbi recursion to obtain the optimal path that best meets the observation and road constraints and use it as the future vehicle road driving trajectory; Said use of Viterbi recursion refers to using the Viterbi algorithm for recursive path inference, including: At the time of initialization, which includes: calculating the optimal probability of each candidate road section based on the first GPS point in the predicted future driving trajectory of the vehicle , and calculating the optimal probability of each candidate road section; ; Among them, is the first GPS point matching candidate road segments with the optimal probability, is the first GPS point in the future driving trajectory of the vehicle located in the candidate road segment with the initial probability, is the first GPS point matching the observation probability of the candidate road segment; For , recursively calculate the optimal probability that each GPS point matches each candidate road segment: ; Among them, is the GPS point matching the optimal probability of the candidate road segment ; is the GPS point matching the observation probability of the candidate road segment ; is the optimal probability of the previous GPS point matching the candidate road segment ; is the state transition probability between the adjacent GPS point and the candidate road segment; Record the optimal source road segments for each GPS point and construct a backtracking table , , expressed as: ; Among them, indicates the transfer from the previous candidate road section to the current candidate road section , indicates the state transition probability between adjacent GPS points and the matching candidate road sections; Based on the backtracking table , trace back point by point to obtain the candidate road segments with the optimal probability from the first GPS point to the last GPS point, and obtain the optimal path, expressed as: , where represents the GPS point is located on the candidate road segment , , is the observation sequence.
Citation Information
Patent Citations
Revenue awareness service migration and resource allocation method of multi-edge cellular Internet of Vehicles
CN119562311A
Service migration method and system based on user trajectory prediction
CN119854303A