Model training method, navigation path recommendation method, device, equipment and medium

By training and updating the trajectory similarity recognition model in a federated learning environment, the problem of cross-region path matching is solved, and the privacy protection of trajectory data and the accuracy and efficiency of similarity calculation are achieved.

CN119226792APending Publication Date: 2024-12-31PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411197276.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The prior art is difficult to train a model that can match similarity paths across regions. It is mainly due to the differences in geographical environment and urban layout, which leads to large differences in trajectory data, and data privacy and security issues restrict cross-city data sharing, making model training difficult.

Method used

By obtaining the vehicle trajectory data of the current city, building a trajectory sample data set, training a graph neural network model, obtaining a trajectory similarity recognition model, and sending the model parameters to the federated learning server for global model parameter weighted updates to ensure data privacy protection and improve Model applicability and accuracy.

Benefits of technology

The accuracy and efficiency of cross-city trajectory similarity calculation is achieved, the privacy of the data of each city trajectory is protected, and the accuracy and efficiency of path matching is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226792A_ABST
    Figure CN119226792A_ABST
Patent Text Reader

Abstract

The invention provides a model training method, a navigation path recommendation method, devices, equipment and a medium, and belongs to the field of data processing. The method comprises the following steps: constructing a trajectory sample data set of a current city based on trajectory data; training a preset graph neural network model based on the trajectory sample data set to obtain a convergent first trajectory similarity recognition model; sending model parameters of the first trajectory similarity identification model to a federated learning server, wherein the federated learning server determines global model parameters corresponding to all cities according to the model parameters sent by each computer device; global model parameters sent by the federal learning server are received, and model parameters of the first track similarity recognition model are updated according to the global model parameters; and when it is determined that the updated first trajectory similarity recognition model meets a preset requirement, determining the updated first trajectory similarity recognition model as a target trajectory similarity recognition model. And the accuracy of model training is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a model training method, a navigation path recommendation method, an apparatus, a device and a medium. Background Art

[0002] With the rapid development and widespread popularity of positioning technologies such as smartphones, Global Positioning System (GPS) devices, Internet of Things communications, and WIFI, location-based information services have developed rapidly. As an important part of intelligent transportation, route navigation plays an important role in our daily lives. At present, many excellent navigation software have emerged on the market, such as AutoNavi, Carlead, Baidu Maps, etc. These navigation software can provide people with very detailed navigation information through precise positioning, which greatly facilitates people's travel.

[0003] At present, there are more and more navigation recommendation methods based on path similarity, which are to save a large amount of navigation trajectory data and make navigation recommendations based on the similarity of navigation trajectory data. However, due to differences in geographical environment and urban layout, the trajectory data of different cities are very different when calculating trajectory similarity, which makes it difficult to directly apply the model to calculate trajectory similarity across cities. Secondly, due to data privacy and data security issues, trajectory data across cities often cannot be directly shared, which makes model training difficult.

[0004] Therefore, how to train a model that can perform similarity path matching across regions is a problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a model training method, a navigation path recommendation method, an apparatus, a device and a medium, which are intended to train a model with high similarity path matching accuracy to improve the accuracy and efficiency of similarity path matching.

[0006] In a first aspect, the present application provides a model training method, which is applied to a computer device, and the model training method comprises the following steps:

[0007] Acquire trajectory data of vehicles in a current city, and construct a trajectory sample data set of the current city based on the trajectory data;

[0008] Training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model;

[0009] Sending the model parameters of the first trajectory similarity recognition model to a federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device;

[0010] receiving the global model parameters sent by the federated learning server, and updating the model parameters of the first trajectory similarity recognition model according to the global model parameters;

[0011] When it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements, returning to the step of training the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model;

[0012] When it is determined that the updated first trajectory similarity recognition model meets the preset requirement, the updated first trajectory similarity recognition model is determined as the target trajectory similarity recognition model.

[0013] Second method, the present application also provides a navigation path recommendation method, the method comprising:

[0014] Get the starting point and end point of the path to be recommended;

[0015] The starting point and the end point are input into a target trajectory similarity recognition model for identification so as to match a plurality of navigation paths from preset trajectory data, wherein the target trajectory similarity recognition model is trained according to the model training method in the embodiment of the present application.

[0016] In a third aspect, the present application further provides a model training device, which includes an acquisition module, a training module, a sending module, a receiving module and a determination module, wherein:

[0017] The acquisition module is used to acquire the trajectory data of vehicles in the current city, and construct a trajectory sample data set of the current city based on the trajectory data;

[0018] The training module is used to train a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model;

[0019] The sending module is used to send the model parameters of the first trajectory similarity recognition model to the federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device;

