A method, device, computer device and storage medium for trajectory map matching
By calculating the distance between the positioning point and the endpoint of the road segment, generating a set of matching endpoints and judging continuous road segments, the error problem in trajectory data matching is solved, and matching accuracy and continuity are improved.
Patent Information
- Application Number
- CN202410158547.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2044-02-04
AI Technical Summary
In the prior art, due to the presence of noise during trajectory data matching, the trajectory points may be mismatched to irrelevant road sections, causing large errors and reducing matching accuracy.
By calculating the first distance between the positioning points and each endpoint on each section, the matching values are determined to be made, a set of matching endpoints for each positioning point is generated, and whether these endpoints constitute a continuous section is determined, thereby generating a matching track.
The possibility of trajectory mismatch to irrelevant road segments is reduced, the accuracy of trajectory matching is improved, and the continuity and accuracy of matching trajectories are ensured by taking into account the degree of matching trajectory and the road network globally.
Smart Images

Figure CN118129770B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a trajectory map matching method, apparatus, computer device, and storage medium. Background Art
[0002] With the continuous development of Internet technology, more and more people begin to use a large number of location-based applications and services, resulting in a large amount of trajectory data emerging worldwide. For some institutions, the collection and storage of trajectory data is part of their daily work. For example, in the transportation field, urban bus enterprises and transportation departments need to track and manage the driving trajectories of public transportation vehicles to provide more accurate data for urban transportation and planning; the railway system needs to collect the location data of high-speed trains and trains to better arrange train operation plans.
[0003] Since the collected trajectory data has high data complexity (such as noise, missing, etc.), it is necessary to preprocess the trajectory data to actually generate the road network location of the trajectory, so as to facilitate subsequent processing and optimization by the geographic information system and data science teams. Existing solutions generally directly map each data point of the trajectory to the nearest road network. Due to the existence of noise, trajectory points may be mis-matched to irrelevant road segments, resulting in large errors and reducing the matching accuracy. Summary of the Invention
[0004] This application provides a trajectory map matching method, apparatus, computer device, and storage medium, which can reduce the possibility of mis-matching the trajectory to irrelevant road segments and improve the accuracy of trajectory matching.
[0005] In a first aspect, an embodiment of this application provides a trajectory map matching method, including:
[0006] Obtain a plurality of road segments and a target trajectory including a plurality of positioning points;
[0007] Segmentation step: Segment each road segment based on the shortest distance from each positioning point to each road segment;
[0008] Calculate the first distance from each positioning point to each endpoint of the segmented road segments;
[0009] Determine the matching value from each positioning point to each endpoint based on the first distance;
[0010] Generate a matching endpoint set for each positioning point based on the matching value;
[0011] Determine whether each matching endpoint set forms a continuous road segment;
[0012] If so, generate a matching trajectory based on the road segments corresponding to the endpoints that form the continuous road segment.
[0013] Further, the above-mentioned splitting of each road segment based on the shortest distance from each positioning point to each road segment includes:
[0014] Determine the nearest point from the positioning point to each road segment;
[0015] Calculate the shortest distance from the positioning point to each nearest point;
[0016] If the shortest distance is less than or equal to the matching error, split the road segment at the nearest point.
[0017] Further, the above-mentioned determination of the matching value of each positioning point to each end point based on the first distance includes:
[0018] If the first distance is less than or equal to the matching error, determine whether the first distance from the positioning point to the connected end point on the same road segment as the end point, the first distance from the adjacent positioning point of the positioning point to the end point, or the first distance from the adjacent positioning point to the connected end point on the same road segment as the end point is less than or equal to the matching error;
[0019] If so, the matching value of the positioning point to the end point is the first status value;
[0020] Otherwise, the matching value of the positioning point to the end point is the second status value.
[0021] Further, the above-mentioned generation of the matching end point set of each positioning point based on the matching value includes:
[0022] Put the end points with the first status value of the matching value into the matching end point set of the corresponding positioning point.
[0023] Further, the above-mentioned generation of the matching trajectory based on the road segments corresponding to the end points constituting the continuous road segment includes:
[0024] Use the road segments corresponding to the end points constituting the continuous road segment as the matching road segments;
[0025] Connect the nearest points from each positioning point to each matching road segment to obtain the matching trajectory.
[0026] Further, the method further includes: if the matching end point sets cannot form a continuous road segment, re-determine the matching error by binary search and return to the splitting step.
[0027] Further, the target trajectory further includes the longitude, latitude, and timestamp of each positioning point.
[0028] In a second aspect, an embodiment of the present application provides a trajectory map matching device, including:
[0029] An acquisition module, configured to acquire a plurality of road segments and a target trajectory including a plurality of positioning points;
[0030] A segmentation module, configured to segment each road section based on the shortest distance from each positioning point to each road section;
[0031] A calculation module, configured to calculate the first distance from each positioning point to each end point of each segmented road section;
[0032] A matching module, configured to determine the matching value of each positioning point to each end point based on the first distance;
[0033] An aggregation module, configured to generate a set of matching end points of each positioning point based on the matching value;
[0034] A determination module, configured to determine whether each set of matching end points forms a continuous road section;
[0035] A generation module, configured to generate a matching trajectory based on the road sections corresponding to the end points that form a continuous road section.
[0036] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it performs the steps of a trajectory map matching method according to any one of the above embodiments.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of a trajectory map matching method according to any one of the above embodiments.
[0038] In summary, compared with the prior art, the beneficial effects brought by the technical solution provided by the embodiment of the present application at least include:
[0039] A trajectory map matching method provided by an embodiment of the present application, first, determines the matching value with each end point by calculating the first distance between the positioning point and each end point on each road section, so as to decide whether to put the end point into the set of matching end points of the positioning point. Based on the continuous road sections formed by the sets of matching end points of each positioning point, the matching trajectory of the target trajectory in the road network is generated. It globally considers the matching degree between the trajectory and the road network, and reduces the possibility of the trajectory being mis-matched to an irrelevant road section by calculating the continuous road section most likely to generate the trajectory and then matching the trajectory, thereby improving the accuracy of trajectory matching. Description of the Drawings
[0040] Figure 1 It is a flowchart of a trajectory map matching method provided by an exemplary embodiment of the present application.
[0041] Figure 2 It is a structural diagram of a trajectory map matching device provided by an exemplary embodiment of the present application. Detailed Embodiments
[0042] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.
[0043] All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0044] Please refer to Figure 1 , the embodiments of the present application provide a trajectory map matching method, which may specifically include:
[0045] Step S1, obtaining a plurality of road segments and a target trajectory including a plurality of positioning points.
[0046] Among them, the road segments are known data in the current road network, and the target trajectory is the trajectory data to be matched, which also includes the longitude, latitude, and timestamp of each positioning point. The present application may define the data format of the target trajectory as {(x i , y i , t i )|1≤i≤n}, where n represents the number of GPS points contained in the trajectory, that is, the number of positioning points, and (x i , y i , t i ) represents the i-th positioning point of the target trajectory, x i and y i represent the longitude and latitude of the positioning point, and t i represents the timestamp when the positioning point is generated.
[0047] Step S2, splitting step: splitting each road segment based on the shortest distance from each positioning point to each road segment.
[0048] Specifically, determine the nearest point from the positioning point to each road segment, and calculate the shortest distance from the positioning point to each nearest point; if the shortest distance is less than or equal to the matching error, split the road segment at the nearest point. That is, for each GPS point p and each road segment s, find the point q on s that is closest to p. If the distance between p and q does not exceed U, split s into two road segments at q (if q is an endpoint of s, there is no need to split), and perform this splitting operation for each GPS point.
[0049] Step S3, calculating the first distance from each positioning point to each endpoint of the split road segments.
[0050] Step S4, determining the matching value of each positioning point to each endpoint based on the first distance.
[0051] Specifically, denote the set of endpoints of all road segments as S. Define the matching value f[i][j] to indicate whether the i-th positioning point can be matched to the j-th endpoint (1 ≤ j ≤ |S|). If it can be matched, the value of f[i][j] is true, which is the first state value; otherwise, it is false, which is the second state value. Define dist(i, j) to represent the distance between the i-th positioning point and the j-th endpoint.
[0052] Step S5: Generate the matching endpoint set for each positioning point based on the matching values.
[0053] Specifically, put the endpoints with the first state value of the matching value into the matching endpoint set corresponding to the positioning point. That is, if there exists a j such that f[n][j] = true, then a trajectory matching scheme is found. According to the assignment of f, it can be traced back. For each 1 ≤ i ≤ n, there exists a j such that f[i][j] is true. The set of these j is denoted as T (i.e., the matching endpoint set), otherwise not found.
[0054] Step S6: Determine whether each matching endpoint set forms a continuous road segment.
[0055] Step S7: If so, generate a matching trajectory based on the road segments corresponding to the endpoints that form the continuous road segment.
[0056] Specifically, take the road segments corresponding to the endpoints that form the continuous road segment as the matching road segments, and connect the nearest points from each positioning point to each matching road segment to obtain the matching trajectory.
[0057] In the specific implementation process, there may be a positioning error at a certain point of the gps trajectory, resulting in multiple j satisfying f[i][j] = true. In this case, it can be considered that these endpoints may all be the best matches. Therefore, in this application, for each gps point, a set of "possible matching" road segment endpoints is circled within the range of the matching error U. f attempts to find a continuous set of road segments within these endpoint sets, and these sets of road segments are the trajectory matching results.
[0058] From the calculation process of f, it can be seen that if f[n][j] = true, then there must exist a continuous road segment that meets the requirements. If there are multiple continuous road segments, any connected matching scheme can be taken. Then, for each GPS point, project it onto the nearest point on the continuous road segment, and these points mapped onto the road network form the matching trajectory.
[0059] A trajectory map matching method provided by the above embodiments. First, the matching values with each endpoint are determined by calculating the first distance between the positioning point and each endpoint on each road segment, so as to decide whether to put the endpoint into the set of matching endpoints of the positioning point. Based on the continuous road segments formed by the sets of matching endpoints of each positioning point, the matching trajectory of the target trajectory in the road network is generated. The matching degree between the trajectory and the road network is considered globally. By calculating the continuous road segments that are most likely to generate the trajectory and then matching the trajectory, the possibility of the trajectory being mis-matched to an irrelevant road segment is reduced, and the accuracy of trajectory matching is improved.
[0060] In some embodiments, determining the matching values of each positioning point to each endpoint based on the first distance includes:
[0061] If the first distance is less than or equal to the matching error, then determine whether the first distance between the positioning point and the connected endpoint on the same road segment as the endpoint, the first distance between the adjacent positioning point of the positioning point and the endpoint, or the first distance between the adjacent positioning point and the connected endpoint on the same road segment as the endpoint is less than or equal to the matching error.
[0062] If so, the matching value of the positioning point to the endpoint is the first state value, otherwise the matching value of the positioning point to the endpoint is the second state value.
[0063] Specifically, define the initial value f[1][j] = true if and only if dist(1,j) ≤ U. For each 2 ≤ i ≤ n, if dist(i,j) > U, then f[i][j] must be false. Otherwise, if f[i - 1][j] is true, or there exists an endpoint k connected to j such that f[i][k] or f[i - 1][k] is true, then f[i][j] is true, and k and j are two endpoints on the same road segment, as shown in the following formula:
[0064]
[0065] Traverse i from small to large. When i is fixed, repeat the update for each j until the value of f[i] no longer changes. During the calculation process, i may be matched with multiple endpoints, and the set of endpoints that can be matched expands little by little. In this case, the value of f[i] will gradually become true until the matching result can no longer be updated.
[0066] In some embodiments, the method further includes: if the sets of matching endpoints cannot form a continuous road segment, then use binary search to re-determine the matching error and return to the splitting step.
[0067] Specifically, if no continuous road segment is found, the binary search method is used to re-determine U, and the splitting step is returned. The binary search method is as follows: Given the left boundary (such as 0 km) and the right boundary (such as 10 km), each time the average value m of the two boundaries is used as the matching error to check if a matching solution can be found, that is, a continuous road segment. If not, the left boundary is set equal to m; otherwise, the right boundary is set equal to m. Repeat the above steps until the difference between the left and right boundaries is less than a very small value.
[0068] The above embodiment uses binary matching to limit the matching error U. From the function definition, it can be seen that the overall trajectory cannot be too far from the matching road network, solving the problem that the noise at the beginning of the trajectory in the Hidden Markov and greedy algorithms is amplified during the matching process, resulting in a matching error, and further improving the accuracy of the matching trajectory.
[0069] Please refer to Figure 2 , another embodiment of the present application provides a trajectory map matching device, including:
[0070] An acquisition module 101, configured to acquire a plurality of road segments and a target trajectory including a plurality of positioning points.
[0071] A splitting module 102, configured to split each road segment based on the shortest distance from each positioning point to each road segment.
[0072] A calculation module 103, configured to calculate the first distance from each positioning point to each end point of the split road segments.
[0073] A matching module 104, configured to determine the matching value of each positioning point to each end point based on the first distance.
[0074] A set module 105, configured to generate a matching end point set for each positioning point based on the matching value.
[0075] A judgment module 106, configured to judge whether each matching end point set forms a continuous road segment.
[0076] A generation module 107, configured to generate a matching trajectory based on the road segments corresponding to the end points that form a continuous road segment.
[0077] The specific limitations provided in this embodiment for a trajectory map matching device can be referred to the embodiment of a trajectory map matching method in the above text, and will not be elaborated here.
[0078] Each module in the above trajectory map matching device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0079] An embodiment of the present application provides a computer device, which may include a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the processor is caused to execute the steps of a trajectory map matching method according to any one of the above embodiments.
[0080] For the working process, working details, and technical effects of the computer device provided in this embodiment, reference may be made to the embodiments of a trajectory map matching method in the foregoing text, and details are not described herein again.
[0081] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a trajectory map matching method according to any one of the above embodiments are implemented. Among them, the computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, a floppy disk, an optical disc, a hard disk, a flash memory, a USB flash drive, and / or a Memory Stick, etc. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. For the working process, working details, and technical effects of the computer-readable storage medium provided in this embodiment, reference may be made to the embodiments of a trajectory map matching method in the foregoing text, and details are not described herein again.
[0082] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM).
[0083] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0084] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A trajectory map matching method, characterized in that: include: Obtain multiple road segments and target trajectories including multiple positioning points; Splitting step: splitting each road segment based on the shortest distance from each positioning point to each road segment; specifically, determining the shortest point from the positioning point to each road segment; calculating the shortest distance from the positioning point to each of the shortest points; if the shortest distance is less than or equal to the matching error, splitting the road segment at the shortest point; Calculating the first distance from each of the positioning points to each of the end points of each of the segmented road sections; Determine a matching value from each of the positioning points to each of the endpoints based on the first distance; Specifically, if the first distance is less than or equal to the matching error, then determining whether the first distance from the positioning point to the endpoint connected to the endpoint on the same road section, the first distance from the adjacent positioning point of the positioning point to the endpoint, or the first distance from the adjacent positioning point to the endpoint connected to the endpoint on the same road section is less than or equal to the matching error; If yes, the matching value from the positioning point to the endpoint is a first state value; Otherwise, the matching value from the anchor point to the endpoint is a second state value; Generate a matching endpoint set for each of the positioning points based on the matching value; Determining whether each of the matching endpoint sets constitutes a continuous road segment; If so, a matching trajectory is generated based on the road segments corresponding to the endpoints constituting the continuous road segment.
2. The trajectory map matching method according to claim 1, characterized in that: Generating a matching endpoint set of each positioning point based on the matching value includes: The endpoint whose matching value is the first state value is placed into the matching endpoint set corresponding to the anchor point.
3. The trajectory map matching method according to claim 1, characterized in that: The generating a matching trajectory based on the road segments corresponding to the endpoints constituting the continuous road segment comprises: The road segments corresponding to the endpoints constituting the continuous road segment are used as matching road segments; The nearest points from each positioning point to each matching road segment are connected to obtain the matching trajectory.
4. The trajectory map matching method according to claim 1, characterized in that: Also includes: If the matching endpoint sets cannot form a continuous road segment, a binary search is used to redetermine the matching error and return to the segmentation step.
5. The trajectory map matching method according to claim 1, characterized in that: The target trajectory also includes the longitude, latitude and timestamp of each positioning point.
6. A trajectory map matching device, characterized in that: include: An acquisition module, used for acquiring multiple road sections and target trajectories including multiple positioning points; A segmentation module, used to segment each of the road sections based on the closest distance from each of the positioning points to each of the road sections; specifically, determine the closest point from the positioning point to each of the road sections; calculate the closest distance from the positioning point to each of the closest points; if the closest distance is less than or equal to the matching error, segment the road section at the closest point; A calculation module, used for calculating the first distance from each of the positioning points to each end point of each of the segmented road sections; A matching module, configured to determine a matching value from each of the positioning points to each of the endpoints based on the first distance; Specifically, if the first distance is less than or equal to the matching error, then determining whether the first distance from the positioning point to the endpoint connected to the endpoint on the same road section, the first distance from the adjacent positioning point of the positioning point to the endpoint, or the first distance from the adjacent positioning point to the endpoint connected to the endpoint on the same road section is less than or equal to the matching error; If yes, the matching value from the positioning point to the endpoint is a first state value; Otherwise, the matching value from the anchor point to the endpoint is a second state value; A collection module, used for generating a matching endpoint set of each of the positioning points based on the matching value; A judging module, used for judging whether each set of matching endpoints constitutes a continuous road segment; A generating module is used to generate a matching trajectory based on the road segments corresponding to the endpoints constituting the continuous road segment.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the trajectory map matching method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the trajectory map matching method as claimed in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Road matching method based on fusion of probe vehicle movement track and electronic map
CN104634352A
Map matching method and device
CN107588778A