A route recommendation method based on a dual-tower latent semantic model
By adopting a route recommendation method based on a dual-tower latent semantic model, the problems of data sparsity and dynamic traffic characteristics are solved, and the matching of traveler preferences and personalized route recommendation are realized. The optimal travel routes that meet the peak, off-peak and low-peak time periods are recommended.
Patent Information
- Application Number
- CN202311777765.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-12-21
AI Technical Summary
Existing route recommendation methods suffer from data sparsity, difficulty in efficiently identifying significant traveler preference attributes, and failure to consider dynamic traffic characteristics, resulting in poor recommendation performance.
A route recommendation method based on a dual-tower latent semantic model is adopted. By segmenting the road network through trajectory routes and combining the category features of travelers and road segments with the hidden features in the ratings, the dual-tower latent semantic model is used to predict travelers' ratings of road segments and to recommend road segments during peak, off-peak, and low-peak periods.
It significantly reduced the size of the road network, simplified the tedious process of collecting road segment scoring data, improved the matching degree of traveler preferences, and recommended dynamic optimal travel routes that meet personalized needs.
Smart Images

Figure CN119357458B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of route recommendation technology, and in particular to a route recommendation method based on a dual-tower latent semantic model. Background Technology
[0002] Currently, route recommendation methods that consider traveler preferences mainly use the following three approaches: The first approach pre-classifies travelers into several categories and formulates different recommendation rules for different categories, such as knowledge-based topic retrieval for recommendations and tourism promotions; the second approach recommends routes based on traveler preferences by suggesting usage scenarios, such as a hybrid ensemble learning method for tourist route recommendations based on geo-tagged social networks; and the third approach uses clustering methods, either clustering based on the characteristics of the places travelers visit or clustering travelers with similar characteristics and making recommendations based on similarity, such as a personalized POI route recommendation system based on heterogeneous tourism data and sequential pattern mining.
[0003] However, incorporating traveler preferences into route recommendations presents the following challenges: (1) Data sparsity: In the paper "A hybridensemble learning method for tourist route recommendations based on geo-tagged social networks," travelers are pre-classified into several categories, and different recommendation rules are formulated for different categories. However, the data sparsity problem still exists due to a lack of new traveler data and a limited number of preferences. (2) The challenge of identifying significant preference attributes: The paper "A travel route recommendation algorithm based on interest theme and distance matching" considers interest theme and distance as traveler preference attributes, while the paper "StrategicTransit Route Recommendation Considering Multi-Trip Feature Desirability Using Logit Model with Optimal Travel Time Analysis" considers time. However, it remains challenging to efficiently identify attributes that are significantly related to traveler preferences and meet the research objectives from among numerous attributes. (3) Failure to consider dynamic traffic: Route selection behavior is not only related to the condition of the road segment itself but also to the road conditions of related road segments. The paper "A double fusion joint learning method for driving trajectory representation" proposes a multimodal fusion model to study the complexity and uncertainty in trajectories. However, it does not take into account the dynamic traffic characteristics of road segments. Due to the significant differences in traffic conditions during peak, off-peak, and low-peak periods, different travelers also exhibit different preferences. Summary of the Invention
[0004] The purpose of this invention is to provide a route recommendation method based on a dual-tower latent semantic model. This method utilizes trajectory routes to segment the road network and calculates road segment scores based on trajectory scores to reduce the size of the road network and solve the data sparsity problem. It combines the category features of travelers and road segments with the hidden features in the scores and uses a dual-tower latent semantic model to predict travelers' scores for road segments.
[0005] To achieve the aforementioned objectives, the present invention employs the following technical solution: a route recommendation method based on a dual-tower latent semantic model, comprising the following steps:
[0006] Step S1: Obtain the traveler's attributes, travel trajectory and rating, and road segment attribute data;
[0007] Step S2: Segment the road network based on the trajectory;
[0008] Step S3: Use the dual-tower latent semantic model to recommend road segments during peak, off-peak, and low-peak hours respectively;
[0009] Step S4: Recommend the optimal travel route based on the traveler's given origin, destination, and time.
[0010] Preferably, in step S2, the specific process of segmenting the road network based on the trajectory is as follows:
[0011] Step S21: Obtain the trajectories of all travelers, sample location points at equal intervals to form a sample point set S, and calculate the similarity distance matrix;
[0012] Step S22, set the neighborhood cutoff distance d c Calculate the local density ρ of the sample. i The calculation formula is:
[0013]
[0014] Where, d ij The distance between sample point i and sample point j is...
[0015] Step S22, the relative distance δ between samples i The calculation formula is:
[0016]
[0017] Where, δ i For sample x i The distance to the nearest sample with a local density greater than itself;
[0018] Step S23: Draw a decision map and mark the density peaks as cluster centers;
[0019] Step S24: Assign non-clustered data points to the class containing the nearest sample with a local density greater than their own.
[0020] Step S25: Based on the intersection of the clustering results, the road network is divided into several road segments, with each class corresponding to one road segment, forming a road segment set I.
[0021] Step S26: Based on the score of each trajectory and the constituent road segments of traveler u, calculate the score of traveler u for each road segment i. The calculation formula is as follows:
[0022]
[0023] Where U is the set of all travelers, Lu Let r be the set of all trajectories of traveler u. u,l The overall score given by traveler u to trajectory l. Let i be the probability that segment i in trajectory l is the worst segment.
[0024] Step S27: Based on the evaluation time of the trajectory, the road segment data is divided into three categories: peak, off-peak, and low-peak.
[0025] Preferably, in step S3, the specific process of using the dual-tower latent semantic model to recommend road segments during peak, off-peak, and low-peak hours is as follows:
[0026] Step S31, construct the traveler-segment rating matrix set R m×n =(r u,i ) m×n Where m is the number of travelers, n is the number of road segments, and r is the number of road segments. u,i The rating of traveler u for road segment i.
[0027] Step S32, based on the timestamp, R m×n Divided into peak periods Low peak Low peak Traveler-Route Segment Rating Matrix for Different Time Periods;
[0028] Step S33: Set the number of latent factors K and randomly initialize the traveler latent semantic matrix. Road segment latent semantic matrix Category Latent Semantic Matrix Where d represents the total number of attributes for travelers and road segments;
[0029] Step S34, calculate the traveler latent semantic vector p u Traveler category latent semantic vector pt u Road segment latent semantic vector q i Road segment category latent semantic vector (QT) i See the following formula:
[0030]
[0031] Where, x u ,x t,u ,x i ,x t,i These are the One-hot codes for traveler, traveler category, road segment, and road segment category, respectively.
[0032] Step S35, respectively, the latent semantic vector p of the traveler u Latent semantic vector pt of traveler category uRoad segment latent semantic vector q i With road segment category latent semantic vectors Qt i Fusion, see the formula below:
[0033]
[0034] Where, θ u ,b u The traveler fusion function f is respectively fusion,u The parameter, θ i ,b i The road segment fusion function f is respectively fusion,i Parameters;
[0035] Step S36: According to step S35, add the bias term μ+c to the predicted score. i +c u , where c i c is the bias term for road segment i. u Let μ be the bias term for traveler u, and μ be the baseline rating. Then the predicted rating can be expressed as:
[0036]
[0037] Step S37: To avoid overfitting, a regularization parameter λ is added to the loss function. The expression for minimizing the loss function is:
[0038]
[0039] Step S38: Based on steps S33-S37, train the model for the traveler-road segment rating matrix during peak, off-peak, and low-peak hours respectively.
[0040] Preferably, in step S4, the specific process of recommending the optimal travel route based on the origin and destination given by the traveler and the expected departure time is as follows:
[0041] Step S41: Rate traveler u for road segment i during time period j. Distance from road segment i Combined, traveler road obstruction The calculation formula is:
[0042]
[0043] in, These are the lowest and highest scores given by traveler u during time period j, respectively, for the road segment.
[0044] Step S42: Determine the time period to which the traveler u's given departure time t0 belongs, and select the average driving speed. The average driving speed is Where j∈{1,2,3}, Let be the start time of the t-th j-th time interval. Let j be the end time of the t-th j-th time interval. During peak hours, During off-peak hours, It is during off-peak hours, and
[0045] Step S43: Based on the starting point O and the departure time t0, calculate the actual time when the adjacent road segment h is passed.
[0046] Step S44: Find the next road segment and calculate the time to pass through the next road segment;
[0047] Step S45, according to the access sequence visited={O,h i Given |i∈[1,|visited|-1]}, time sets T and T', the formula for calculating the total traveler road resistance ds for this route is:
[0048]
[0049] in,
[0050] Step S46, add ds to the Dis set, where initially Dis = {};
[0051] Step S47, visited = visited - h |visited| Combining steps S43 to S44, the next route 'visited' is generated;
[0052] Step S48, combined with step S45, calculate the total road resistance of the visited route;
[0053] Step S49: Repeat steps S46 to S48, compare the total traveler road resistance for each route in Route, and output the recommended route for travelers, that is, the route with the minimum total traveler road resistance.
[0054] Preferably, in step S43, the specific process of calculating the actual time of passing through its adjacent road segment h based on the starting point O and the departure time t0 is as follows:
[0055] Step S431: Based on the starting point O and departure time t0, calculate the expected time to pass through its adjacent road segment h. Add road segment h to the visited set and time t to the T set. h Add time to set T' Where, initially visited={O}, T=T'={t0}, h∈H o ∈I∪{O,D},H oLet O be the set of adjacent road segments;
[0056] Step S432: Calculate the actual transit time for road segment h and update the time sets T and T'. If but like Then update the sets T' and T respectively. in, They are t0 and t respectively h Average vehicle speed on the road segment during the specified time period;
[0057] Preferably, in step S44, the specific process of finding and calculating the time of passing through the next road segment is as follows:
[0058] Step S441, determine The set of adjacent road segments of h Are all of them true?
[0059] Step S442, if and Then, according to step S43, iterative calculation is performed. The time when a person departs from point h and passes through its adjacent road segment k, where H is... h Let h be an adjacent road segment, k∈H h ;
[0060] Step S443, if And the set of adjacent road segments of h Then update visited-=visited |visited| In conjunction with step S43, in Select a road segment and calculate its actual transit time, where |visited| is the number of elements in the visited set. |visited| The visited element in the visited collection. For the element visited |visited| The set of adjacent road segments;
[0061] Step S444, if Then record T and T', and add visited to the Route set, where the initial Route = {}.
[0062] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0063] 1. This invention addresses the problem of data sparsity by segmenting the road network using trajectory routes. By treating a set of several related road segments as a single road segment, the scale of the road network is significantly reduced, thereby significantly reducing the dimensionality of the road segment rating matrix and solving the data sparsity problem. Furthermore, based on the road network segmentation results, this invention designs a road segment rating formula based on trajectory rating. During the research process, it is only necessary to collect travelers' ratings of their current travel trajectory, and the ratings of the road segments contained in that trajectory can be calculated using this formula. This formula can effectively reduce the tedious process of collecting road segment rating data.
[0064] 2. This invention combines the category features of travelers and road segments with the hidden features in the ratings, and uses a dual-tower latent semantic model to predict travelers' ratings of road segments. For new travelers, this invention considers the category features of travelers, such as age, gender, and driving experience, to make up for the problem of difficulty in making recommendations due to the lack of their historical evaluation data. For ordinary travelers, this invention sets the number of latent factors, mines the hidden features of travelers and road segments in the rating data, and combines them with the category features to solve the problem of difficulty in determining preference attributes.
[0065] 3. This invention recommends dynamically optimal travel routes by combining road segment scores with actual road segment distances. Specifically, the route planning considers traveler preferences and road segment characteristics during peak, off-peak, and low-peak periods, making the solution more aligned with travelers' individual needs while taking into account traffic characteristics at different times. When travelers give consistent scores to road segments, this invention recommends the shortest path based on the actual length of the road segment. However, when travelers give significantly different scores, this invention combines road segment scores and road segment lengths to comprehensively select the optimal route, avoiding the excessive pursuit of high scores and the selection of circuitous routes, while also reducing "undesirable" road segments in the shortest path. Attached Figure Description
[0066] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0067] Figure 1 This is a flowchart of the route recommendation method based on traveler preferences proposed in an embodiment of the present invention.
[0068] Figure 2 This is a flowchart for recommending a dual-tower latent semantic model in the method proposed in this embodiment of the invention.
[0069] Figure 3 This is a flowchart of route planning in the method proposed in an embodiment of the present invention.
[0070] Figure 4 This is a flowchart illustrating the calculation of total path resistance in the method proposed in this embodiment of the invention.
[0071] Figure 5 This is a diagram showing the result of road network segmentation in the method proposed in this embodiment of the invention.
[0072] Figure 6 This is a diagram showing the results of the road segment scoring formula in the method proposed in this embodiment of the invention.
[0073] Figure 7 This is a diagram showing the result of the optimal route in the method proposed in this embodiment of the invention. Detailed Implementation
[0074] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0075] Example 1
[0076] See Figures 1 to 4 This embodiment provides a technical solution: a route recommendation method based on a dual-tower latent semantic model, comprising the following steps:
[0077] Step S1: Obtain the traveler's attributes, travel trajectory and rating, and road segment attribute data;
[0078] Step S2: Segment the road network based on the trajectory;
[0079] Step S3: Use the dual-tower latent semantic model to recommend road segments during peak, off-peak, and low-peak hours respectively;
[0080] Step S4: Recommend the optimal travel route based on the traveler's given origin, destination, and time.
[0081] Specifically, in step S2, the process of segmenting the road network based on the trajectory is as follows:
[0082] Step S21: Obtain the trajectories of all travelers, sample location points at equal intervals to form a sample point set S, and calculate the similarity distance matrix;
[0083] Step S22, set the neighborhood cutoff distance d c Calculate the local density ρ of the sample. i The calculation formula is:
[0084]
[0085] Where, d ij The distance between sample point i and sample point j is...
[0086] Step S22, calculate the relative distance δ of the samples. iThe calculation formula is:
[0087]
[0088] Where, δ i For sample x i The distance to the nearest sample with a local density greater than itself;
[0089] Step S23: Draw a decision map and mark the density peaks as cluster centers;
[0090] Step S24: Assign non-clustered data points to the class containing the nearest sample with a local density greater than their own.
[0091] Step S25: Based on the intersection of the clustering results, the road network is divided into several road segments, with each class corresponding to one road segment, forming a road segment set I.
[0092] Step S26: Based on the score of each trajectory and the constituent road segments of traveler u, calculate the score of traveler u for each road segment i. The calculation formula is as follows:
[0093]
[0094] Where U is the set of all travelers, L u Let r be the set of all trajectories of traveler u. u,l The overall score given by traveler u to trajectory l. Let i be the probability that segment i in trajectory l is the worst segment.
[0095] Step S27: Convert the trajectory evaluation time to a 24-hour format and divide the road segment data into three categories: peak, off-peak, and low-peak.
[0096] In this embodiment, taking Shenzhen as an example, [7:00, 9:30]∪[17:30, 19:30] is set as the peak period, [9:30, 17:30]∪[19:30, 21:00] is set as the off-peak period, and [21:00, 7:00(+1)] is set as the low-peak period; the highest score that travelers give to road segments is set. It is 5.0, the highest score =0;
[0097] Specifically, in step S3, the process of using the dual-tower latent semantic model to recommend road segments during peak, off-peak, and low-peak hours is as follows:
[0098] Step S31, construct the traveler-segment rating matrix set R m×n =(r u,i ) m×n Where m is the number of travelers, n is the number of road segments, and r is the number of road segments.u,i The rating of traveler u for road segment i.
[0099] Step S32, based on the timestamp, R m×n Divided into peak periods Low peak Low peak Traveler-Route Segment Rating Matrix for Different Time Periods;
[0100] Step S33: Set the number of latent factors K and randomly initialize the traveler latent semantic matrix. Road segment latent semantic matrix Category Latent Semantic Matrix Where d represents the total number of attributes for travelers and road segments;
[0101] Step S34, calculate the traveler latent semantic vector p u Traveler category latent semantic vector pt u Road segment latent semantic vector q i Road segment category latent semantic vector (QT) i See the following formula:
[0102]
[0103] Where, x u ,x t,u ,x i ,x t,i These are the One-hot codes for traveler, traveler category, road segment, and road segment category, respectively.
[0104] Step S35, respectively, the latent semantic vector p of the traveler u Latent semantic vector pt of traveler category u Road segment latent semantic vector q i With road segment category latent semantic vectors Qt i Fusion, see the formula below:
[0105]
[0106] Where, θ u ,b u θ are the parameters of the traveler fusion function. i ,b i These are the parameters of the road segment fusion function;
[0107] Step S36: Based on step S35, calculate the predicted score using the following formula:
[0108]
[0109] Step S37: Train the model by minimizing the loss function. The expression for the loss function is:
[0110]
[0111] Step S38: Based on steps S33-S37, train the model for the traveler-road segment rating matrix during peak, off-peak, and low-peak hours respectively.
[0112] In this embodiment, the optimal neighborhood cutoff distance d for road network segmentation is... c =8.06, achieving a classification accuracy of 92%, generating a road network containing 13 road segments; in the dual-tower latent semantic model, the total number of travelers is 3963, the number of latent factors K=10, the traveler category features are age, gender, and education level, and the road segment category features are road segment length and number of curves, then the category latent semantic matrix is...
[0113] Specifically, in step S4, the process of recommending the optimal travel route based on the origin, destination, and expected departure time given by the traveler is as follows:
[0114] Step S41: Rate traveler u for road segment i during time period j. Distance from road segment i Combined, traveler road obstruction The calculation formula is:
[0115]
[0116] in, These are the lowest and highest scores given by traveler u during time period j, respectively, for the road segment.
[0117] Step S42: Determine the time period to which the traveler u's given departure time t0 belongs, and select the average driving speed. The average driving speed is Where j∈{1,2,3}, Let be the start time of the t-th j-th time interval. Let j be the end time of the t-th j-th time interval. During peak hours, During off-peak hours, It is during off-peak hours, and
[0118] In this embodiment, the average vehicle speed during peak hours is set. Average vehicle speed during off-peak hours Average vehicle speed during off-peak hours If traveler u gives a departure time If it falls within the first peak period, then its average vehicle speed during the [8:00, 9:30] time period is...
[0119] Step S43: Based on the starting point O and the departure time t0, calculate the actual time when the adjacent road segment h is passed.
[0120] Specifically, in step S43, the process of calculating the actual time of passing through its adjacent road segment h based on the starting point O and the departure time t0 is as follows:
[0121] Step S431: Based on the starting point O and departure time t0, calculate the expected time to pass through its adjacent road segment h. Add road segment h to the visited set and time t to the T set. h Add time to set T' Where, initially visited={O}, T=T'={t0}, h∈H o ∈I∪{O,D},H o Let O be the set of adjacent road segments;
[0122] Step S432: Calculate the actual transit time for road segment h and update the time sets T and T'. If but like Then update the sets T' and T respectively. in, They are t0 and t respectively h Average vehicle speed on the road segment during the specified time period;
[0123] If the set of adjacent road segments of starting point O is H o ={h|h∈I}, randomly select road segment h, whose road segment length dis h =1.5km, then visited={O,h}, the expected time of passage for road segment h. T = T' = {8:00, 8:06};
[0124] Step S44: Find the next road segment and calculate the time to pass through the next road segment;
[0125] Specifically, in step S44, the process of finding and calculating the time to pass through the next road segment is as follows:
[0126] Step S441, determine The set of adjacent road segments of h Are all of them true?
[0127] Step S442, if and Then, according to step S43, iterative calculation is performed. The time when a person departs from point h and passes through its adjacent road segment k, where H is... hLet h be an adjacent road segment, k∈H h ;
[0128] Step S443, if And the set of adjacent road segments of h Then update visited-=visited |visited| In conjunction with step S43, in Select a road segment and calculate its actual transit time, where |visited| is the number of elements in the visited set. |visited| The visited element in the visited collection. For the element visited |visited| The set of adjacent road segments;
[0129] Step S444, if Then record T and T', and add visited to the Route set, where the initial Route = {};
[0130] In this embodiment, If the set of adjacent road segments of h Then randomly select road segment k, whose segment length dis k =23.5km / h, combined with step S43, update visited={O,h,k}, and calculate Starting from h, the expected time to pass through road segment k. The average speed of road segment k during the time period [9:30, 9:33] Average vehicle speed during the time period [9:30, 9:33] renew T={8:00,9:30}, T'={8:00,9:36};
[0131] at this time, And the set of adjacent road segments of k Then update visited-=visited |visited| ={O,h,k}-{k}={O,h}, returns the set H of adjacent road segments of h. h If road segment D∈H h -visited, combined with step S43, update visited={O,h,D}. At this time, visited={O,h,D}∩{D}={D}, that is, visited has connected O and D, record visited, T, T'.
[0132] Step S45, according to the access sequence visited={O,h iGiven |i∈[1,|visited|-1]}, time sets T and T', the formula for calculating the total traveler road resistance ds for this route is:
[0133]
[0134] in,
[0135] Step S46, add ds to the Dis set, where initially Dis = {};
[0136] Step S47, visited = visited - h |visited| Combining steps S43 to S44, the next route 'visited' is generated;
[0137] Step S48, combined with step S45, calculate the total road resistance of the visited route;
[0138] Step S49: Repeat steps S46 to S48, compare the total traveler road resistance for each route in Route, and output the recommended route for travelers, that is, the route with the minimum total traveler road resistance.
[0139] In this embodiment, the proposed route recommendation method based on traveler preferences utilizes trajectory routes to segment the road network and calculates road segment scores based on trajectory scores to reduce the road network size and address the data sparsity problem. It combines the category features of travelers and road segments with the hidden features in the scores, using a dual-tower latent semantic model to predict travelers' scores for road segments. This embodiment recommends dynamically optimal travel routes by combining road segment scores with actual road segment distances. Specifically, in route planning, it considers traveler preferences and road segment characteristics during peak, off-peak, and low-peak periods, thus making the solution more aligned with travelers' personalized needs and achieving the expected effect of accurate recommendation, while also considering traffic characteristics at different times.
[0140] Example 2
[0141] Based on Example 1, see Figures 5 to 7 This embodiment also provides a route recommendation method based on a dual-tower latent semantic model, including the following steps:
[0142] Step S1: In this embodiment, trajectory data is simulated to evaluate the proposed strategy. This embodiment uses a random road network containing 96 road segments. The road segment data includes three attributes: segment number, region, and length, where the segment length is a random number between [100, 1000]. Subsequently, 44,852 repeatable trip tasks (origin and destination) are randomly generated and randomly assigned to 3,963 travelers. For each trip task, a trajectory route is generated using RRT*, and a score between 1 and 5 is randomly generated as the overall score for each trajectory. Therefore, the trajectory data can be represented as a set (Track ID, Road Segment ID, Traveler ID, Score, Score Time).
[0143] Step S2: Segment the road network based on 200 trajectories; calculate the optimal neighborhood cutoff distance d. c =8.06, the local densities of the 6 cluster centers are [430, 830, 28, 661, 336, 795], the classification accuracy is as high as 92%, the original 13 road segments are reduced to 6 road segments, the clustering effect is shown below. Figure 5 .
[0144] Based on the above segmentation results, the differences between the ranking of each road segment and the actual ranking under different numbers of trajectories are compared. Mean squared error, mean absolute error, goodness of fit, Pearson correlation coefficient, and Spearman correlation coefficient are used as evaluation indicators. The score for each road segment is a random integer within the range [1, 5], and each trajectory is a sequence generated by randomly arranging and combining several road segments. The results are as follows: Figure 6 As shown.
[0145] It can be concluded that the road segment rankings obtained by this method are significantly correlated with the actual rankings, and the accuracy is directly proportional to the amount of data. When the overall trajectory score is represented by three different methods—median, upper quartile, and lower quartile—this method can still maintain a low error and a high correlation coefficient. Therefore, it can be seen that the quality of the road segments calculated by this method is significantly correlated with their actual rankings, and it has a certain degree of robustness.
[0146] In summary, road network segmentation based on trajectory data can effectively reduce the size of the road network; while the road segment scoring formula based on trajectory scoring can reflect the quality of road segments and has a certain degree of robustness. This method effectively avoids the tedious process of collecting scoring data for each road segment in the trajectory.
[0147] Step S3: Use a dual-tower latent semantic model to recommend road segments for peak, off-peak, and low-peak periods respectively: Based on the road network segmentation results of step S2, For example, we randomly selected four travelers to recommend their preferred route segments. The traveler IDs are 2715, 9168, 17, and 6393, containing 11, 22, 7, and 3 historical rating records respectively. Their prediction results are shown in the table below:
[0148] Table 1 Travelers' Route Scores
[0149]
[0150]
[0151] Step S4: Based on the traveler's given origin, destination, and time, recommend the optimal travel route. Using 7:00 as the departure time, diverse travel tasks were devised, and the simulated annealing algorithm was used to calculate the optimal path. In tasks AJ and DL, the recommended routes were the same as the shortest path. However, due to different recommended road segments, the recommended routes for tasks DG and AG differed significantly: In task DG, traveler 9168's recommended route was the same as the shortest path, while traveler 2715 and the general public gave low scores to road segment LG, both choosing route DF-FG. In task AG, traveler 2715 gave road segment FG only 2.56, resulting in a route AC-CD-DF-FH-HG that deviated drastically from the shortest path; while traveler 9168's recommended road segments were too few to meet travel needs, so unrecommended road segments were added, ultimately aligning with the shortest path. All these results indicate that the shortest path may not be the traveler's preferred route, and the recommended route, considering preferences, can also achieve the shortest path. (See [link to relevant documentation]). Figure 7 Route comparison.
[0152] From a benefit perspective, using the shortest path as the benchmark, the satisfaction and distance cost of the optimal routes under 66 tasks were compared for travelers 2715, 9168, and the general public. Table 2 shows the tasks where the optimal route is not the shortest path. For traveler 9168, the optimal route is the same as the shortest path; while for traveler 2715, only tasks AG and DG were available. These two tasks, at the cost of adding 450 meters and 220 meters respectively, increased the average route satisfaction by 13% and 37% respectively. Furthermore, although the general public rated all routes highly, the average satisfaction among the 12 optimal routes still increased by approximately 6% to 10%.
[0153] Table 2 shows the incremental benefits of the shortest path and the optimal path.
[0154]
[0155] By comprehensively comparing the above recommendation results, we can conclude that: based on the shortest path and the optimal route according to travelers' preferences, the satisfaction is significantly improved at the cost of a small increase in distance, thus achieving the expected results.
[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A route recommendation method based on a dual-tower latent semantic model, characterized in that, Includes the following steps: Step S1: Obtain the traveler's attributes, travel trajectory and rating, and road segment attribute data; Step S2: Segment the road network based on the trajectory; Step S3: Use the dual-tower latent semantic model to recommend road segments during peak, off-peak, and low-peak hours respectively; In step S3, the steps for recommending road segments during peak, off-peak, and low-peak hours using the dual-tower latent semantic model are as follows: Step S31: Construct a set of traveler road segment rating matrices. ,in For the number of travelers, For the number of road segments, For travelers For the section The rating; Step S32, based on the timestamp, Divided into peak periods Peak Low peak Traveler segment rating matrix for different time periods; Step S33, set the number of hidden factors Randomly initialize the latent semantic matrix of travelers. Road segment latent semantic matrix Category Latent Semantic Matrix ,in The total number of attributes for travelers and road segments; Step S34, generate the traveler latent semantic matrix Road segment latent semantic matrix Category Latent Semantic Matrix The one-hot encodings of the traveler, traveler category, road segment, and road segment category are multiplied together to form the traveler latent semantic vector. Latent semantic vectors of traveler categories Road segment latent semantic vectors Road segment category latent semantic vector . Step S35, transfer the traveler's latent semantic vector Latent semantic vectors of traveler categories Generate user feature vectors ;Transfer the latent semantic vector of the road segment Latent semantic vectors of road segment categories Fusion, road segment feature vector ; Step S36: Based on step S35, add a bias term to the predicted score. ,in, For the bias term of road segment i, For the bias term of traveler u, If the baseline score is used, then the predicted score is expressed as: ; Step S37: To avoid overfitting, a regularization parameter is added to the loss function. The expression for minimizing the loss function is: ; in, For the gathering of all travelers, For road segments; Step S4: Recommend the optimal travel route based on the traveler's given origin, destination, and time.
2. The route recommendation method based on a dual-tower latent semantic model according to claim 1, characterized in that, In step S2, segmenting the road network based on the trajectory includes the following steps: Step S25: Based on the intersection of the clustering results, the road network is divided into several road segments, with each cluster corresponding to one road segment, forming a road segment set. ; Step S26, based on the traveler Each trajectory score and its constituent road segments are used to calculate the traveler's score. For each road segment The score is calculated using the following formula: ; ; in, For the gathering of all travelers, For travelers The set of all trajectories, For travelers Trajectory Overall rating For trajectory Section of the road It is the probability of the worst road section; Step S27: Based on the evaluation time of the trajectory, the road segment data is divided into three categories: peak, off-peak, and low-peak.
3. The route recommendation method based on a dual-tower latent semantic model according to claim 1, characterized in that, In step S4, the steps for recommending the optimal travel route based on the traveler's given origin, destination, and time are as follows: Step S41, will Travelers during the time period For the section rating Distance from road section Combined, traveler road obstruction The calculation formula is: ; in, , They are respectively Travelers during the time period The given minimum and maximum scores for each road segment; Step S42, determine the traveler Given departure time Select the average driving speed for the specified time period. Step S43, based on the starting point Departure time Calculate the actual route along its adjacent road segments The moment The time of exiting this section of road ; Step S44: Find the next road segment and calculate the time to pass through the next road segment; Step S45, based on the visited sequence and a collection of travel times for each section of the route. Collection of times when exiting this section of road Calculate the total traveler road resistance for this route. The formula is: ; in, , , , , For the first indivual The start of the time period For the first indivual The end of the time period, During peak hours, During off-peak hours, During off-peak hours, ; Step S46, Add to collection Its initial value is empty; Step S47, Combining steps S43 and S44, generate the next route. ; Step S48, combined with step S45, calculate the route. Total road resistance; Step S49, repeat steps S46 to S48, compare. Given the total traveler road resistance for each route, output the recommended route for travelers, which is the route with the minimum total traveler road resistance.
4. The route recommendation method for the dual-tower latent semantic model according to claim 3, characterized in that, In step S43, based on the starting point Departure time Calculate the actual passage through its adjacent road segments The steps for timing are as follows: Step S431, based on the starting point Departure time Calculate the expected passage through its adjacent road segments The time is ,exist Add road segments to the collection , Add time to set , Add time to set , where, initial , , , for A collection of adjacent road segments; Step S432, calculate road segment The actual elapsed time, and update the time set. , ,like ,but ;like Then update them separately. , In the set , ;in, , They are respectively , Average vehicle speed on the road segment during the specified time period.
5. The route recommendation method for a dual-tower latent semantic model according to claim 3, characterized in that, In step S44, the steps for finding and calculating the time to pass through the next road segment are as follows: Step S441: Determine whether the route passes through segment D. Are there any unvisited road segments among the connecting road segments? Step S442: If the route does not pass through D, and there are unvisited road segments among the connecting road segments, then according to step S43, iteratively calculate the time to pass through its connecting road segments. Step S443: If the route does not pass through D, and all connecting segments of the route have been visited, then return. The previous road segment in the set is reselected, and iterative calculation is performed in conjunction with step S43; Step S444: If the route has already passed D, record the arrival time and... Add routes to the collection .
Citation Information
Patent Citations
Path recommendation method and device
CN110647693A
Travel scheme optimization method of travel path and travel time based on user preference
CN115880895A