[0020] The receiving module is used to receive the global model parameters sent by the federated learning server, and update the model parameters of the first trajectory similarity recognition model according to the global model parameters;

[0021] The determination module is used to return to the step of training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model when it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements;

[0022] The determination module is further configured to determine the updated first trajectory similarity recognition model as the target trajectory similarity recognition model when it is determined that the updated first trajectory similarity recognition model meets a preset requirement.

[0023] In a fourth aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the model training method as described above are implemented, and / or the steps of the navigation path recommendation method as described above are implemented.

[0024] In a fifth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the model training method as described above are implemented, and / or the steps of the navigation path recommendation method as described above are implemented.

[0025] The present application provides a model training method, a navigation path recommendation method, an apparatus, a device and a medium. The present application obtains trajectory data of vehicles in a current city, and constructs a trajectory sample data set of the current city based on the trajectory data; trains a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; sends model parameters of the first trajectory similarity recognition model to a federated learning server, so that the federated learning server determines global model parameters of trajectory similarity recognition models corresponding to all cities according to the model parameters sent by each computer device; receives the global model parameters sent by the federated learning server, and updates the model parameters of the first trajectory similarity recognition model according to the global model parameters; when it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements, returns to execute the step of training the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; when it is determined that the updated first trajectory similarity recognition model meets the preset requirements, determines the updated first trajectory similarity recognition model as the target trajectory similarity recognition model. In this application, the trajectory similarity recognition model is trained based on the trajectory data of the current city, and then the trained model parameters are sent to the federated learning server for sharing, which can effectively protect the privacy of the trajectory data of each city. Then, the corresponding model parameters of each city are weighted by the federated learning server, which can improve the applicability and recognition accuracy of the trajectory similarity recognition model, thereby improving the efficiency and accuracy of trajectory similarity calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 A flowchart of a model training method provided in an embodiment of the present application;

[0028] Figure 2 for Figure 1 A flowchart of the sub-steps of the model training method in ;

[0029] Figure 3 A schematic diagram of a scenario for implementing the model training method provided in this embodiment;

[0030] Figure 4 A flowchart of a navigation path recommendation method provided in an embodiment of the present application;

[0031] Figure 5 A schematic block diagram of a model training device provided in an embodiment of the present application;

[0032] Figure 6 for Figure 5 A schematic block diagram of submodules of a model training device in;

[0033] Figure 7 A schematic block diagram of another navigation route recommendation device provided in an embodiment of the present application;

[0034] Figure 8 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0035] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0037] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0038] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0039] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0040] With the rapid development and widespread popularity of positioning technologies such as smartphones, Global Positioning System (GPS) devices, Internet of Things communications, and WIFI, location-based information services have developed rapidly. As an important part of intelligent transportation, route navigation plays an important role in our daily lives. At present, many excellent navigation software have emerged on the market, such as AutoNavi, Carlead, Baidu Maps, etc. These navigation software can provide people with very detailed navigation information through precise positioning, which greatly facilitates people's travel.

[0041] At present, there are more and more navigation recommendation methods based on path similarity, which are to save a large amount of navigation trajectory data and make navigation recommendations based on the similarity of navigation trajectory data. However, due to differences in geographical environment and urban layout, the trajectory data of different cities are very different when calculating trajectory similarity, which makes it difficult to directly apply the model to calculate trajectory similarity across cities. Secondly, due to data privacy and data security issues, trajectory data across cities often cannot be directly shared, which makes model training difficult.

[0042] To solve the above problems, the present application provides a model training method, a navigation path recommendation method, an apparatus, a device and a medium. The model training method includes obtaining the trajectory data of vehicles in the current city, and constructing a trajectory sample data set of the current city based on the trajectory data; training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; sending the model parameters of the first trajectory similarity recognition model to a federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device; receiving the global model parameters sent by the federated learning server, and updating the model parameters of the first trajectory similarity recognition model according to the global model parameters; when it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements, returning to execute the step of training the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; when it is determined that the updated first trajectory similarity recognition model meets the preset requirements, determining the updated first trajectory similarity recognition model as the target trajectory similarity recognition model.

[0043] Among them, the model training method can be applied to computer devices, which can be electronic devices such as mobile phones, tablet computers, laptops, desktop computers, personal digital assistants and wearable devices.

[0044] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0045] Please refer to Figure 1 , Figure 1 A flowchart of a model training method provided in an embodiment of the present application.

[0046] like Figure 1 As shown, the model training method includes steps S101 to S106.

[0047] Step S101: Acquire trajectory data of vehicles in a current city, and construct a trajectory sample dataset of the current city based on the trajectory data.

