Route sequencing method, method and apparatus for generating cluster centers
Patent Information
- Application Number
- CN202510179987.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2026-08-18
AI Technical Summary
[0012]The route sorting method, cluster center generation method, and apparatus provided in this application, when a user initiates a route planning request, determine the navigation scenario features of the current navigation based on the parameters carried in the route planning request, and then determine the cluster center to which the navigation scenario features belong from multiple cluster centers corresponding to route preferences, that is, identify the user's route preference in the navigation scenario; at the same time, determine the route features of each planned navigation route, and sort the multiple planned navigation routes based on the cluster center to which the navigation scenario features belong and the route features of each planned navigation route to obtain a recommended sorting result. Since the multiple cluster centers in this application are obtained in advance based on the clustering results of multiple navigation scenario feature samples, the cluster center to which the navigation scenario features of this navigation belong, determined from multiple cluster centers corresponding to route preferences, can represent the user's route preference in this navigation scenario. Compared with the fixed preference method, the prediction of route preference is more flexible and reasonable. Furthermore, this application can identify the user's route preference in different navigation scenarios, so that the route ranking result matches the user's route preference in the corresponding navigation scenario. Thus, when recommending routes to the user based on the route ranking result, it ensures that the recommended routes meet the user's needs, reduces the number of times the user manually adjusts the navigation route, and improves the user's navigation experience.
Smart Images

