Road network matching method and system and storage medium
By building and fine-tuning the trajectory encoder, decoder and discriminator models, and using mixed GPS and road network trajectory data for pre-training, we solve the problem of low road network matching accuracy caused by massive unlabeled and sparse GPS trajectories, and achieve high accuracy. Degree of road network matching results.
Patent Information
- Application Number
- CN202410960832.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, massive unlabeled and sparse GPS trajectories lead to low accuracy of road network matching results, and the method of training deep learning models relying on rich GPS and road network trajectory annotation data is not ideal.
Construct a trajectory encoder model, a trajectory decoder model and a trajectory discriminator model, fine-tune through real GPS trajectories and road network trajectory data, generate road network matching results, and use mixed GPS and road network trajectory data for pre-training to improve the model's performance Output accuracy.
It can improve the accuracy of road network matching results without requiring massive annotation data, enhance the model's high-level semantic learning capabilities for road networks and GPS location IDs, and improve the accuracy of matching results.
Smart Images

Figure CN118760907A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data mining technology, and in particular to a road network matching method, system and storage medium. Background Art
[0002] Trajectory data is data with dual attributes of time and space generated by relevant sensor devices (such as mobile phones) during the movement of people, vehicles and objects in the city. Trajectory data can reveal the movement patterns of people, vehicles and objects, and has been widely used in various fields of smart cities such as smart transportation, smart population, and social security in recent years. However, due to sensor acquisition errors and other reasons, the collected trajectory data usually has problems such as GPS noise and uneven sampling, which makes the trajectory data unable to accurately describe the movement of people, vehicles and objects. Therefore, researchers have proposed a road network matching technology to convert the original GPS trajectory into a road network trajectory to solve the problem of trajectory data in applications such as smart transportation; for example, Newson et al. proposed a road network matching method based on Hidden Markov Model (HMM), which can achieve 99% road network matching accuracy when the sampling interval of the original GPS trajectory is about 10 seconds; however, the trajectory collected by mobile phone positioning and other methods usually has a large sparsity, which leads to a significant decrease in the accuracy of the matching results obtained by the road network matching method based on HMM.
[0003] With the rise of deep learning technology, researchers have begun to study data-driven road network matching methods; for example, Ren et al. proposed an end-to-end road network matching method based on deep learning; however, existing data-driven road network matching methods all rely on abundant GPS trajectory and road network trajectory annotation data to train deep learning models; in practical applications, massive GPS and road network trajectory annotation data are usually difficult to obtain, resulting in the road network matching results based on pre-trained deep learning models being less than ideal in accuracy. Therefore, how to improve the accuracy of road network matching results is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, embodiments of the present invention provide a road network matching method, system and storage medium to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of the present invention provides a road network matching method, the method comprising the following steps: Construct trajectory encoder model, trajectory decoder model and trajectory discriminator model; Acquire real GPS trajectory data and real road network trajectory data corresponding to the real GPS trajectory data, input the real GPS trajectory data into a trajectory encoder model to obtain a first trajectory representation vector, and input the first trajectory representation vector into a trajectory decoder model to obtain generated road network trajectory data corresponding to the real GPS trajectory data; Inputting the generated road network trajectory data and the real road network trajectory data into the trajectory discriminator model to obtain a trajectory discrimination loss; Fine-tuning the model parameters of the trajectory encoder model and the model parameters of the trajectory decoder model based on the trajectory discrimination loss to obtain a trajectory encoder model after parameter fine-tuning and a trajectory decoder model after parameter fine-tuning; Acquire GPS trajectory data to be matched, and input the GPS trajectory data to be matched into a trajectory encoder model after parameter fine-tuning to obtain a second trajectory representation vector; The second trajectory representation vector is input into the trajectory decoder model after parameter fine-tuning to obtain the road network trajectory data corresponding to the GPS trajectory data to be matched.
[0006] In some embodiments of the present invention, constructing a trajectory encoder model, a trajectory decoder model, and a trajectory discriminator model includes: Build the initial encoder model; Determine the sample data set; Pre-training the initial encoder model based on the sample data set to obtain a trained initial encoder model; The model parameters of the trajectory encoder model, the trajectory decoder model and the trajectory discriminator model are initialized based on the model parameters of the trained initial encoder model.
[0007] In some embodiments of the present invention, the sample data in the sample data set includes original GPS trajectory data, original road network trajectory data, hybrid GPS trajectory data and hybrid road network trajectory data.
[0008] In some embodiments of the present invention, the hybrid GPS trajectory data is composed of some GPS trajectory points in the original GPS trajectory data and some road network trajectory points in the original road network trajectory data corresponding to the original GPS trajectory data, and the hybrid road network trajectory data is composed of some road network trajectory points in the original road network trajectory data and some GPS trajectory points in the original GPS trajectory data corresponding to the original road network trajectory data.
[0009] In some embodiments of the present invention, the ratio of the number of partial road network trajectory points in the hybrid GPS trajectory data to the total number of trajectory points in the hybrid GPS trajectory data is less than 0.4, and the ratio of the number of partial GPS trajectory points in the hybrid road network trajectory data to the total number of trajectory points in the hybrid road network trajectory data is less than 0.4.
[0010] In some embodiments of the present invention, determining a sample data set includes: Get the geographic area used to generate sample data; Determining road network data corresponding to the geographical area; Determine a plurality of original road network trajectory data based on the road network data, and determine a plurality of original GPS trajectory data corresponding thereto based on the plurality of original road network trajectory data; Replacing part of the track points in each piece of the original GPS track data with part of the track points of the original road network track data corresponding thereto, so as to obtain each piece of mixed GPS track data; Part of the track points in each of the original road network track data are replaced with part of the track points of the corresponding original GPS track data to obtain each hybrid road network track data.
[0011] In some embodiments of the present invention, the ratio of the original GPS trajectory data, the original road network trajectory data, the hybrid GPS trajectory data and the hybrid road network trajectory data is 1:1:4:4; and / or, Determining a plurality of original road network trajectory data based on the road network data, and determining a plurality of original GPS trajectory data corresponding to the plurality of original road network trajectory data based on the plurality of original road network trajectory data, including: Based on the road network data, multiple original road network trajectory data are determined through a path planning algorithm, each original road network trajectory data is converted into sequence data represented by longitude and latitude, the first part of the longitude and latitude points in the sequence data is discarded, and Gaussian noise is added to the second part of the longitude and latitude points in the sequence data to obtain the original GPS trajectory data corresponding to the original road network trajectory data.
[0012] In some embodiments of the present invention, the method further comprises: Calculating a road network trajectory reconstruction loss based on the generated road network trajectory data and the real road network trajectory data; Based on the road network trajectory reconstruction loss and the trajectory discrimination loss, model parameters of the trajectory encoder model and model parameters of the trajectory decoder model are fine-tuned to obtain a trajectory encoder model after parameter fine-tuning and a trajectory decoder model after parameter fine-tuning.
[0013] According to another aspect of the present invention, a road network matching system is also disclosed, including a processor, a memory and a computer program stored in the memory, wherein the processor is used to execute the computer program, and when the computer program is executed, the system implements the steps of the method described in any of the above embodiments.
[0014] According to another aspect of the present invention, a computer-readable storage medium is disclosed, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0015] The road network matching method and device of the present invention obtain the trajectory discrimination loss between the generated road network trajectory data and the real road network trajectory data based on the trajectory discriminator model, and then fine-tune the model parameters of the trajectory encoder model and the trajectory decoder model based on the trajectory discrimination loss, so that the road network matching result obtained based on the trajectory encoder model and the trajectory decoder model after parameter fine-tuning has higher accuracy.
[0016] In addition, the sample data set used in the present application for pre-training the initial encoder model includes original GPS trajectory data, original road network trajectory data, hybrid GPS trajectory data and hybrid road network trajectory data, and the hybrid GPS trajectory data and the hybrid road network trajectory data are both obtained from the original GPS trajectory data and the original road network trajectory data. This method solves the problem of road network matching of massive unlabeled and sparse GPS trajectories in the prior art, thereby further improving the accuracy of the road network matching results.
[0017] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0018] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention. The components in the drawings are not drawn to scale, but are only for illustrating the principles of the present invention. In order to facilitate the illustration and description of some parts of the present invention, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present invention. In the drawings: Figure 1The figure is a flowchart of a road network matching method in one embodiment of the present invention.
[0020] Figure 2 It is a flowchart of a road network matching method in another embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0022] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0023] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0024] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0025] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0026] Figure 1 FIG. 1 is a flow chart of a road network matching method according to an embodiment of the present invention. Figure 1 As shown, the road network matching method at least includes steps S10 to S50.
[0027] Step S10: construct a trajectory encoder model, a trajectory decoder model and a trajectory discriminator model.
[0028] In this step, the trajectory encoder model is used to obtain the trajectory representation vector of the GPS trajectory data, and the trajectory decoder model is used to obtain the road network trajectory data based on the trajectory representation vector. The trajectory discriminator model is used to obtain the trajectory discrimination loss of the generated road network trajectory data and the real road network trajectory data, that is, the generated road network trajectory data and the real road network trajectory data are input into the trajectory discriminator model, the authenticity of the trajectory is judged, the trajectory discrimination loss is calculated, and the model parameters of the trajectory encoder model, the trajectory decoder model and the trajectory discriminator model are optimized by back propagation.
[0029] Furthermore, in order to obtain the trajectory encoder model, the trajectory decoder model and the trajectory discriminator model, an initial encoder model is first constructed; then a sample data set is determined; and the initial encoder model is pre-trained based on the sample data set to obtain a trained initial encoder model; and then the model parameters of the trajectory encoder model, the trajectory decoder model and the trajectory discriminator model are initialized based on the model parameters of the trained initial encoder model. In this embodiment, the model parameters of the trajectory encoder model, the trajectory decoder model and the trajectory discriminator model are initialized based on the model parameters of the pre-trained initial encoder model, so that the constructed trajectory encoder model, trajectory decoder model and trajectory discriminator model are pre-trained models.
[0030] Exemplarily, the sample data in the sample data set includes original GPS trajectory data, original road network trajectory data, mixed GPS trajectory data and mixed road network trajectory data; wherein the mixed GPS trajectory data is composed of some GPS trajectory points in the original GPS trajectory data and some road network trajectory points in the original road network trajectory data corresponding to the original GPS trajectory data, and the mixed road network trajectory data is composed of some road network trajectory points in the original road network trajectory data and some GPS trajectory points in the original GPS trajectory data corresponding to the original road network trajectory data. In this embodiment, the mixed GPS trajectory data and the mixed road network trajectory data can be obtained based on the original road network trajectory data and the original GPS trajectory data, thereby enriching the sample data set, thereby improving the training effect of the initial encoder model, and further improving the accuracy of the output results of the trajectory encoder model, trajectory decoder model and trajectory discriminator model constructed based on the initial encoder model. Therefore, the problem of low accuracy of road network matching results caused by massive unlabeled and sparse GPS trajectories in the prior art is solved.
[0031] It can be understood that the number of GPS track points and the number of road network track points in each hybrid GPS track or each hybrid road network track in the above embodiments are not specifically limited and can be set according to actual needs. For example, the ratio of the number of partial road network track points in the hybrid GPS track data to the total number of track points in the hybrid GPS track data can be set to less than 0.4, and the ratio of the number of partial GPS track points in the hybrid road network track data to the total number of track points in the hybrid road network track data can be set to less than 0.4; in the hybrid GPS track data in this embodiment, the total number of partial road network track points accounts for 0 to 40% of the total number of track points, and in the hybrid road network track data, the total number of partial GPS track points accounts for 0 to 40% of the total number of track points. It should be noted that the proportion interval (0, 0.4) of partial road network track points or partial GPS track points listed in this embodiment is only a preferred embodiment. In other embodiments, the proportion interval can also be set to (0, 0.5), (0, 0.3), etc.
[0032] For example, in order to obtain hybrid GPS trajectory data and hybrid road network data, some of the trajectory points in each of the original GPS trajectory data may be replaced with some of the trajectory points in the original road network trajectory data corresponding thereto, so as to obtain each of the hybrid GPS trajectory data; and some of the trajectory points in each of the original road network trajectory data may be replaced with some of the trajectory points in the original GPS trajectory data corresponding thereto, so as to obtain each of the hybrid road network trajectory data. Randomly select some track points and replace their location IDs with the corresponding road network IDs, which is called hybrid GPS track data; based on the original road network track data, a certain proportion of Randomly select some trajectory points and replace their road network IDs with the corresponding GPS location IDs, which is called hybrid road network trajectory data. The value range is (0, 0.4).
[0033] In some embodiments, the ratio of the number of original GPS trajectory data, original road network trajectory data, hybrid GPS trajectory data, and hybrid road network trajectory data can be 1:1:4:4, that is, the sample data set used to pre-train the initial encoder model contains 10% of the original GPS trajectory data, 10% of the original road network trajectory data, 40% of the hybrid GPS trajectory data, and 40% of the hybrid road network trajectory data. It can be understood that the ratio of the number of original GPS trajectory data, original road network trajectory data, hybrid GPS trajectory data, and hybrid road network trajectory data defined in this embodiment is only a preferred example. In other embodiments, the number of each trajectory data can also be set according to actual needs.
[0034] Step S20: Acquire real GPS trajectory data and real road network trajectory data corresponding to the real GPS trajectory data, input the real GPS trajectory data into a trajectory encoder model to obtain a first trajectory representation vector, input the first trajectory representation vector into a trajectory decoder model to obtain generated road network trajectory data corresponding to the real GPS trajectory data, input the generated road network trajectory data and the real road network trajectory data into the trajectory discriminator model to obtain trajectory discrimination loss.
[0035] In this step, a data set formed by real GPS trajectory data and real road network trajectory data is constructed to optimize the trajectory encoder model and trajectory decoder model based on the data set. The input of the trajectory discriminator model is the generated road network trajectory data and the real road network trajectory data, and the output is the trajectory discrimination loss between the generated road network trajectory data and the real road network trajectory data.
[0036] For example, in order to obtain a trajectory discriminant model, we first build a trajectory discriminator based on the Transformer encoder architecture. , and the trajectory discriminator is trained by the model parameters of the above-mentioned trained initial encoder model The parameters of the trajectory discrimination model are initialized. The trajectory discrimination model has a fully connected layer and a softmax activation function layer, and outputs a binary label of whether the trajectory is a real trajectory. In the specific fine-tuning process, the real road network trajectory is Generate road network trajectory data generated by the trajectory decoder model Input to the trajectory discrimination model and calculate the trajectory discrimination loss based on cross entropy .
[0037] Step S30: fine-tuning the model parameters of the trajectory encoder model and the model parameters of the trajectory decoder model based on the trajectory discrimination loss to obtain a trajectory encoder model after parameter fine-tuning and a trajectory decoder model after parameter fine-tuning.
[0038] This step is based on the trajectory discrimination loss obtained in the above step The trajectory encoder model and trajectory decoder model are fine-tuned to obtain a trajectory encoder model with fine-tuned parameters and a trajectory decoder model with fine-tuned parameters. The trajectory discrimination model may also be fine-tuned and trained simultaneously to update the model parameters of the trajectory discrimination model.
[0039] In some other embodiments, the road network matching method can also calculate the road network trajectory reconstruction loss based on the generated road network trajectory data and the real road network trajectory data. , this step is based on the road network trajectory reconstruction loss and the trajectory discrimination loss The model parameters of the trajectory encoder model and the model parameters of the trajectory decoder model are fine-tuned to obtain a trajectory encoder model after parameter fine-tuning and a trajectory decoder model after parameter fine-tuning. In order to further improve the accuracy of the recognition result of the trajectory discrimination model, based on the trajectory reconstruction loss and the trajectory discrimination loss While fine-tuning the trajectory encoder model and trajectory decoder model, we also use the trajectory reconstruction loss and the trajectory discrimination loss Fine-tune the trajectory discrimination model. That is, in this embodiment, based on the trajectory reconstruction loss and trajectory discrimination loss Track encoder model , trajectory decoder model and trajectory discriminator model Perform fine-tuning training.
[0040] Step S40: obtaining GPS trajectory data to be matched, and inputting the GPS trajectory data to be matched into the trajectory encoder model after parameter fine-tuning to obtain a second trajectory representation vector.
[0041] In this step, based on the trajectory encoder model fine-tuned in step S30 above, the model parameters are fixed, and the GPS trajectory data to be matched is input into the trajectory encoder model after parameter fine-tuning to obtain a trajectory representation vector. The input of the trajectory encoder model in this step is the GPS trajectory data to be matched, and the output is the second trajectory representation vector. It can be understood that in this step, the trajectory representation vector of the GPS trajectory data to be matched is limited to the second trajectory representation vector in order to distinguish it from the trajectory representation vector corresponding to the real GPS trajectory data used to update the parameters of the trajectory encoder model in step S20 above.
[0042] Step S50: inputting the second trajectory representation vector into the trajectory decoder model after parameter fine-tuning to obtain the road network trajectory data corresponding to the GPS trajectory data to be matched.
[0043] Similarly, in this step, based on the trajectory decoder model fine-tuned in the above step S30, the model parameters are fixed, and the second trajectory representation vector output by the trajectory encoder model is input into the trajectory decoder model after parameter fine-tuning to infer the road network trajectory data corresponding to the GPS trajectory data to be matched, thereby completing the road network matching.
[0044] In some embodiments of the present invention, in order to determine a sample data set for pre-training an initial encoder model, first obtain a geographical area for generating sample data; determine the road network data corresponding to the geographical area; determine a plurality of original road network trajectory data based on the road network data, and determine a plurality of original GPS trajectory data corresponding to the plurality of original road network trajectory data based on the plurality of original road network trajectory data; replace part of the trajectory points in each of the original GPS trajectory data with part of the trajectory points of the original road network trajectory data corresponding to it, so as to obtain each hybrid GPS trajectory data; replace part of the trajectory points in each of the original road network trajectory data with part of the trajectory points of the original GPS trajectory data corresponding to it, so as to obtain each hybrid road network trajectory data. Among them, determining multiple original road network trajectory data based on the road network data, and determining multiple original GPS trajectory data corresponding to the multiple original road network trajectory data based on the multiple original road network trajectory data can specifically include: determining multiple original road network trajectory data through a path planning algorithm based on the road network data, converting each original road network trajectory data into sequence data represented by longitude and latitude, discarding the first part of the longitude and latitude points in the sequence data, and adding Gaussian noise to the second part of the longitude and latitude points in the sequence data to obtain the original GPS trajectory data corresponding to the original road network trajectory data.
[0045] For example, after a geographic area is selected, the selected area can obtain road network data based on a map service such as OpenStreetMap. The road network data can generally be expressed as ,in, represents the set of road intersections, and E represents the set of road segments. Further, given any starting point and end point , which can be obtained with the help of path planning algorithms (such as Dijkstra's shortest path algorithm) arrive The path of a road network trajectory data is obtained. , the road network trajectory data It is defined as the original road network trajectory data. In addition, the longitude and latitude sequence data corresponding to the road section can be obtained in the map, so the road network trajectory data can be Further converted into sequence data represented by longitude and latitude, based on this sequence, with a certain mixing ratio Some longitude and latitude points are discarded at a certain ratio Add Gaussian noise to some longitude and latitude points to obtain a longitude and latitude sequence that is more consistent with the real GPS trajectory as the road network trajectory data Corresponding GPS track data , the GPS track data Defined as original GPS trajectory data. According to the above method, a large amount of original road network trajectory data and original GPS trajectory data comparison data set can be obtained by selecting the road network data in the area.
[0046] Furthermore, the original road network trajectory data and the original GPS trajectory data are transformed to obtain the hybrid road network trajectory data and the hybrid GPS trajectory data. Randomly select some trajectory points, replace their location IDs with the corresponding road network IDs, and obtain hybrid GPS trajectory data; similarly, based on the original road network trajectory data, a certain proportion of Randomly select some trajectory points, replace their road network IDs with the corresponding GPS location IDs, and obtain hybrid road network trajectory data; The value range is (0, 0.4).
[0047] Through the above embodiments, it can be found that the road network matching method disclosed in the present invention does not need to rely on massively labeled GPS and road network trajectory data for model training; in addition, based on the pre-trained and fine-tuned trajectory encoder model and trajectory decoder model, the accuracy of road network matching can be effectively improved. In addition to the above, the road network matching method of the above embodiment enhances the model's high-level semantic learning ability of the road network and GPS location ID through the cross data transformation method of the road network ID and the GPS location ID during the pre-training stage, thereby further improving the accuracy of road network matching.
[0048] Correspondingly, the present invention also provides a road network matching system, including a processor, a memory and a computer program stored in the memory, wherein the processor is used to execute the computer program, and when the computer program is executed, the system implements the steps of the method described in any of the above embodiments.
[0049] from Figure 2 It can be seen that the road network matching system specifically includes a trajectory data generation module, a trajectory pre-training module, a trajectory encoder module, a trajectory decoder module and a trajectory discriminator module. The trajectory data generation module is used to generate road network trajectories based on road network data and routing algorithms, and then convert them into GPS trajectories, and fit the real GPS trajectories by adding noise, sparsification, etc., so as to obtain the corresponding data sets of the road network and GPS trajectories. The trajectory pre-training module is based on the road network and GPS trajectory datasets obtained by the trajectory data generation module. First, the data is transformed, and the road network ID is used to replace part of the location ID in the GPS trajectory, and the GPS location ID is used to replace part of the road network ID in the road network trajectory; then, the Masked Language Model (MLM) is used to train the Transformer encoder. The trajectory encoder module is based on the pre-trained Transformer encoder Initialize the Transformer encoder , and Has the same network architecture; Transformer encoder After parameter initialization, the real GPS trajectory data is input to the Transformer encoder , get the trajectory representation vector ; Among them, in order to obtain the trajectory embedding code of the trajectory data, the trajectory encoder module can use the full amount of GPS location ID and road network ID as the vocabulary, and use the PyTorch embedding coding layer to obtain the embedding coding vector of each ID. The trajectory decoder module is based on the pre-trained Transformer encoder Initialize Transformer decoder The embedding encoding of the same layer weight parameters; and the trajectory is represented as a vector Input Transformer decoder , obtain the generated road network trajectory; calculate the cross loss entropy based on the generated road network trajectory and the real road network trajectory, obtain the road network matching loss, and back propagate to fine-tune and optimize the model parameters of the trajectory encoder and trajectory decoder; the road network matching loss can also be called the road network trajectory reconstruction loss. The trajectory discriminator module is based on the pre-trained Transformer encoder Initialize the Transformer encoder , as the trajectory discriminator; and the generated road network trajectory and the real road network trajectory are input into the Transformer encoder respectively , judge the authenticity of the trajectory and calculate the discriminator loss; backpropagation optimizes the trajectory discriminator parameters.
[0050] Corresponding to the road network matching method of the present invention, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0051] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0052] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0053] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A road network matching method, It is characterized in that The method comprises the following steps: Construct trajectory encoder model, trajectory decoder model and trajectory discriminator model; Acquire real GPS trajectory data and real road network trajectory data corresponding to the real GPS trajectory data, input the real GPS trajectory data into a trajectory encoder model to obtain a first trajectory representation vector, input the first trajectory representation vector into a trajectory decoder model to obtain generated road network trajectory data corresponding to the real GPS trajectory data, input the generated road network trajectory data and the real road network trajectory data into the trajectory discriminator model to obtain a trajectory discrimination loss; Fine-tuning the model parameters of the trajectory encoder model and the model parameters of the trajectory decoder model based on the trajectory discrimination loss to obtain a trajectory encoder model after parameter fine-tuning and a trajectory decoder model after parameter fine-tuning; Acquire GPS trajectory data to be matched, and input the GPS trajectory data to be matched into a trajectory encoder model after parameter fine-tuning to obtain a second trajectory representation vector; The second trajectory representation vector is input into the trajectory decoder model after parameter fine-tuning to obtain the road network trajectory data corresponding to the GPS trajectory data to be matched.
2. The road network matching method according to claim 1, It is characterized in that Construct trajectory encoder model, trajectory decoder model and trajectory discriminator model, including: Build the initial encoder model; Determine the sample data set; Pre-training the initial encoder model based on the sample data set to obtain a trained initial encoder model; The model parameters of the trajectory encoder model, the trajectory decoder model and the trajectory discriminator model are initialized based on the model parameters of the trained initial encoder model.
3. The road network matching method according to claim 2, It is characterized in that The sample data in the sample data set includes original GPS trajectory data, original road network trajectory data, mixed GPS trajectory data and mixed road network trajectory data.
4. The road network matching method according to claim 3, It is characterized in that The hybrid GPS trajectory data is composed of some GPS trajectory points in the original GPS trajectory data and some road network trajectory points in the original road network trajectory data corresponding to the original GPS trajectory data. The hybrid road network trajectory data is composed of some road network trajectory points in the original road network trajectory data and some GPS trajectory points in the original GPS trajectory data corresponding to the original road network trajectory data.
5. The road network matching method according to claim 4, It is characterized in that The ratio of the number of partial road network trajectory points in the hybrid GPS trajectory data to the total number of trajectory points in the hybrid GPS trajectory data is less than 0.4, and the ratio of the number of partial GPS trajectory points in the hybrid road network trajectory data to the total number of trajectory points in the hybrid road network trajectory data is less than 0.
4.
6. The road network matching method according to claim 3, It is characterized in that Identify the sample data set, including: Get the geographic area used to generate sample data; Determining road network data corresponding to the geographical area; Determine a plurality of original road network trajectory data based on the road network data, and determine a plurality of original GPS trajectory data corresponding thereto based on the plurality of original road network trajectory data; Replacing part of the track points in each piece of the original GPS track data with part of the track points of the original road network track data corresponding thereto, so as to obtain each piece of mixed GPS track data; Part of the track points in each of the original road network track data are replaced with part of the track points of the corresponding original GPS track data to obtain each hybrid road network track data.
7. The road network matching method according to claim 6, It is characterized in that The ratio of the original GPS trajectory data, the original road network trajectory data, the hybrid GPS trajectory data and the hybrid road network trajectory data is 1:1:4:4; and / or, Determining a plurality of original road network trajectory data based on the road network data, and determining a plurality of original GPS trajectory data corresponding to the plurality of original road network trajectory data based on the plurality of original road network trajectory data, including: Based on the road network data, multiple original road network trajectory data are determined through a path planning algorithm, each original road network trajectory data is converted into sequence data represented by longitude and latitude, the first part of the longitude and latitude points in the sequence data is discarded, and Gaussian noise is added to the second part of the longitude and latitude points in the sequence data to obtain the original GPS trajectory data corresponding to the original road network trajectory data.
8. The road network matching method according to claim 1, It is characterized in that The method further comprises: Calculating a road network trajectory reconstruction loss based on the generated road network trajectory data and the real road network trajectory data; Based on the road network trajectory reconstruction loss and the trajectory discrimination loss, model parameters of the trajectory encoder model and model parameters of the trajectory decoder model are fine-tuned to obtain a trajectory encoder model after parameter fine-tuning and a trajectory decoder model after parameter fine-tuning.
9. A road network matching system, comprising a processor, a memory and a computer program stored in the memory, It is characterized in that The processor is used to execute the computer program. When the computer program is executed, the system implements the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
GPS trajectory data matching and complementing method
CN111862659A
Vehicle trajectory data generation system based on depth generation model
CN112465056A
Indoor navigation road network extraction method based on crowdsourcing data of mobile terminal
CN113686339A
Road network constraint trajectory generation method and system based on diffusion model
CN118070673A