[0048] The trajectory data of vehicles in the current city is generally obtained by collecting the Global Positioning System (GPS) information of each vehicle. It should be noted that in order to ensure the privacy of vehicle trajectory data, the trajectory data between cities are generally not shared. For example, the trajectory data of vehicles in City A can only be used for model training in City A, and the trajectory data of vehicles in City B can only be used for model training in City B.

[0049] In some embodiments, the trajectory data of vehicles in the current city are obtained to obtain a large amount of trajectory data, and a trajectory data sample set of the current city is constructed based on the trajectory data. The trajectory sample data set can be accurately constructed based on the trajectory data of vehicles in the current city, and the trajectory similarity recognition model can be effectively trained based on the trajectory sample data set.

[0050] In some embodiments, a sub-trajectory data is selected from the trajectory data, and graph structure data is constructed for the time nodes and path relationships in the sub-trajectory data to obtain a sub-graph structure data; the sub-graph structure data is categorized to obtain the categorized result, and a trajectory sample data is constructed based on the sub-graph structure data and the categorized result; the steps of constructing the trajectory sample data are repeated until all the trajectory data are processed to obtain a trajectory sample data set. By processing the graph structure data for each sub-trajectory data, the trajectory sample data set can be accurately obtained.

[0051] In some embodiments, graph structure data is constructed for time nodes and path relationships in sub-trajectory data to obtain a sub-graph structure data in a manner as follows: the time points in the sub-trajectory data are divided to obtain multiple time nodes, and each time node is used as a node of the graph structure, the mutual relationship between each time node is obtained, and the mutual concern of each time node is used as an edge of the graph structure, and the steps of dividing the time points in the sub-trajectory data to obtain multiple time nodes, and each time node is used as a node of the graph structure, obtaining the mutual relationship between each time node, and using the mutual concern of each time node as an edge of the graph structure are repeatedly performed until all the data of the sub-trajectory data are polled, thereby obtaining the sub-graph structure data of the sub-trajectory data.

[0052] It should be noted that the granularity for dividing the time points in the sub-trajectory data can be set according to the time situation, and the embodiment of the present invention does not make a specific limitation on this. For example, the granularity can be 30 seconds.

[0053] Exemplarily, the time points in the sub-trajectory data are divided to obtain multiple time nodes, and each time node is used as a node of the graph structure, the mutual relationship between each time node is obtained, and the mutual concern of each time node is used as the edge of the graph structure, and the steps of dividing the time points in the sub-trajectory data to obtain multiple time nodes, and using each time node as a node of the graph structure, obtaining the mutual relationship between each time node, and using the mutual concern of each time node as the edge of the graph structure are repeatedly performed until all the data of the sub-trajectory data are polled, and the sub-graph structure data of the sub-trajectory data is obtained as G = (V, E), wherein each node V∈V represents a time node, | V| represents the total number of time nodes, and each edge e ij ∈E represents the relationship between two time nodes, |E| represents the total number of edges, and the features of time nodes and edges represent the relevant temporal and spatial information.

[0054] It should be noted that each time node v of the graph structure data is represented by the feature vector x v ∈R d , where d is the feature dimension, and the edge e between each time node of the graph structure data ij There is a weight a ij , the a ij Represents the strength of the relationship between time node i and time node ,.

[0055] In some embodiments, the subgraph structure data is labeled by category to obtain the labeled category result, and a trajectory sample data is formed according to the subgraph structure data and the labeled category result. The method can be: obtaining the category of the subgraph structure data, and labeling the subgraph structure data according to the category of the subgraph structure data to obtain the labeled category result; combining the subgraph structure data and the labeled category result to obtain a trajectory sample data. Among them, the category of the subgraph structure data can be set according to actual conditions, and this is not specifically limited in the embodiment of the present invention. For example, the category can be the probability of the route.

[0056] Step S102: training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model.

[0057] Among them, the specific type of the preset graph neural network model can be selected according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the preset graph neural network model can be a graph attention network model.

[0058] In some embodiments, Figure 2 As shown, step S102 includes sub-steps S1021 to S1024.

[0059] Sub-step S1021 : acquiring a trajectory sample data from the trajectory sample data set as target trajectory sample data, wherein the target trajectory sample data includes graph structure data and annotated category results.

[0060] A trajectory sample data is randomly obtained from the trajectory sample data set as the target trajectory sample data. By obtaining the target trajectory sample data, the model training can be performed quickly.

[0061] Sub-step S1022: inputting the graph structure data of the target trajectory sample data into a preset graph neural network model for recognition to obtain a predicted category result.

[0062] The graph structure data of the target trajectory sample data is input into the preset graph neural network model for recognition to obtain the predicted category results, which greatly improves the model training efficiency.