Figure CN122590920A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of navigation technology, and in particular to a route sorting method, a method and apparatus for generating cluster centers. Background Technology
[0002] With the continuous development of technology, software that can provide navigation services is widely used, making travel more convenient for users.
[0003] Route planning and recommendation are core services of navigation. Route planning involves planning the best route from the origin to the destination based on the user's travel needs. Recommendation, on the other hand, ranks the planned routes based on user preferences and recommends routes that meet those preferences, such as the shortest travel time or the shortest distance. In related technologies, users can configure route preferences, such as highway priority, time priority, and congestion avoidance. The route planning and recommendation service will then plan and recommend routes based on these preferences. If the user has not configured route preferences or has configured intelligent route recommendations, it is usually necessary to predict the user's route preferences to ensure that the recommended routes best meet the user's needs. How to accurately predict user route preferences and improve the accuracy of route ranking is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] This application provides a route sorting method, a method and apparatus for generating cluster centers. By identifying the cluster center to which the navigation scenario belongs, which represents the user's route preference in the navigation scenario, the planned navigation routes are sorted based on the degree of matching between the route features of the navigation route and the cluster center representing the route preference. This ensures that the route sorting result matches the user's route preference, thereby guaranteeing that when recommending routes based on the route sorting result, the recommended routes match the user's route preference.
[0005] In a first aspect, this application provides a route ranking method, comprising: determining navigation scene features based on parameters carried in a route recommendation request; determining route features for each of the multiple navigation routes generated based on the route planning request; determining the cluster center to which the navigation scene features belong from a plurality of pre-generated cluster centers corresponding to route preferences; wherein the plurality of cluster centers are obtained in advance based on clustering results of multiple navigation scene feature samples; and obtaining a recommended ranking of the plurality of navigation routes based on the cluster center to which the navigation scene features belong and the route features of each of the multiple navigation routes.
[0006] Secondly, this application provides a method for generating cluster centers, used to generate cluster centers representing route preferences, where each cluster center corresponds to a route preference. The method includes: via an encoder of a cluster center prediction model, outputting a feature vector corresponding to the training sample based on historical navigation scene features included in the training sample set, wherein the historical navigation scene features carry information that enables the cluster center prediction model to learn route preferences; via a cluster center prediction layer of the cluster center prediction model, determining the distance between the training sample and each of the cluster centers based on the distance between the feature vector of the training sample and the vectors of each pre-generated cluster center, and taking the cluster center with the shortest distance to the training sample as the predicted cluster center corresponding to the training sample; calculating a clustering loss value based on the vector of the predicted cluster center corresponding to the training sample and the feature vector corresponding to the training sample; and backpropagating to adjust the parameters of the encoder and the vectors of the cluster centers based at least on the clustering loss value until a preset condition is met, thereby obtaining multiple cluster centers representing route preferences.
[0007] Thirdly, this application provides a route ranking apparatus, comprising: a scene feature determination module, configured to determine navigation scene features based on parameters carried in a route planning request; a route feature determination module, configured to determine the route features of each of the multiple navigation routes generated based on the route planning request; a cluster center determination module, configured to determine the cluster center to which the navigation scene features belong from a plurality of pre-generated cluster centers corresponding to route preferences; and a route ranking module, configured to obtain a recommended ranking of the plurality of navigation routes based on the cluster center to which the navigation scene features belong and the route features of each of the multiple navigation routes.
[0008] Fourthly, this application provides an apparatus for generating cluster centers, used to generate cluster centers representing route preferences, with one cluster center corresponding to one route preference. The apparatus includes: a sample encoding module, used to output a feature vector corresponding to the training sample based on historical navigation scene features included in the training sample set via an encoder of a cluster center prediction model, wherein the historical navigation scene features carry information that enables the cluster center prediction model to learn route preferences; a cluster center corresponding module, used to determine the distance between the training sample and each of the cluster centers based on the distance between the feature vector of the training sample and the vectors of each pre-generated cluster center via a cluster center prediction layer of the cluster center prediction model, and to take the cluster center with the shortest distance to the training sample as the predicted cluster center corresponding to the training sample; a loss value calculation module, used to calculate a clustering loss value based on the vector of the predicted cluster center corresponding to the training sample and the feature vector corresponding to the training sample; and a yaw cluster center obtaining module, used to backpropagate and adjust the parameters of the encoder and the vector of the cluster center based at least on the clustering loss value until a preset condition is met, thereby obtaining multiple cluster centers representing route preferences.
[0009] Fifthly, this application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the electronic device to perform the methods provided in the first and / or second aspects of this application.
[0010] In a sixth aspect, this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the methods provided in the first and / or second aspects of this application.
[0011] In a seventh aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the first and / or second aspects of this application.
[0012] The route sorting method, cluster center generation method, and apparatus provided in this application, when a user initiates a route planning request, determine the navigation scenario features of the current navigation based on the parameters carried in the route planning request, and then determine the cluster center to which the navigation scenario features belong from multiple cluster centers corresponding to route preferences, that is, identify the user's route preference in the navigation scenario; at the same time, determine the route features of each planned navigation route, and sort the multiple planned navigation routes based on the cluster center to which the navigation scenario features belong and the route features of each planned navigation route to obtain a recommended sorting result. Since the multiple cluster centers in this application are obtained in advance based on the clustering results of multiple navigation scenario feature samples, the cluster center to which the navigation scenario features of this navigation belong, determined from multiple cluster centers corresponding to route preferences, can represent the user's route preference in this navigation scenario. Compared with the fixed preference method, the prediction of route preference is more flexible and reasonable. Furthermore, this application can identify the user's route preference in different navigation scenarios, so that the route ranking result matches the user's route preference in the corresponding navigation scenario. Thus, when recommending routes to the user based on the route ranking result, it ensures that the recommended routes meet the user's needs, reduces the number of times the user manually adjusts the navigation route, and improves the user's navigation experience. Attached Figure Description
[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0014] Figure 1 A schematic diagram of a route recommendation interface provided in an embodiment of this application;
[0015] Figure 2 Flowchart of the route sorting method provided in the embodiments of this application Figure 1 ;
[0016] Figure 3 Flowchart of the route sorting method provided in the embodiments of this application Figure 2 ;
[0017] Figure 4 For this application Figure 3 The diagram shows the structure of the cluster center prediction model in the embodiment shown.
[0018] Figure 5 This is a schematic diagram of the structure of a route recommendation model provided in an embodiment of this application;
[0019] Figure 6 Flowchart of the route sorting method provided in the embodiments of this application Figure 3 ;
[0020] Figure 7 A flowchart illustrating the method for generating cluster centers provided in this application embodiment. Figure 1 ;
[0021] Figure 8 For this application Figure 7 A schematic diagram of the cluster center prediction model during the training phase provided in the illustrated embodiment;
[0022] Figure 9 A schematic diagram of the route recommendation model during the training phase provided in an embodiment of this application;
[0023] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0024] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0026] It should be noted that the user information (including but not limited to user device information, user attribute information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0027] First, let me explain some of the terms used in this application:
[0028] Clustering: An unsupervised learning method that aims to divide samples into multiple clusters (also called clustering clusters) with the goal of maximizing the similarity of samples within the same cluster and maximizing the differences between samples in different clusters. Each cluster corresponds to a cluster center. The clustering algorithm iteratively updates the cluster centers and clusters. In each iteration, the distance between the sample and the cluster center is considered to determine the cluster to which the sample belongs, and the cluster center of that cluster is updated based on the samples within the same cluster.
[0029] Navigation scenario characteristics: Describes the characteristics of the scenario in which the user is navigating. These characteristics are related to the origin, destination, navigation mode, and travel environment, such as the distance (straight-line distance or spherical distance) from the origin to the destination, the characteristics of the points of interest corresponding to the origin, the characteristics of the points of interest corresponding to the destination, and whether the trip is during the day or at night.
[0030] Recall route: Plan the route from the origin to the destination.
[0031] Software with navigation functions, such as travel apps, ride-hailing apps, and lifestyle service apps, need to recall navigation routes based on the user's input or selected origin and destination when providing navigation services. Since there are a large number of planned navigation routes, in order to make the routes recommended to the user match the user's travel preferences or route preferences, it is necessary to sort the recalled navigation routes according to a certain strategy, and then recommend the top-ranked navigation routes (such as 3 or 5 routes) to the user.
[0032] Figure 1 This is a schematic diagram of a route recommendation interface provided in an embodiment of this application, as shown below. Figure 1 As shown, in response to the user's input of the departure and destination points while driving, navigation software recommends multiple alternative routes, such as... Figure 1 For routes 1 to 3, taking a new energy vehicle as an example, route 1 is the most energy-efficient alternative route. Figure 1 The route marked "most energy-efficient" is shown in the image. Route 2 is the shortest alternative route. Figure 1 Routes marked "shortest distance" are listed below. Route 3 is the least congested alternative route. Figure 1 (Routes marked "Less congested" are available). Users can choose one of the three recommended routes as their navigation route based on their needs and begin navigation. In some embodiments, the starting point can be the user's location, so the user only needs to enter the destination.
[0033] When recommending routes, related technologies often rely on pre-configured route preferences from users, such as prioritizing highways, main roads, avoiding highways, minimizing tolls, prioritizing time, and avoiding congestion. However, user needs (preferences) for routes are dynamic; that is, user needs may differ at different times, from different departure points, or at different destinations. Using a fixed, singular strategy to recommend routes can easily lead to a mismatch between the recommended routes and the user's current travel needs. Users then need to manually adjust the recommended routes to obtain the desired navigation route, resulting in a poor user experience.
[0034] To improve the matching degree between recommended routes and user needs in different scenarios, i.e., to improve the accuracy of recommended routes, this application provides a route ranking method. First, multiple cluster centers representing different types of route preferences are obtained through clustering of navigation scenarios. A large number of samples are used for clustering to obtain different types of route preferences. Compared with fixed, single-dimensional route preferences, such as high-speed priority or time priority, this method improves the flexibility and accuracy of route preference classification. Then, the cluster center to which the current navigation scenario belongs is determined using the features extracted from the current navigation, i.e., identifying the user's route preference type during the current navigation, thus improving the accuracy of route preference identification. Finally, the routes are ranked using the cluster center to which the navigation scenario belongs and the route features of the planned routes. This ensures that the route ranking results match the user's route preferences in the current navigation scenario, resulting in high ranking accuracy. Therefore, when recommending routes to users based on the route ranking results, it ensures that the recommended routes meet the user's needs, reduces the number of times the user manually adjusts the navigation route, and improves the user navigation experience.
[0035] Figure 2 Flowchart of the route sorting method provided in the embodiments of this application Figure 1 This method can be executed by a device with corresponding data processing capabilities, which can interact with navigation software and can be located on the service side, the terminal side, or the edge side.
[0036] like Figure 2 As shown, the route sorting method includes the following steps:
[0037] Step S201: Determine the navigation scenario characteristics based on the parameters carried in the route planning request.
[0038] The route planning request is a request initiated from the terminal to request the route planning service to calculate the navigation route. Parameters carried in the route planning request can include location parameters such as the departure point and destination, as well as parameters such as the estimated departure time. The estimated departure time can be the time selected by the user or the time when the user initiated the route planning request. Navigation scenario features describe the characteristics of the navigation scenario corresponding to the user-initiated route planning request. These include, but are not limited to, the characteristics of the departure point and destination carried in the route planning request, the characteristics between the departure point and destination in the route planning request, such as the straight-line distance or spherical distance between the departure point and destination, and the characteristics of the navigation time in the route planning request, such as day or night, whether it is a holiday, or whether it is a peak travel period. Based on the initiation time of the route planning request or the estimated departure time selected by the user in the route planning request, it can be determined whether the user departs during the day or night, whether it is a holiday, or whether it is a peak travel period.
[0039] Of course, the estimated departure time in the route planning request can also be omitted. If the estimated departure time is omitted, it will default to the time when the route planning request is received.
[0040] The characteristics of the origin or destination can include the characteristics of the points of interest corresponding to the origin or destination, such as the type of points of interest.
[0041] That is, this application determines the navigation scene characteristics based on the parameters carried in the route planning request. It can also be understood as extracting the navigation scene characteristics of this navigation based on the parameters such as the departure point, destination and expected departure time carried in the route planning request.
[0042] Step S202: For the multiple navigation routes generated based on the route planning request, determine the route characteristics of each navigation route.
[0043] Upon receiving a route planning request, the route planning service can generate multiple navigation routes in response to the request. Those skilled in the art can generate navigation routes based on existing route planning algorithms; this application does not limit the type of algorithm used to generate navigation routes. The navigation routes recalled by the route planning service based on the route planning request must meet the following requirement: the sequence of roads included in the navigation route allows travel from the origin to the destination.
[0044] Route features are characteristics used to describe the inherent features of a navigation route. Specifically, route features can be obtained from the attributes of the roads included in the navigation route and the user's historical behavior on these roads. Route features may include: route length, route travel time, familiarity with the route, frequency of travel, whether it is toll-free, road length, and road topology. This application does not limit the specific types of route features for navigation routes. The foregoing examples are only for clearer illustration of the technical solutions provided in this application and should not be considered as limitations on this application. Those skilled in the art can select any parameter that can be used to characterize the features of a navigation route as the route features of this application according to business needs.
[0045] Step S203: Determine the cluster center to which the navigation scene feature belongs from multiple pre-generated cluster centers corresponding to route preferences.
[0046] Before sorting the routes, cluster centers corresponding to route preferences can be generated in advance. This stage can be called the clustering stage, which can be implemented as follows:
[0047] Based on historical navigation data, multiple navigation scenario feature samples were obtained;
[0048] Clustering algorithms, such as K-Means clustering and FCM (Fuzzy Clustering Mean), are used to cluster multiple navigation scene feature samples or processed navigation scene feature samples to obtain multiple cluster centers. Different cluster centers represent different route preferences.
[0049] After generating multiple cluster centers, for a route planning request actually initiated by a user, the method provided in this application can be used to determine the cluster center to which the navigation scene feature belongs by using the distance between the navigation scene feature corresponding to the route planning request or the feature obtained after processing the navigation scene feature and the respective cluster centers.
[0050] In some embodiments, a cluster center prediction model, such as a deep learning model, can be used to predict the cluster center to which a navigation scene feature belongs from multiple cluster centers.
[0051] In some embodiments, cluster centers can also be generated based on a cluster center prediction model. For specific implementation methods for generating cluster centers provided in this application, please refer to the embodiments provided in this application.
[0052] Step S204: Based on the cluster center to which the navigation scene features belong and the route features of each navigation route, obtain the recommended ranking of the multiple navigation routes.
[0053] Specifically, a route sorting strategy can be determined based on the cluster center to which the navigation scene features belong. Based on the determined route sorting strategy and the route features of each of the multiple navigation routes planned for the route planning request, the multiple navigation routes are sorted to obtain a recommended sort of the multiple navigation routes.
[0054] A route ranking strategy can be pre-configured for each cluster center in multiple cluster centers, including the route features and their weights used in the ranking. After determining the cluster center to which the navigation scene features belong in this navigation, the route score for each navigation route is calculated based on the route ranking strategy corresponding to the cluster center to which the navigation scene features belong, as well as the route features of each navigation route. The navigation routes are then ranked in descending order of their route scores.
[0055] Furthermore, based on the ranking of multiple navigation routes, the system can select the top-ranked routes as recommended routes and return them to the terminal for display. For example, if the routes are ranked from highest to lowest score, the first to Kth routes would be selected as recommended routes. K represents the total number of recommended routes; for instance, K is a configurable parameter that can be set to 2, 3, 4, or other values. Different recommended routes can also be labeled with different tags to help users quickly identify the advantages of each route and choose the one best for navigation.
[0056] In some embodiments, the recommended order of multiple navigation routes can be sent to a dedicated route recommendation module. This module then determines the recommended route based on the recommended order or route score, as well as the route characteristics of each navigation route. Specifically, navigation routes that rank higher or have higher scores and whose route characteristics meet certain conditions can be identified as recommended routes. In this embodiment, the order of the recommended routes may not be continuous but may be disjointed; for example, if K is 3, the recommended routes could be the first, third, and fourth routes in the order.
[0057] The route ranking strategy can also include filtering conditions for route features of navigation routes. By filtering out navigation routes that do not meet the filtering conditions, and then calculating the route score of each navigation route that meets the filtering conditions based on the various route features and their weights used to calculate the route score in the route ranking strategy, as well as the route features of each navigation route that meets the filtering conditions, the navigation routes that meet the filtering conditions are ranked in descending order of route score to obtain a recommended ranking of multiple navigation routes, and navigation routes are recommended to users based on the recommended ranking.
[0058] The route ranking method provided in this application determines the navigation scenario characteristics of the current navigation based on the parameters carried in the route planning request when the user initiates a route planning request. Then, it determines the cluster center to which the navigation scenario characteristics of the current navigation belong from multiple cluster centers corresponding to route preferences, that is, it identifies the user's route preference in the navigation scenario. At the same time, it determines the route characteristics of each planned navigation route, and ranks the multiple planned navigation routes based on the cluster center to which the navigation scenario characteristics belong and the route characteristics of each planned navigation route to obtain a recommended ranking result. Since the multiple cluster centers in this application are obtained in advance based on the clustering results of multiple navigation scenario feature samples, the cluster center to which the navigation scenario features of this navigation belong, determined from multiple cluster centers corresponding to route preferences, can represent the user's route preference in this navigation scenario. Compared with the fixed preference method, the prediction of route preference is more flexible and reasonable. Furthermore, this application can identify the user's route preference in different navigation scenarios, so that the route ranking result matches the user's route preference in the corresponding navigation scenario. Thus, when recommending routes to the user based on the route ranking result, it ensures that the recommended routes meet the user's needs, reduces the number of times the user manually adjusts the navigation route, and improves the user's navigation experience.
[0059] Optionally, based on the cluster center to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained, including:
[0060] Based on the cluster centers to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained through a pre-trained network model for ranking the navigation routes.
[0061] The network model is used to rank multiple navigation routes based on the input cluster centers and route features, thereby obtaining a recommended ranking or score for the multiple navigation routes.
[0062] The network model can be any deep learning model, such as MLP (Multilayer Perceptron), Transformer, DeepFM (Deep Factorization Machines), etc.
[0063] Leveraging the model's powerful learning capabilities, navigation routes are ranked based on the cluster center of the navigation scenario and the route features of the recalled multiple navigation routes, ensuring that the ranking or scoring of navigation routes matches the user's route preferences.
[0064] In practical implementation, the cluster centers to which the navigation scene features belong and the route features of each navigation route can be directly used as inputs to the network model for ranking navigation routes. Alternatively, the cluster centers to which the navigation scene features belong and the route features of each navigation route can be fused together, and the fused features can be used as inputs to the network model. This improves the comprehensiveness of the network model's understanding of the input data, thereby improving the accuracy of model inference.
[0065] In some embodiments, the cluster center prediction model and the aforementioned network model can be integrated into one model, such as a ranking model. The ranking model determines the cluster center to which the navigation scene features belong, based on the input navigation scene features and multiple pre-generated cluster centers, as well as the route features of the input multiple navigation routes and the cluster center to which the features belong, and outputs a recommended ranking of the multiple navigation routes.
[0066] Optionally, based on the cluster centers to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained through a pre-trained network model for ranking navigation routes, including:
[0067] The data obtained by concatenating or weighting the cluster centers to which the navigation scene features belong with the route features of each navigation route is input into a pre-trained network model for ranking navigation routes, and the recommended ranking of the multiple navigation routes output by the network model is obtained.
[0068] For example, the cluster centers to which the navigation scene features belong can be concatenated at the end of the route features of the planned navigation route or at other positions to obtain concatenated features. These concatenated features can then be combined to obtain the input of the network model.
[0069] The input to the network model can also be a matrix obtained by concatenating the weighted vectors of the route features and the cluster centers to which the navigation scene features belong for each navigation route. This matrix is then input into the network model to obtain the recommended ranking of multiple navigation routes output by the model. The vector containing the weighting coefficients can be determined by the cluster centers to which the navigation scene features belong.
[0070] The weighted vectors corresponding to each cluster center can be pre-stored. For each planned navigation route, the weighted vectors corresponding to the cluster centers to which the navigation scene features belong can be used to weight each item in the route features of the navigation route. The weighted results of each navigation route are used as the input of the network model. The network model analyzes the input and outputs the recommended ranking of each planned navigation route.
[0071] The weighted vector can include the weight coefficients of each feature in the route features. Based on this weighted vector, the weighted result of each feature in the route features of the navigation route can be calculated, and the navigation scene features can be concatenated into this weighted result to obtain the input of the network model.
[0072] Specifically, during the generation of cluster centers, the weighted vector corresponding to the cluster center can be determined based on the navigation scene feature samples in the cluster corresponding to the cluster center and the route features of the navigation route used during actual navigation.
[0073] By using a splicing method to fuse the cluster centers of navigation scene features and the route features of navigation routes, the information of each input feature can be well preserved, thereby improving the understanding ability of the network model. By using a weighted fusion method, the input features can be pre-processed based on the importance and credibility of features in different dimensions, highlighting the influence of important features on model inference, while reducing the influence of noise or unimportant features on model inference, thereby improving the accuracy and robustness of model inference.
[0074] In addition to the aforementioned splicing and weighting methods, other methods can be used to fuse navigation scene features and navigation route features, and this application does not limit this.
[0075] Optionally, based on the cluster center to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained through a pre-trained network model for ranking navigation routes. This includes: determining the target model parameters corresponding to the cluster center to which the navigation scene features belong from the model parameters corresponding to route preferences obtained during pre-training; loading the target model parameters into the network model to obtain a route ranking model; and outputting a recommended ranking of the multiple navigation routes based on the route features of each navigation route through the route ranking model.
[0076] During the training phase, model parameters corresponding to each cluster center in multiple cluster centers can be obtained and stored. Then, during the application or inference phase, after determining the cluster center to which the navigation scene features belong, the model parameters corresponding to that cluster center—the target model parameters—can be retrieved from this correspondence. By loading the target model parameters into the initial network model, a route sorting model for this navigation route sorting is obtained.
[0077] Figure 3 Flowchart of the route sorting method provided in the embodiments of this application Figure 2 This embodiment is... Figure 2 Specific examples of the embodiments shown, Figure 3Taking navigation scenario features, including the distance from the origin to the destination, the type of points of interest corresponding to the origin and / or destination, navigation time characteristics, and route preference settings, as an example, for... Figure 2 The method described is presented in detail. It should be understood that in other implementations, the navigation scene features may include fewer or more features. Figure 3 The embodiments shown are merely examples and should not be considered as limitations on this application.
[0078] like Figure 3 As shown, the route sorting method provided in this embodiment may specifically include the following steps:
[0079] Step S301: In response to the route planning request initiated by the terminal, obtain the parameters corresponding to the route planning request, assuming that the parameters include: navigation time, departure point and destination.
[0080] Upon receiving a route planning request from the terminal, the system parses the request to obtain the parameters it carries. These parameters may include navigation time, departure point, and destination, or some of these parameters. If the navigation time is omitted in the route planning request, the time when the route planning request was received can be used as the navigation time.
[0081] Step S302: Calculate the distance from the departure point to the destination and determine the characteristics of the navigation time.
[0082] The distance between a starting point and a destination can be represented by either a straight-line distance or a spherical distance. Straight-line distance is the point-to-point distance, calculated based on the coordinates of the starting point (latitude and longitude) and the destination (e.g., Euclidean distance).
[0083] The characteristics of navigation time may include features that characterize whether the navigation time is a holiday or a daytime event.
[0084] Taking a navigation time of 10:00 on Sunday, January 21, 2024 as an example, the characteristic of the navigation time can be NW_D, where "NW" represents a holiday and "D" represents daytime.
[0085] Step S303: Obtain the user's route preference settings, and obtain the type of point of interest corresponding to the departure point and / or the type of point of interest corresponding to the destination.
[0086] Route preferences can be set by users through navigation software. These preferences can be stored locally on the device or on the server and are linked to the user's identity. If a user has not set any route preferences, the settings can be empty. Route preference options include, but are not limited to, highway priority, time priority, congestion avoidance, avoiding highways, and lower toll rates. Specifically, highway priority indicates a preference for routes with a high percentage of highway travel time; time priority indicates a preference for routes with shorter travel times; congestion avoidance indicates a preference for routes with less congestion; avoiding highways indicates a preference for routes that do not use highways; and lower toll rates indicate a preference for routes with lower tolls.
[0087] The types of points of interest (POIs) corresponding to the departure or destination can, to some extent, characterize a user's route preferences. Types of POIs include, but are not limited to, train stations, bus stations, commuter POIs, and tourist attractions. Commuter POIs include those corresponding to the user's residence and workplace.
[0088] For example, when the destination is a train station or bus station, the user's route preference can be determined to be either time-priority or a combination of time-priority and congestion avoidance. When the departure point is the user's residence and the destination is the user's workplace, the user's route preference can be determined to be familiar route priority, i.e., the user prefers the commuting route they frequently take. When the destination is a tourist attraction across cities, the user's route preference can be determined to be highway priority.
[0089] Step S304: Process the obtained distance, navigation time features, type of points of interest corresponding to the origin and / or destination, and route preference settings to obtain navigation scene features.
[0090] In some embodiments, the method further includes obtaining the user's familiar route selection frequency, thereby processing the obtained distance, navigation time characteristics, the type of point of interest corresponding to the origin and / or destination, route preference settings, and the user's familiar route selection frequency to obtain navigation scenario features. The familiar route selection frequency characterizes how often the user selects familiar routes during navigation.
[0091] After each navigation session, determine whether the user selected a familiar route (i.e., a route previously navigated to). If so, increment the user's familiar route selection count by 1. Simultaneously, update the user's familiar route selection frequency based on the new familiar route selection count.
[0092] Parameter processing operations are used to extract the features of the parameters, including but not limited to normalization, numerical transformation, interpolation, and outlier removal.
[0093] The features obtained after distance processing are denoted as distance features; the features obtained after processing the types of points of interest corresponding to the origin and / or destination are denoted as point of interest type features; the features obtained after processing the types of navigation time are denoted as navigation time type features; and so on.
[0094] By extracting multi-dimensional features, the richness and completeness of the description of navigation scenarios are improved, providing a sufficient data foundation for route preference identification and improving the accuracy of route preference identification in different navigation scenarios.
[0095] The above-described methods for obtaining navigation scene features are merely examples. Navigation scene features can also be obtained through preprocessing with fewer or more dimensions of parameters, such as features corresponding to navigation modes. The examples in this embodiment should not be considered as limitations on this application.
[0096] Step S305: Using a pre-trained cluster center prediction model, based on the navigation scene features, determine the cluster center to which the navigation scene features belong from multiple pre-generated cluster centers corresponding to route preferences.
[0097] The cluster center prediction model pre-stores multiple cluster centers corresponding to route preferences, obtained by clustering a large number of navigation scene feature samples. The cluster center prediction model is used to predict the cluster center to which the navigation scene feature belongs from the multiple stored cluster centers based on the input navigation scene feature.
[0098] Cluster center prediction models can be deep learning models, such as autoencoders (AEs), MLPs, attention models, and Transformers.
[0099] The training samples in the training set of the cluster center prediction model, i.e., navigation scene feature samples, can be obtained by extracting navigation scene features from a large number of historical navigation records. Historical navigation records are data from multiple users navigating at historical times, including information such as the origin, destination, and navigation time at those times.
[0100] The cluster center prediction model stores multiple cluster centers pre-obtained through a clustering algorithm. During the training process, the cluster centers can be iteratively updated based on the training samples belonging to the same cluster center obtained in each round of training. After the model training is completed, the multiple cluster centers corresponding to the route preference and the pre-trained cluster center prediction model can be obtained.
[0101] For example, Figure 4 For this application Figure 3The schematic diagram of the cluster center prediction model in the illustrated embodiment is shown below. Figure 4 As shown, the cluster center prediction model includes an encoder and a cluster center prediction layer. The encoder is used to calculate the encoded feature E of the input navigation scene feature X. The cluster center prediction layer is used to calculate the distance between the input encoded feature E and each of the pre-generated cluster centers corresponding to route preferences, and to determine the nearest cluster center as the cluster center C to which the navigation scene feature X belongs, thus obtaining the output of the cluster center prediction model. Figure 4 Taking n cluster centers as an example, these n cluster centers, namely c1 to cn, are stored in vector V.
[0102] By using the encoder in the deep learning model to extract coded features from the navigation scene features, the model can better capture the complex features in the navigation scene features and improve the data representation ability. At the same time, the encoder can realize data augmentation and expansion, providing rich and multi-dimensional data support for cluster center prediction, thereby improving the accuracy of predicting the cluster centers to which the navigation scene features belong.
[0103] Step S306: For the multiple navigation routes generated based on the route planning request, determine the route characteristics of each navigation route.
[0104] The navigation route can be obtained by any route retrieval method, such as the A* search algorithm or the A algorithm, Dijkstra's algorithm, or the RRT (Rapidly-Exploring Random Trees) algorithm. This application does not limit the specific method used.
[0105] For each navigation route obtained from the origin to the destination corresponding to the route planning request, the route attributes of the navigation route are obtained, such as route length, travel time, whether it is toll-free, and congestion level. For each navigation route among multiple navigation routes, the route attributes of the navigation route are preprocessed to obtain the route features of the navigation route. The route features of each navigation route are then concatenated in a certain order to obtain a route feature matrix.
[0106] Step S307: Determine the target model parameters corresponding to the cluster center to which the navigation scene feature belongs from the model parameters corresponding to the route preference obtained during pre-training.
[0107] Step S308: Load the target model parameters into the network model to obtain the route ranking model.
[0108] Among them, the model parameters corresponding to route preferences obtained during pre-training are in multiple sets, and each set of model parameters corresponds to one of the cluster centers, that is, there is a one-to-one correspondence between the cluster centers and the model parameters.
[0109] After clustering the navigation scene feature samples or the features obtained after processing the navigation scene feature samples, such as encoded features, multiple cluster centers are obtained. For each cluster center, the network model is trained based on the training samples corresponding to the navigation scene feature samples in the cluster corresponding to that cluster center. After training, a set of model parameters corresponding to that cluster center is obtained, and the obtained model parameters and the network model are stored separately.
[0110] The training samples for the network model can include route feature samples, as well as other feature samples, such as environmental features. Environmental features can include navigation scene feature samples, and also weather feature samples.
[0111] When performing route sorting, the system searches for a set of model parameters corresponding to the cluster center to which the navigation scene features belong from multiple stored sets of model parameters to obtain the target model parameters. The target model parameters are then loaded into the framework of the network model to obtain the route sorting model corresponding to the cluster center to which the navigation scene features belong.
[0112] Step S309: Based on the route features of each navigation route, the recommended ranking of the multiple navigation routes is output through the route ranking model.
[0113] The route features of each navigation route can be input into the route ranking model corresponding to the cluster center to which the navigation scene features belong. The route ranking model analyzes the route features of the input multiple navigation routes and outputs a recommended ranking of the multiple navigation routes.
[0114] In some embodiments, the input to the route ranking model may include, in addition to route features, road features, navigation scene features, bias features, statistical information features, etc. The input to the route ranking model may also include other features, such as the deviation features of the navigation route, which are features used to describe information such as the intersections where the user deviates from the navigation route and the probability of deviation.
[0115] Route features include characteristics describing traffic conditions such as congestion levels, estimated travel time, route length, and route cost. Road features include characteristics describing the sequence of roads traversed by the navigation route and the road classification of the roads traversed by the navigation route. Bias features include features describing the similarity of navigation routes. Statistical information features include features describing the user's personal road network and familiar routes. The personal road network is determined based on the routes the user has traveled in their historical navigation journeys, and familiar routes are roads that the user has traveled more than a certain number of times.
[0116] The route ranking model ranks multiple planned navigation routes from the origin to the destination based on the input features, and obtains a recommended ranking.
[0117] The route ranking model can calculate the score of each navigation route based on the input features, and rank the navigation routes in descending order of score, outputting the ranking result.
[0118] After obtaining the recommended ranking output by the route ranking model, K recommended routes can be selected based on the ranking, such as the top K navigation routes. These K recommended routes can then be displayed to the user, along with the advantages of each route. K is a positive integer, such as 5.
[0119] Route ranking models and cluster center prediction models can be different parts of the same model or framework. For example, a route recommendation model might include both a cluster center prediction model and a route ranking model. A route recommendation model takes navigation scenario features and basic features as input and outputs a ranking of multiple navigation routes or at least one recommended route. Basic features include route features, and may also include road features, statistical information features, and other features.
[0120] For example, Figure 5 This is a schematic diagram of the structure of a route recommendation model provided in an embodiment of this application, as shown below. Figure 5 As shown, the route recommendation model includes a first encoder, a second encoder, and a prediction layer. The prediction layer comprises multiple layers, with one or more layers constituting a cluster center prediction layer P1, and the remaining layers constituting a route prediction layer P2. The first encoder and the cluster center prediction layer P1 form the aforementioned cluster center prediction model, and the second encoder and the route prediction layer P2 form the aforementioned route ranking model. The first encoder encodes the input navigation scene features X to obtain a first encoded feature E1; the second encoder encodes the input basic features X0 to obtain a second encoded feature E2; the prediction layer determines the cluster center to which the navigation scene feature X belongs based on the first encoded feature E1, and obtains the output Y of the route recommendation model, such as at least one recommended route, based on the cluster center to which the navigation scene feature X belongs and the second encoded feature E2.
[0121] In this embodiment, a cluster center prediction model is used to predict the cluster centers to which navigation scene features belong. By leveraging the model's powerful learning and data representation capabilities, the accuracy of cluster center prediction is improved. Based on the predicted cluster centers, the model parameters of the route ranking model are determined, thereby enabling route ranking based on the route preferences corresponding to the cluster centers, which improves the accuracy and flexibility of route ranking.
[0122] Figure 6 Flowchart of the route sorting method provided in the embodiments of this application Figure 3 This embodiment is... Figure 2 Optimizations of the illustrated embodiment. As... Figure 6As shown, the route sorting method provided in this embodiment may specifically include the following steps:
[0123] Step S601: Input multiple test samples into the pre-trained cluster center prediction model to obtain the cluster center to which each test sample belongs. Based on the cluster center, the multiple test samples are divided into multiple clusters.
[0124] The multiple test samples include navigation scene feature samples corresponding to data recorded by multiple sample users during historical navigation.
[0125] The collected navigation scene feature samples can be divided into training and testing sets according to a certain ratio, such as 9:1, 8:2, 7:3, etc. The navigation scene feature samples in the training set are denoted as training samples, and the navigation scene feature samples in the testing set are denoted as testing samples. The navigation scene feature samples are the navigation scene features corresponding to the navigation data during historical navigation.
[0126] After training the cluster center prediction model on the training set, a pre-trained cluster center prediction model is obtained. The pre-trained model is then tested using multiple test samples from the test set to determine the cluster centers of each test sample. Based on these cluster centers, the model is judged whether it passes the test. If it does, subsequent inference is performed based on the model. If it fails, the parameters or cluster centers of the model are adjusted, and the model is retrained.
[0127] After the cluster center prediction model passes the test, the test samples in the test set are divided into multiple clusters based on the cluster centers to which each test sample belongs. Test samples with the same cluster center belong to the same cluster.
[0128] Step S602: For each cluster in the multiple clusters, based on the route characteristics of the actual walking routes corresponding to the test samples in the cluster, determine the weighted vector corresponding to the cluster center of the cluster.
[0129] The weighted vector includes the weight coefficients of each feature in the route features, used to weight the route features to obtain the route score. The actual route is the route actually walked or driven by the sample users during historical navigation.
[0130] For each test sample, the actual route and its characteristics are obtained. After dividing the test samples into multiple clusters based on their respective cluster centers, the weighted vector corresponding to the cluster center of each cluster is determined based on the route characteristics of the actual routes of the test samples within each cluster.
[0131] Specifically, the distribution of route features of actual walking routes corresponding to each test sample in the same cluster can be statistically analyzed, and the weighted vector corresponding to the cluster center of the cluster can be determined based on the statistical results.
[0132] For example, for each feature in the route features, the proportion of the value of that feature in the actual route corresponding to each test sample in the same cluster that is greater than a preset value can be counted. Based on this proportion, the weight coefficient of that feature in the weighted vector can be determined. By traversing each feature in the route features, a weighted vector corresponding to a cluster center can be obtained.
[0133] For a test sample, the weight coefficients of each feature in the route features of the actual route corresponding to the test sample can be determined based on the values of each feature, thus obtaining the weight vector of the test sample. Furthermore, based on the similarity of the weight vectors of the actual routes corresponding to test samples within the same cluster, and the statistical values of each weight coefficient in the weight vector, such as the mean, median, and maximum value, the weight vector corresponding to the cluster center of that cluster can be determined.
[0134] For each feature of the route, the weight coefficient of that feature in the weighted vector can be the average, mode, or other statistical value of the weight coefficients of that feature in the weight vectors of the corresponding multiple actual routes.
[0135] Taking the weight coefficients in the weighted vector as the mode of the weight coefficients of the same feature in the weight vectors of multiple actual routes as an example. Suppose that the route features include 5 features, and a certain cluster includes 3 test samples. The weight vectors of the actual routes corresponding to these 3 test samples are [0.1,0.2,0.5,0.2,0], [0.1,0.2,0.4,0.2,0.1] and [0.1,0.2,0.5,0.1,0.1], respectively. Then the weighted vector corresponding to the cluster center of this cluster can be determined as [0.1,0.2,0.5,0.2,0.1].
[0136] Furthermore, after obtaining the weighted vectors corresponding to each cluster center, the correspondence between the cluster centers and the weighted vectors is stored.
[0137] Step S603: Determine the navigation scenario characteristics based on the parameters carried in the route planning request.
[0138] Step S604: Input the navigation scene features into a pre-trained cluster center prediction model, and determine the cluster center to which the navigation scene features belong from multiple stored cluster centers through the cluster center prediction model.
[0139] Step S605: Obtain the weighted vector corresponding to the cluster center to which the navigation scene feature belongs.
[0140] Specifically, based on the cluster center to which the navigation scene features belong, the weighted vector corresponding to that cluster center can be read from the correspondence between the cluster center and the weighted vector.
[0141] Step S606: For each of the multiple navigation routes generated based on the route planning request, calculate the route score of the navigation route based on the weighted vector corresponding to the cluster center to which the navigation scene features belong and the route features of the navigation route.
[0142] The route features of each navigation route can be weighted based on the weight coefficients in the weighted vector corresponding to the cluster center to which the navigation scene features belong, so as to obtain the route score of each navigation route.
[0143] Before weighting the route features of the navigation route, the route features can be normalized to avoid the route score being affected by the value range of different route features.
[0144] For one of the navigation routes, its route feature vector stores the values of various route features. The product of the transpose of the weighted vector and the route feature vector of the navigation route can be calculated to obtain the route score of the navigation route.
[0145] Step S607: Based on the route scores, obtain the recommended ranking of the multiple navigation routes.
[0146] Furthermore, based on route scores or recommendation rankings, at least one recommended route can be determined from multiple navigation routes.
[0147] In some embodiments, navigation routes can be sorted in descending order of route score, and the top K navigation routes in the sorting results can be selected as recommended routes.
[0148] In some embodiments, when there is a route score among multiple navigation routes that is higher than a preset score, the navigation route with the higher route score can be identified as the recommended route.
[0149] In this embodiment, a pre-trained cluster center prediction model and multiple cluster centers are used to cluster the test samples in the test set, resulting in multiple clusters. Based on the route feature distribution of the actual routes corresponding to the test samples in each cluster, the route preference type of each cluster center is statistically obtained, i.e., the weighted vector corresponding to each cluster center. Thus, during the inference stage, the cluster center prediction model is used to predict the cluster center to which the navigation scenario belongs. Using the weighted vector corresponding to this cluster center, the route score of each navigation route from the origin to the destination is evaluated, and the navigation routes are sorted in descending order of route score. By determining the weighted vector corresponding to each cluster center based on the model's prediction results for the test samples, the accuracy of the weighted vector determination is improved, allowing the weighted vector to better represent the user's route preference in the corresponding navigation scenario, thus improving the accuracy of route ranking. Using weighted vectors for navigation route evaluation has low computational complexity and high efficiency, improving the efficiency of route ranking and recommendation.
[0150] Figure 7 A flowchart illustrating the method for generating cluster centers provided in this application embodiment. Figure 1 The method for generating cluster centers is used to train the cluster center prediction model provided in any of the foregoing embodiments of this application to generate cluster centers that represent route preferences, with each cluster center corresponding to a route preference.
[0151] like Figure 7 As shown, the method for generating cluster centers includes the following steps:
[0152] Step S701: The encoder of the cluster center prediction model outputs the feature vector corresponding to the training sample based on the historical navigation scene features included in the training sample set.
[0153] The historical navigation scene features carry information that enables the cluster center prediction model to learn route preferences.
[0154] After obtaining the training sample set and initializing multiple cluster centers, the training of the cluster center prediction model and the determination of multiple cluster centers representing route preferences can be achieved through subsequent steps, namely steps S702 to S704.
[0155] During a navigation session initiated by a user through navigation software, data such as navigation time, origin, destination, planned route, recommended route, user-selected route, and actual route taken can be recorded. Based on data from multiple navigation sessions recorded over historical time, multiple historical navigation scenario features can be obtained. The preset number of cluster centers can be initialized using any initialization method. For example, a default value conforming to a preset distribution can be used as the initial value for each cluster center within that preset number of cluster centers. Alternatively, a preset number of training samples can be randomly selected, and the selected training samples, or the encoded features obtained after the selected training samples are encoded by the cluster center prediction model, can be used as the initial values for the preset number of cluster centers.
[0156] Optionally, the method for generating cluster centers further includes: obtaining feature vectors for each of the first training samples based on historical navigation scene features of multiple first training samples in the training sample set via the encoder; and selecting a preset number of feature vectors from the feature vectors of the multiple first training samples as the first vector of a preset number of cluster centers.
[0157] The first training sample is a subset of the training samples in the training sample set, used to initialize the cluster centers.
[0158] The historical navigation scene features from multiple first training samples can be input into the encoder of the cluster center prediction model to obtain the feature vectors of each first training sample output by the encoder. Then, randomly or according to certain rules, a preset number of feature vectors are selected from the feature vectors of multiple first training samples as the initial values of the preset number of cluster centers, i.e., the first vector.
[0159] By using the feature vectors of a small subset of training samples output by the encoder, the cluster centers are initialized, which improves the accuracy of cluster center initialization and avoids the problem of excessively long training time caused by the large difference between the initial and final values of the cluster centers.
[0160] Optionally, initializing a preset number of cluster centers, i.e., determining the first vector of the preset number of cluster centers, includes:
[0161] From the multiple training samples of the cluster center prediction model, at least one batch of training samples is selected; the selected batch of training samples is input into the encoder of the cluster center prediction model to obtain the feature vector of each selected training sample; from the feature vector of each selected training sample, a preset number of feature vectors are selected as the initial value of the cluster center, i.e., the first vector.
[0162] A batch of training samples can be randomly selected, along with a preset number of feature vectors from that batch of training samples, as the initial values for cluster centers.
[0163] Furthermore, to avoid the initial values of cluster centers being too concentrated, a feature vector of a training sample can be randomly selected as the initial value for a cluster center. When selecting the next cluster center, the next cluster center should be far from the initial values of the already obtained cluster centers, such as a distance greater than a set distance. By distributing the initial values widely, the speed of cluster convergence can be improved, and the risk of clustering getting trapped in local optima can be reduced.
[0164] During training, the cluster centers, excluding the initial value (i.e., the first vector), are the values of each training round. The cluster centers can be used to predict the values of multiple cluster centers representing route preferences obtained from the previous training round of the model.
[0165] Step S702: Through the cluster center prediction layer of the cluster center prediction model, the distance between the training sample and each of the cluster centers is determined based on the distance between the feature vector of the training sample and the vector of each pre-generated cluster center, and the cluster center with the shortest distance to the training sample is taken as the predicted cluster center corresponding to the training sample.
[0166] Step S703: Calculate the clustering loss value based on the vector of the predicted cluster center corresponding to the training sample and the feature vector corresponding to the training sample.
[0167] Step S704: Based at least on the clustering loss value, backpropagate to adjust the parameters of the encoder and the vector of the cluster centers until a preset condition is met, and obtain multiple cluster centers representing route preferences.
[0168] During each training round, the cluster centers and parameters of the cluster center prediction model need to be updated based on the output of the cluster center prediction model until the training termination condition is met, such as the maximum number of iterations, the maximum training time, or the distance between the training sample and its cluster center meets certain conditions.
[0169] For a cluster center prediction model that includes an encoder and a cluster center prediction layer, steps S7031 and S7034 can be executed during each training round to iterate the parameters of the cluster center and the cluster center prediction model.
[0170] Step S7031: Input a batch of training samples corresponding to this round of training into the encoder in sequence. Based on the feature vector of each training sample in the batch of training samples obtained by the encoder, and based on the decoder, obtain the reconstructed features of each training sample in the batch of training samples.
[0171] The decoder takes the encoder's output as input, that is, it takes the feature vector of the training sample as input and the reconstructed features of the training sample as output.
[0172] Step S7032: Based on the distance between the feature vector of each training sample in the batch of training samples and the cluster centers obtained in the previous round of training of the cluster center prediction model, determine the cluster center to which each training sample in the batch of training samples belongs.
[0173] Step S7033: Calculate the clustering loss value based on the distance between each training sample and its respective cluster center in the batch of training samples, and update the multiple cluster centers when the clustering loss value is greater than a preset value, so as to perform the next round of training based on the updated multiple cluster centers.
[0174] Updating multiple cluster centers specifically involves recalculating the value of the cluster center based on the feature vectors of each training sample belonging to the same cluster center.
[0175] Step S7034: Based on the reconstruction features of each training sample in the batch of training samples, calculate the reconstruction loss value, and update the parameters of the cluster center prediction model based on the reconstruction loss value.
[0176] The training samples in the training set can be divided into multiple batches, with each batch corresponding to one training round. In each round, the clustering loss value is calculated based on the distance between each training sample in a batch and its predicted cluster center, thus updating the cluster centers. Then, a reconstruction loss value can be calculated based on the deviation between the encoder's input and the decoder's output. Through backpropagation of the reconstruction and clustering loss values, the parameters of the cluster center prediction model are updated, specifically the parameters of the encoder and the cluster center prediction layer. This process is repeated, alternating between updating the cluster centers and model parameters, until the training termination condition (i.e., a preset condition) is met, such as the clustering and reconstruction loss values being relatively small for multiple consecutive rounds, or the training rounds or time reaching their maximum limits.
[0177] When the clustering loss value exceeds a preset value, each cluster center is updated to the average of the feature vectors of the training samples within the corresponding cluster. That is, for multiple training samples whose respective cluster centers are all cluster center i, cluster center i can be updated to the average of the feature vectors of these multiple training samples.
[0178] For example, taking a batch of training samples including 128 samples as an example, assuming that the 1st, 9th and 20th training samples all belong to cluster center 1, then cluster center 1 can be updated according to the feature vectors of the 1st, 9th and 20th training samples, such as updating cluster center 1 to the average value, centroid and other values of the encoded features of the 1st, 9th and 20th training samples.
[0179] When the clustering loss value is less than or equal to the preset value, the cluster centers do not need to be updated.
[0180] The reconstruction loss function measures the deviation between the encoder's input, i.e., the training samples, and the decoder's output, i.e., the reconstructed features.
[0181] An encoder maps input data to a feature space, and a decoder then maps the feature vectors from that feature space back to the original space, thus reconstructing the data. The reconstruction loss value allows for the evaluation of the encoder's reconstruction error, and the encoder parameters are continuously adjusted to optimize the data.
[0182] After training, the current cluster center prediction model and a preset number of cluster centers can be output to facilitate the determination of the cluster center to which the navigation scene features corresponding to the route planning request belong during the inference phase.
[0183] Figure 8 For this application Figure 7 The illustrated embodiment provides a schematic diagram of the cluster center prediction model during the training phase. Figure 8 Taking an autoencoder as an example, such as Figure 8 As shown, for a cluster center prediction model that includes an autoencoder and a cluster center prediction layer, the autoencoder in the cluster center prediction model is connected to a decoder during the model training phase. The training sample X is the input of the autoencoder, which processes the training sample into a feature vector E. The feature vector E is then reconstructed by the decoder into a reconstructed feature X'. The reconstructed feature X' and the training sample X are two features in the same space. The clustering loss value is calculated by the distance between the feature vector E and the cluster center C to which the training sample X belongs (output by the cluster center prediction layer). This clustering loss value is used to update the cluster centers. The reconstruction loss value is calculated by the deviation between the reconstructed feature X' and the training sample X. The reconstructed loss value and the clustering loss value are used for joint training of the cluster center prediction model, achieving alternating updates of the cluster centers and model parameters, thus completing the training of the cluster center prediction model.
[0184] In some embodiments, route ranking can be achieved based on the cluster center to which the navigation scene belongs and the route features of each of the planned multiple navigation routes, or it can be implemented using a model. That is, after determining the navigation scene features, the navigation scene features are input into the route ranking model, and the cluster center to which the navigation scene features belong is determined based on the route ranking model. Furthermore, at least one recommended route can be determined from multiple navigation routes based on the cluster center to which the navigation scene features belong and the input basic features.
[0185] The route recommendation function can be integrated into the route ranking model. For the sake of distinction, the route ranking model here will be referred to as the route recommendation model.
[0186] For this route recommendation model, the schematic diagram during the model training phase is as follows: Figure 9 As shown, Figure 9 A schematic diagram of the route recommendation model during the training phase provided in this application embodiment, as shown below. Figure 9 As shown, the route recommendation model includes a first encoder, a second encoder, and a scene-based route recommendation module. The scene-based route recommendation module consists of multiple layers. Some network layers are used to predict the cluster center C to which the input of the first encoder belongs based on the input feature vector E1. The remaining network layers are used to determine the route score of the navigation route (e.g., path1 to path5) corresponding to the training sample X based on the predicted cluster center C to which the input of the first encoder belongs and the feature E2 obtained by the second encoder after the input basic feature X0. This allows for the determination of at least one recommended route from multiple planned navigation routes based on the route score during the inference phase by adding a fully connected layer. The first encoder takes training sample X as input and processes it into feature vector E1. The cluster loss is calculated by measuring the distance between feature vector E1 and the cluster center C to which training sample X belongs, as output by the scene-based route recommendation module. This cluster loss is then used to update the cluster centers. The overall model loss is calculated by comparing the route score of each navigation route output by the route recommendation model with the actual score of each route. The overall model loss and the cluster loss are used for joint training of the route recommendation model, enabling alternating updates to cluster centers and model parameters, thus completing the training of the route recommendation model. The actual scores of the navigation routes can be obtained through manual annotation or by using other highly accurate deep learning models or tools.
[0187] For example, a scenario-based route recommendation module can be an MLP model.
[0188] Corresponding to the route sorting method provided in the foregoing embodiments of this application, this application also provides a route sorting device, which includes: a scene feature determination module, used to determine navigation scene features based on parameters carried in a route planning request; a route feature determination module, used to determine the route features of each of the multiple navigation routes generated based on the route planning request; a cluster center determination module, used to determine the cluster center to which the navigation scene features belong from a plurality of pre-generated cluster centers corresponding to route preferences; and a route sorting module, used to obtain a recommended sorting of the plurality of navigation routes based on the cluster center to which the navigation scene features belong and the route features of each of the navigation routes.
[0189] Optionally, the route ranking module is specifically used to: based on the cluster center to which the navigation scene features belong and the route features of each navigation route, obtain a recommended ranking of the multiple navigation routes through a pre-trained network model for ranking navigation routes.
[0190] Optionally, the route ranking module is specifically used to: determine the target model parameters corresponding to the cluster center to which the navigation scene features belong from the model parameters corresponding to route preferences obtained during pre-training; load the target model parameters into the network model to obtain the route ranking model; and output the recommended ranking of the multiple navigation routes based on the route features of each navigation route through the route ranking model.
[0191] Optionally, the route ranking module is specifically used to: concatenate or weight the data obtained by combining the cluster center to which the navigation scene features belong with the route features of each navigation route, input the data into a pre-trained network model for ranking navigation routes, and obtain the recommended ranking of the multiple navigation routes output by the network model.
[0192] Optionally, the cluster center determination module is specifically used to: determine the cluster center to which the navigation scene features belong from a plurality of pre-generated cluster centers corresponding to route preferences, based on the navigation scene features, using a pre-trained cluster center prediction model.
[0193] Optionally, the cluster center prediction model includes an encoder and a cluster center prediction layer. The encoder is used to calculate the encoded features of the navigation scene features. The cluster center prediction layer is used to calculate the distance between the encoded features and each pre-generated cluster center corresponding to the route preference, and determine the nearest cluster center as the cluster center to which the navigation scene features belong.
[0194] The route sorting device provided in this application embodiment can be used to execute the technical solution of the route sorting method provided in any of the above embodiments of this application. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.
[0195] This application provides an apparatus for generating cluster centers, used to generate cluster centers representing route preferences, with each cluster center corresponding to a route preference. The apparatus includes: a sample encoding module, used to output a feature vector corresponding to a training sample based on historical navigation scene features included in the training sample set via an encoder of a cluster center prediction model, wherein the historical navigation scene features carry information that enables the cluster center prediction model to learn route preferences; a cluster center corresponding module, used to determine the distance between the training sample and each of the cluster centers based on the distance between the feature vector of the training sample and the vectors of each pre-generated cluster center via a cluster center prediction layer of the cluster center prediction model, and to select the cluster center with the shortest distance to the training sample as the predicted cluster center corresponding to the training sample; a loss value calculation module, used to calculate a clustering loss value based on the vector of the predicted cluster center corresponding to the training sample and the feature vector corresponding to the training sample; and a yaw cluster center obtaining module, used to backpropagate and adjust the parameters of the encoder and the vector of the cluster center based at least on the clustering loss value until a preset condition is met, thereby obtaining multiple cluster centers representing route preferences.
[0196] Optionally, the apparatus for generating cluster centers further includes a cluster center initialization module, configured to: obtain feature vectors of each of the first training samples based on historical navigation scene features of multiple first training samples in the training sample set via the encoder; and select a preset number of feature vectors from the feature vectors of the multiple first training samples as the first vector of the preset number of cluster centers.
[0197] The apparatus for generating cluster centers provided in this application can be used to execute the technical solutions of the method for generating cluster centers provided in any of the above embodiments of this application. The implementation principle and technical effect are similar, and will not be described again here.
[0198] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device of this embodiment may include: at least one processor 1001; and a memory 1002 communicatively connected to the at least one processor; wherein the memory 1002 stores instructions executable by the at least one processor 1001, the instructions being executed by the at least one processor 1001 to cause the electronic device to perform the method as described in any of the above embodiments.
[0199] Optionally, the memory 1002 can be either standalone or integrated with the processor 1001.
[0200] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0201] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in any of the foregoing embodiments.
[0202] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the foregoing embodiments.
[0203] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0204] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.
[0205] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor. The memory may include RAM (Random Access Memory), and may also include NVM (Non-Volatile Memory), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.
[0206] The aforementioned storage media can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0207] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0208] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0209] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0210] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0211] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A route sorting method, characterized in that, include: Based on the parameters carried in the route planning request, the characteristics of the navigation scenario are determined; For each of the multiple navigation routes generated based on the route planning request, determine the route characteristics of each navigation route; From a pool of pre-generated cluster centers corresponding to route preferences, determine the cluster center to which the navigation scene features belong; Based on the cluster center to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained.
2. The method according to claim 1, characterized in that, Based on the cluster centers to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained, including: Based on the cluster centers to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained through a pre-trained network model for ranking the navigation routes.
3. The method according to claim 2, characterized in that, Based on the cluster centers to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained through a pre-trained network model for ranking navigation routes, including: From the model parameters corresponding to route preferences obtained during pre-training, determine the target model parameters corresponding to the cluster centers to which the navigation scene features belong; The target model parameters are loaded into the network model to obtain the route ranking model; Based on the route features of each navigation route, the route ranking model outputs a recommended ranking of the multiple navigation routes.
4. The method according to claim 2, characterized in that, Based on the cluster centers to which the navigation scene features belong and the route features of each navigation route, a recommended ranking of the multiple navigation routes is obtained through a pre-trained network model for ranking navigation routes, including: The data obtained by concatenating or weighting the cluster centers to which the navigation scene features belong with the route features of each navigation route is input into a pre-trained network model for ranking navigation routes, and the recommended ranking of the multiple navigation routes output by the network model is obtained.
5. The method according to any one of claims 1-4, characterized in that, Determining the cluster center to which the navigation scene features belong from multiple pre-generated cluster centers corresponding to route preferences includes: Using a pre-trained cluster center prediction model, the cluster center to which the navigation scene features belong is determined from multiple pre-generated cluster centers corresponding to route preferences, based on the navigation scene features.
6. The method according to claim 5, characterized in that, The cluster center prediction model includes an encoder and a cluster center prediction layer. The encoder is used to calculate the encoded features of the navigation scene features. The cluster center prediction layer is used to calculate the distance between the encoded feature and each pre-generated cluster center corresponding to the route preference, and to determine the nearest cluster center as the cluster center to which the navigation scene feature belongs.
7. A method for generating cluster centers, characterized in that, The method for generating cluster centers representing route preferences, where each cluster center corresponds to one route preference, includes: The encoder of the cluster center prediction model outputs a feature vector corresponding to the training sample based on the historical navigation scene features included in the training sample set; the historical navigation scene features carry information that enables the cluster center prediction model to learn route preferences. Through the cluster center prediction layer of the cluster center prediction model, the distance between the training sample and each of the cluster centers is determined based on the distance between the feature vector of the training sample and the vector of each pre-generated cluster center. The cluster center with the shortest distance to the training sample is taken as the predicted cluster center corresponding to the training sample. Based on the vector of the predicted cluster center corresponding to the training sample and the feature vector corresponding to the training sample, the clustering loss value is calculated. Based at least on the clustering loss value, the encoder parameters and the vector of the cluster centers are adjusted by backpropagation until a preset condition is met, resulting in multiple cluster centers representing route preferences.
8. The method according to claim 7, characterized in that, Also includes: The encoder obtains the feature vector of each first training sample based on the historical navigation scene features of multiple first training samples in the training sample set. From the feature vectors of the plurality of first training samples, a preset number of feature vectors are selected as the first vector of the preset number of cluster centers.
9. A route sorting device, characterized in that, include: The scene feature determination module is used to determine the navigation scene features based on the parameters carried in the route planning request; The route feature determination module is used to determine the route features of each of the multiple navigation routes generated based on the route planning request. The cluster center determination module is used to determine the cluster center to which the navigation scene feature belongs from a plurality of pre-generated cluster centers corresponding to route preferences; The route ranking module is used to obtain a recommended ranking of the multiple navigation routes based on the cluster center to which the navigation scene features belong and the route features of each navigation route.
10. An apparatus for generating cluster centers, characterized in that, The apparatus for generating cluster centers representing route preferences, wherein one cluster center corresponds to one route preference, comprises: The sample encoding module is used to output the feature vector corresponding to the training sample based on the historical navigation scene features included in the training sample set by the encoder of the cluster center prediction model. The historical navigation scene features carry information that enables the cluster center prediction model to learn route preferences. The cluster center corresponding module is used to determine the distance between the training sample and each of the cluster centers based on the distance between the feature vector of the training sample and the vector of each pre-generated cluster center through the cluster center prediction layer of the cluster center prediction model, and to take the cluster center with the shortest distance to the training sample as the predicted cluster center corresponding to the training sample. The loss calculation module is used to calculate the clustering loss value based on the vector of the predicted cluster center corresponding to the training sample and the feature vector corresponding to the training sample; The yaw cluster center acquisition module is used to backpropagate and adjust the parameters of the encoder and the vector of the cluster centers based at least on the clustering loss value until a preset condition is met, thereby obtaining multiple cluster centers that represent route preferences.