[0063] Sub-step S1023: Determine whether the preset graph neural network model converges based on the marked category results and the predicted category results.

[0064] Among them, if the preset graph neural network model converges, it is determined that a stable trajectory similarity recognition model is obtained; if the preset graph neural network model does not converge, it is determined that there is a large error in the recognition of the current graph neural network model.

[0065] In some embodiments, a loss value is determined based on the labeled category results and the predicted category results; if the loss value is less than or equal to a preset loss value, it is determined that the preset graph neural network model has converged; if the loss value is greater than the preset loss value, it is determined that the preset graph neural network model has not converged. Among them, the preset loss value can be set according to actual conditions, and the embodiment of the present invention does not make specific limitations on this. For example, the preset loss value can be set to 0.02. By determining the loss value of the preset graph neural network model, it is possible to accurately know whether the preset graph neural network model has converged.

[0066] In some embodiments, the loss value may be determined based on the labeled category result and the predicted category result by calculating the cosine similarity between the labeled category result and the predicted category result to obtain the cosine similarity value, subtracting the cosine similarity value from the unit 1 to obtain a difference parameter, and determining the difference parameter as the loss value. By calculating the cosine similarity between the labeled category result and the predicted category result, the loss value of the model can be accurately obtained.

[0067] Sub-step S1024: When the preset graph neural network model has not converged, continue to execute the step of obtaining a trajectory sample data from the trajectory sample data set as the target trajectory sample data until the preset graph neural network model converges to obtain a first trajectory similarity recognition model.

[0068] In some embodiments, if the loss value is greater than a preset loss value, it is determined that the preset graph neural network model has not converged, and a trajectory sample data is obtained from the trajectory sample data set as the target trajectory sample data, the target trajectory sample data including graph structure data and labeled category results; the graph structure data of the target trajectory sample data is input into the preset graph neural network model for recognition to obtain a predicted category result; based on the labeled category results and the predicted category results, it is determined whether the preset graph neural network model has converged, until the preset graph neural network model converges to obtain a first trajectory similarity recognition model.

[0069] It should be noted that, by training the trajectory data of vehicles in the current city, the first trajectory similarity recognition model can be accurately obtained, and the model parameters of the first trajectory similarity recognition model are local model parameters.

[0070] Step S103: sending the model parameters of the first trajectory similarity recognition model to a federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device.

[0071] The federated learning server is connected to the computer devices of each city pair in communication, and each computer device corresponds to a trajectory similarity recognition model of a city. Figure 3 As shown, the federated learning server 10 is in communication connection with computer device a11, computer device b12, computer device c13 and computer device d14, wherein computer device a11 represents city a, computer device b12 represents city b, computer device c13 represents city c, and computer device d14 represents city d. The federated learning server 10 determines the global model parameters corresponding to all cities according to the model parameters transmitted by computer device a11, computer device b12, computer device c13 and computer device d14.

[0072] In some embodiments, the hidden state parameters of each node and the neighbor node set of each node in the first trajectory similarity recognition model are obtained; the model parameters of the first trajectory similarity recognition model are determined according to the hidden state parameters of each node and the neighbor node set of each node; and the model parameters of the first trajectory similarity recognition model are sent to the federated learning server. By calculating the hidden state parameters of each node and the neighbor node set of each node in the first trajectory similarity recognition model, the model parameters of the first trajectory similarity recognition model can be accurately obtained.

[0073] In some embodiments, the federated learning server receives the model parameters sent by each computer device, performs weighted operations on each model parameter, and obtains the global model parameters. By performing weighted operations on the model parameters of all cities, the model parameters of all cities can be accurately obtained, and the parameters of each model can be updated while ensuring the privacy of trajectory data.

[0074] In some embodiments, weighted operations are performed on each model parameter to obtain a global model parameter, and a preset parameter calculation formula is obtained. The preset parameter calculation formula is: Among them, θ is the global model parameter, N is the number of model parameters uploaded by the computer device, and θ i is the model parameter transmitted by the i-th computer device, w i is the weight parameter of the ith model parameter, wherein the weight parameter of the model parameter can be set according to the actual situation, and the embodiment of the present invention does not specifically limit this. By calculating each model parameter through the preset parameter calculation formula, the global model parameter can be accurately obtained.

[0075] Step S104: receiving the global model parameters sent by the federated learning server, and updating the model parameters of the first trajectory similarity recognition model according to the global model parameters.

[0076] After the federated learning server calculates the global model parameters, the global model parameters sent by the federated learning server are received, and the model parameters of the first trajectory similarity recognition model are updated according to the global model parameters. By receiving the global model parameters sent by the federated learning server and updating the first trajectory similarity recognition model based on the global model parameters, the accuracy of the first trajectory similarity recognition model of the current city in identifying the similarity of trajectory data of other cities is improved.

[0077] Step S105: when it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements, return to the step of training the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model.

[0078] When it is determined that the updated first trajectory similarity recognition model does not meet the preset requirement, it is determined that the global trajectory similarity recognition model has not converged, and it is necessary to continue training the trajectory similarity recognition model corresponding to each city.

[0079] In some embodiments, if the number of updates is greater than or equal to the preset number of updates, it is determined that the updated first trajectory similarity recognition model meets the preset requirements; the historical global model parameters are obtained, and the historical global model parameters are the global model parameters returned by the federated learning server last time; if the global model parameters are the same as the historical global model parameters, it is determined that the updated first trajectory similarity recognition model meets the preset requirements. Among them, the preset number of updates can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the preset number of updates can be set to 5 times, that is, the federated learning model needs to jointly weight the trajectory similarity recognition models of each city 5 times.

[0080] It should be noted that when the number of updates is greater than or equal to the preset number of updates, the trajectory similarity recognition model of each city is determined to update the global model parameters multiple times, and the trajectory similarity recognition model reaches a relatively stable structure, so that the trajectory similarity calculation is relatively accurate. When the global model parameters are the same as the historical global model parameters, it is determined that the trajectory similarity recognition model has reached the best and does not need to be updated.

[0081] Step S106: when it is determined that the updated first trajectory similarity recognition model meets the preset requirement, the updated first trajectory similarity recognition model is determined as the target trajectory similarity recognition model.

[0082] When it is determined that the updated first trajectory similarity recognition model meets the preset requirements, the updated first trajectory similarity recognition model is determined as the target trajectory similarity recognition model. The target trajectory similarity recognition model can perform similarity calculation on trajectory data of all cities, thereby solving the problem of inaccurate similarity calculation on trajectory data of other cities and greatly improving the efficiency and accuracy of trajectory similarity calculation.

[0083] The model training method provided in the above embodiment obtains the trajectory data of vehicles in the current city, and constructs a trajectory sample data set of the current city based on the trajectory data; trains a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; sends the model parameters of the first trajectory similarity recognition model to a federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition models corresponding to all cities according to the model parameters sent by each computer device; receives the global model parameters sent by the federated learning server, and updates the model parameters of the first trajectory similarity recognition model according to the global model parameters; when it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements, returns to execute the step of training the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; when it is determined that the updated first trajectory similarity recognition model meets the preset requirements, determines the updated first trajectory similarity recognition model as the target trajectory similarity recognition model. In this application, the trajectory similarity recognition model is trained based on the trajectory data of the current city, and then the trained model parameters are sent to the federated learning server for sharing, which can effectively protect the privacy of the trajectory data of each city. Then, the corresponding model parameters of each city are weighted by the federated learning server, which can improve the applicability and recognition accuracy of the trajectory similarity recognition model, thereby improving the efficiency and accuracy of trajectory similarity calculation.

[0084] See also Figure 4 , Figure 4 A flowchart of a navigation path recommendation method provided in an embodiment of the present application.

[0085] like Figure 4 As shown, the navigation path recommendation method includes steps S201 to S202.

[0086] Step S201: Obtain the starting point and the end point of the path to be recommended.

[0087] The starting point and the end point of the route to be recommended are the starting point and the end point of the navigation route. For example, if the route to be navigated is from Shenzhen to Shanghai, the starting point is Shenzhen and the end point is Shanghai.

[0088] Step S202: input the starting point and the end point into a target trajectory similarity recognition model for identification to match multiple navigation paths from preset trajectory data, wherein the target trajectory similarity recognition model is trained by the model training method described in any embodiment of the present application.

[0089] The target trajectory similarity recognition model is obtained by training the model training method described in any embodiment of the present application, and the target trajectory similarity recognition model can match the trajectory data of all cities. The preset trajectory data is the trajectory data of vehicles collected in each city.

[0090] In some embodiments, the starting point and the end point are input into a target trajectory similarity recognition model to match multiple navigation paths from preset trajectory data, wherein each navigation path has a similarity with the path trajectory from the starting point to the end point, and the user can select the optimal navigation path according to the similarity.

[0091] The navigation path recommendation method provided in the above embodiment obtains the starting point and the end point of the path to be recommended; the starting point and the end point are input into the target trajectory similarity recognition model for identification to match multiple navigation paths from the preset trajectory data, wherein the target trajectory similarity recognition model is obtained by training the model training method of any embodiment of the present application. By identifying the starting point and the end point through the target trajectory similarity recognition model, multiple recommended navigation paths can be accurately obtained, which greatly improves the efficiency and accuracy of path navigation.

[0092] See also Figure 5 , Figure 5 A schematic block diagram of a model training device provided in an embodiment of the present application.

[0093] like Figure 5 As shown, the model training device 300 includes an acquisition module 310, a training module 320, a sending module 330, a receiving module 340 and a determination module 350, wherein:

[0094] The acquisition module 310 is used to acquire the trajectory data of the vehicles in the current city, and construct a trajectory sample data set of the current city based on the trajectory data;

[0095] The training module 320 is used to train a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model;

[0096] The sending module 330 is used to send the model parameters of the first trajectory similarity recognition model to the federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device;

[0097] The receiving module 340 is used to receive the global model parameters sent by the federated learning server, and update the model parameters of the first trajectory similarity recognition model according to the global model parameters;

[0098] The determination module 350 is used to return to the step of training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model when it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements;

[0099] The determining module 350 is further configured to determine the updated first trajectory similarity recognition model as the target trajectory similarity recognition model when it is determined that the updated first trajectory similarity recognition model meets a preset requirement.

[0100] In some embodiments, the acquisition module 310 is further used to:

[0101] Selecting a sub-trajectory data from the trajectory data, and constructing graph structure data for the time nodes and path relationships in the sub-trajectory data to obtain a sub-graph structure data;

[0102] Performing category labeling on the subgraph structure data to obtain a labeled category result, and forming a trajectory sample data according to the subgraph structure data and the labeled category result;

[0103] The steps of constructing the trajectory sample data are repeated until all the trajectory data are processed to obtain the trajectory sample data set.

[0104] In some embodiments, Figure 6 As shown, the training module 320 includes a selection module 321, a generation module 322 and a determination module 323, wherein:

[0105] The selection module 321 is used to obtain a track sample data from the track sample data set as the target track sample data, and the target track sample data includes graph structure data and annotated category results;

[0106] The generating module 322 is used to input the graph structure data of the target trajectory sample data into a preset graph neural network model for recognition to obtain a predicted category result;

[0107] The determination module 323 is used to determine whether the preset graph neural network model converges according to the marked category result and the predicted category result;

[0108] The selection module 321 is further configured to continue to execute the step of acquiring a trajectory sample data from the trajectory sample data set as the target trajectory sample data when the preset graph neural network model has not converged;

[0109] The generating module 322 is further configured to obtain a first trajectory similarity recognition model when the preset graph neural network model converges.

[0110] In some embodiments, the determining module 323 is further configured to:

[0111] Determining a loss value according to the labeled category result and the predicted category result;

[0112] If the loss value is less than or equal to the preset loss value, it is determined that the preset graph neural network model has converged;

[0113] If the loss value is greater than the preset loss value, it is determined that the preset graph neural network model has not converged.

[0114] In some embodiments, the sending module 330 is further used to:

[0115] Obtaining the hidden state parameters of each node and the neighbor node set of each node in the first trajectory similarity recognition model;

[0116] Determining model parameters of the first trajectory similarity recognition model according to the hidden state parameters of each node and the neighbor node set of each node;

[0117] The model parameters of the first trajectory similarity recognition model are sent to a federated learning server.

[0118] In some embodiments, the determining module 350 is further configured to:

[0119] Obtaining the number of updates of the first trajectory similarity recognition model according to the global model parameters;

[0120] If the update number is greater than or equal to the preset update number, determining that the updated first trajectory similarity recognition model meets the preset requirements;

[0121] Obtaining historical global model parameters, where the historical global model parameters are global model parameters returned by the federated learning server last time;

[0122] If the global model parameters are the same as the historical global model parameters, it is determined that the updated first trajectory similarity recognition model meets the preset requirements.

[0123] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned model training device can refer to the corresponding process in the aforementioned model training method embodiment, and will not be repeated here.

[0124] See also Figure 7 , Figure 7 A schematic block diagram of a navigation route recommendation device provided in an embodiment of the present application.

[0125] like Figure 7 As shown, the navigation route recommendation device 400 includes an acquisition module 410 and a generation module 420, wherein:

[0126] The acquisition module 410 is used to acquire the starting point and the end point of the path to be recommended;

[0127] The generating module 420 is used to input the starting point and the end point into a target trajectory similarity recognition model to identify and match multiple navigation paths from the preset trajectory data.

[0128] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-mentioned navigation path recommendation device can refer to the corresponding process in the above-mentioned navigation path recommendation method embodiment, and will not be repeated here.

[0129] See also Figure 8 , Figure 8 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0130] like Figure 8 As shown, the computer device 500 includes a processor 502 and a memory 503 connected via a system bus 501 , wherein the memory 503 may include a storage medium and an internal memory.

[0131] The storage medium may store a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor may execute any one of the model training methods and / or navigation path recommendation methods.

[0132] The processor 502 is used to provide computing and control capabilities and support the operation of the entire computer device.

[0133] The internal memory provides an environment for the operation of the computer program in the storage medium. When the computer program is executed by the processor, the processor can execute any model training method and / or navigation path recommendation method.

[0134] Those skilled in the art will understand that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0135] It should be understood that the processor 502 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0136] In one embodiment, the processor 502 is used to run a computer program stored in the memory to implement the following steps:

[0137] Acquire trajectory data of vehicles in a current city, and construct a trajectory sample data set of the current city based on the trajectory data;

[0138] Training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model;

[0139] Sending the model parameters of the first trajectory similarity recognition model to a federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device;

[0140] receiving the global model parameters sent by the federated learning server, and updating the model parameters of the first trajectory similarity recognition model according to the global model parameters;

[0141] When it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements, returning to the step of training the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model;

[0142] When it is determined that the updated first trajectory similarity recognition model meets the preset requirement, the updated first trajectory similarity recognition model is determined as the target trajectory similarity recognition model.

[0143] In one embodiment, when implementing the step of constructing the trajectory sample dataset of the current city based on the trajectory data, the processor 502 is configured to implement:

[0144] Selecting a sub-trajectory data from the trajectory data, and constructing graph structure data for the time nodes and path relationships in the sub-trajectory data to obtain a sub-graph structure data;

[0145] Performing category labeling on the subgraph structure data to obtain a labeled category result, and forming a trajectory sample data according to the subgraph structure data and the labeled category result;

[0146] The steps of constructing the trajectory sample data are repeated until all the trajectory data are processed to obtain the trajectory sample data set.

[0147] In one embodiment, when the processor 502 implements the training of the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model, it is used to implement:

[0148] Acquire a trajectory sample data from the trajectory sample data set as target trajectory sample data, wherein the target trajectory sample data includes graph structure data and annotated category results;

[0149] Inputting the graph structure data of the target trajectory sample data into a preset graph neural network model for recognition to obtain a predicted category result;

[0150] Determining whether the preset graph neural network model converges according to the labeled category results and the predicted category results;

[0151] When the preset graph neural network model has not converged, continue to execute the step of acquiring a trajectory sample data from the trajectory sample data set as the target trajectory sample data until the preset graph neural network model converges to obtain a first trajectory similarity recognition model.

[0152] In one embodiment, when the processor 502 determines whether the preset graph neural network model converges according to the labeled category result and the predicted category result, it is used to implement:

[0153] Determining a loss value according to the labeled category result and the predicted category result;

[0154] If the loss value is less than or equal to the preset loss value, it is determined that the preset graph neural network model has converged;

[0155] If the loss value is greater than the preset loss value, it is determined that the preset graph neural network model has not converged.

[0156] In one embodiment, when implementing the sending of the model parameters of the first trajectory similarity recognition model to the federated learning server, the processor 502 is configured to implement:

[0157] Obtaining the hidden state parameters of each node and the neighbor node set of each node in the first trajectory similarity recognition model;

[0158] Determining model parameters of the first trajectory similarity recognition model according to the hidden state parameters of each node and the neighbor node set of each node;

[0159] The model parameters of the first trajectory similarity recognition model are sent to a federated learning server.

[0160] In one embodiment, the processor 502 is further configured to implement:

[0161] Obtaining the number of updates of the first trajectory similarity recognition model according to the global model parameters;

[0162] If the update number is greater than or equal to the preset update number, determining that the updated first trajectory similarity recognition model meets the preset requirements;

[0163] Obtaining historical global model parameters, where the historical global model parameters are global model parameters returned by the federated learning server last time;

[0164] If the global model parameters are the same as the historical global model parameters, it is determined that the updated first trajectory similarity recognition model meets the preset requirements.

[0165] In one embodiment, the processor 502 is further configured to implement:

[0166] Get the starting point and end point of the path to be recommended;

[0167] The starting point and the end point are input into a target trajectory similarity recognition model for recognition so as to match a plurality of navigation paths from preset trajectory data.

[0168] It should be noted that technical personnel in the relevant field can clearly understand that, for the convenience and conciseness of description, the specific working process of the computer device described above can refer to the corresponding process in the aforementioned model training method / or navigation path recommendation method embodiment, and will not be repeated here.

[0169] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the model training method / or navigation path recommendation method of the present application.

[0170] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0171] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0172] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0173] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0174] It should also be understood that the term "and / or" used in the present specification refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0175] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application.

Claims

1. A model training method based on federated learning, characterized in that: Applied to a computer device, the method comprises: Acquire trajectory data of vehicles in a current city, and construct a trajectory sample data set of the current city based on the trajectory data; Training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; Sending the model parameters of the first trajectory similarity recognition model to a federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device; receiving the global model parameters sent by the federated learning server, and updating the model parameters of the first trajectory similarity recognition model according to the global model parameters; When it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements, returning to the step of training the preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; When it is determined that the updated first trajectory similarity recognition model meets the preset requirement, the updated first trajectory similarity recognition model is determined as the target trajectory similarity recognition model.

2. The model training method according to claim 1, characterized in that: The constructing the trajectory sample dataset of the current city based on the trajectory data includes: Selecting a sub-trajectory data from the trajectory data, and constructing graph structure data for the time nodes and path relationships in the sub-trajectory data to obtain a sub-graph structure data; Performing category labeling on the subgraph structure data to obtain a labeled category result, and forming a trajectory sample data according to the subgraph structure data and the labeled category result; The steps of constructing the trajectory sample data are repeated until all the trajectory data are processed to obtain the trajectory sample data set.

3. The model training method according to claim 1, characterized in that: The step of training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model includes: Acquire a trajectory sample data from the trajectory sample data set as target trajectory sample data, wherein the target trajectory sample data includes graph structure data and annotated category results; Inputting the graph structure data of the target trajectory sample data into a preset graph neural network model for recognition to obtain a predicted category result; Determining whether the preset graph neural network model converges according to the labeled category results and the predicted category results; When the preset graph neural network model has not converged, continue to execute the step of acquiring a trajectory sample data from the trajectory sample data set as the target trajectory sample data until the preset graph neural network model converges to obtain a first trajectory similarity recognition model.

4. The model training method according to claim 3, characterized in that: The determining whether the preset graph neural network model converges according to the labeled category result and the predicted category result includes: Determining a loss value according to the labeled category result and the predicted category result; If the loss value is less than or equal to the preset loss value, it is determined that the preset graph neural network model has converged; If the loss value is greater than the preset loss value, it is determined that the preset graph neural network model has not converged.

5. The model training method according to claim 1, characterized in that: The sending the model parameters of the first trajectory similarity recognition model to the federated learning server includes: Obtaining the hidden state parameters of each node and the neighbor node set of each node in the first trajectory similarity recognition model; Determining model parameters of the first trajectory similarity recognition model according to the hidden state parameters of each node and the neighbor node set of each node; The model parameters of the first trajectory similarity recognition model are sent to a federated learning server.

6. The model training method according to claim 1, characterized in that: The method further comprises: Obtaining the number of updates of the first trajectory similarity recognition model according to the global model parameters; If the update number is greater than or equal to the preset update number, determining that the updated first trajectory similarity recognition model meets the preset requirements; Obtaining historical global model parameters, where the historical global model parameters are global model parameters returned by the federated learning server last time; If the global model parameters are the same as the historical global model parameters, it is determined that the updated first trajectory similarity recognition model meets the preset requirements.

7. A navigation path recommendation method, characterized in that: include: Get the starting point and end point of the path to be recommended; The starting point and the end point are input into a target trajectory similarity recognition model for identification so as to match a plurality of navigation paths from preset trajectory data, wherein the target trajectory similarity recognition model is trained by the model training method according to any one of claims 1-6.

8. A model training device, characterized in that: The model training device includes an acquisition module, a training module, a sending module, a receiving module and a determination module, wherein: The acquisition module is used to acquire the trajectory data of vehicles in the current city, and construct a trajectory sample data set of the current city based on the trajectory data; The training module is used to train a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model; The sending module is used to send the model parameters of the first trajectory similarity recognition model to the federated learning server, so that the federated learning server determines the global model parameters of the trajectory similarity recognition model corresponding to all cities according to the model parameters sent by each computer device; The receiving module is used to receive the global model parameters sent by the federated learning server, and update the model parameters of the first trajectory similarity recognition model according to the global model parameters; The determination module is used to return to the step of training a preset graph neural network model based on the trajectory sample data set to obtain a converged first trajectory similarity recognition model when it is determined that the updated first trajectory similarity recognition model does not meet the preset requirements; The determination module is further configured to determine the updated first trajectory similarity recognition model as the target trajectory similarity recognition model when it is determined that the updated first trajectory similarity recognition model meets a preset requirement.

9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the model training method as described in any one of claims 1 to 6 are implemented, and / or the steps of the model training method as described in claim 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the model training method as described in any one of claims 1 to 6 are implemented, and / or the steps of the model training method as described in claim 7 are implemented.