A road flow matching method for GPS trajectory data based on network coding

Through network encoding method, the GPS trajectory data is matched in section traffic, the road network is simplified, the grid is divided, and the data is preprocessed, which solves the problem of low computing speed in the existing technology, and realizes efficient matching of large-scale urban traffic data and Real-time response.

CN115662124BActive Publication Date: 2024-12-03BEIJING TRANSPORTATION RES CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211293839.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2024-12-03
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

The existing technology has low calculation rate when facing large-scale trajectory data matching in urban traffic, making it difficult to achieve real-time response. Especially under complex road networks and large amounts of motor vehicle data, the map matching algorithm has a large amount of calculation, resulting in inefficiency.

Method used

The GPS trajectory data segment traffic matching method based on network encoding is adopted to improve the computing efficiency and ensure matching accuracy by simplifying the road network, dividing the three-level grid, encoding the road segment, preprocessing the trajectory data, deduplication and matching the road segment.

Benefits of technology

It significantly improves the computing efficiency of map matching, can achieve real-time response under large-scale urban traffic flow, improves matching accuracy and computing efficiency, and meets the needs of real-time application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115662124B_ABST
    Figure CN115662124B_ABST
Patent Text Reader

Abstract

The present invention provides a method for matching the traffic flow of a road section of GPS trajectory data based on network coding, which belongs to the technical field of intelligent traffic data processing and is used to solve the technical problem of low calculation rate of the existing map matching algorithm. The method includes simplifying the road network, preprocessing the trajectory data, forming the trajectory segment based on grid coding, forming a complete trajectory, filling the missing trajectory, and counting the traffic flow of each road section to obtain the traffic flow of each road section that matches the road network; the road network is simplified by gridding the road network, the road network is divided into three levels of equal-sized grids and encoded, the trajectory data is preprocessed, and the trajectory data is deleted, deduplicated, merged, filled and classified stored based on the grid coding, which improves the accuracy of road section matching, reduces the time cost required for urban traffic map matching, greatly improves the map matching calculation efficiency, and can achieve real-time response application effects when facing large-scale traffic flow of urban traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent traffic data processing and relates to a GPS track data section flow matching method based on network coding. Background Art

[0002] The characteristics of urban traffic vary due to differences in population size, major industries, and geographical locations of different cities, but they have similar main characteristics, namely, the focus of urban traffic is passenger transport, commuting is the main traffic demand during peak traffic periods, and the size of urban traffic volume is directly related to the level of traffic services, traffic policies, and traffic management of each city. With the continuous increase in the number of motor vehicles in my country, urban traffic congestion has become more and more serious. Traffic management and control at the micro level is an effective means to solve the problem of traffic congestion, and how to identify the sections and times where traffic congestion often occurs is the basis of management and control.

[0003] Existing traffic survey equipment is usually installed on the main roads of the city, with narrow coverage, making it difficult to effectively monitor the traffic conditions of the entire road network. In contrast, GPS equipment has a wide coverage and can better reflect the actual traffic situation. However, the spatial information collected by GPS equipment only includes longitude and latitude and has errors, making it difficult to directly locate in the road network and obtain the actual traffic conditions of each section. Based on this, technicians in related fields have designed various map matching algorithms, but existing algorithms face the problem of calculation speed when matching large-scale vehicles across the entire city.

[0004] Due to the complex structure of urban road networks, the large number of motor vehicles, and the great differences in travel characteristics of different groups of people, a huge amount of travel data is generated. In map matching, the wider the road network, the more spatial information and topological relationships it contains, and the greater the amount of calculation involved. Therefore, the current general map matching algorithms face the problem of calculation speed in big data applications. Conventional map matching algorithms are difficult to achieve real-time response application effects when facing large-scale trajectory points of urban traffic.

[0005] Therefore, a road traffic matching method for GPS trajectory data based on network coding is designed to quickly match the map while ensuring the matching accuracy, thereby improving the calculation efficiency of map matching. Summary of the invention

[0006] The purpose of the present invention is to address the above problems in the existing technology and propose a method for matching road traffic of GPS trajectory data sections based on network coding. The technical problem to be solved by the present invention is: how to improve the efficiency of map matching calculation.

[0007] The purpose of the present invention can be achieved by the following technical solutions:

[0008] A method for matching road traffic of GPS trajectory data based on network coding comprises the following steps:

[0009] S1. Simplifying the road network. Step S1 includes the following steps:

[0010] S101, obtaining road network information: preparing a road network file, which must contain information such as road network nodes, coordinates, and road section directions;

[0011] S102, dividing the road network map into three levels of grids of equal size, where the grid size is determined according to the size of the road network;

[0012] S103, encode the classified grids, and the encoding rules are as follows: the encoding has a total of 14 digits, the first 5 digits represent the X direction of the primary decoding, and the 6th to 10th digits represent the Y direction of the primary encoding; the 11th digit represents the X direction of the secondary encoding, and the 12th digit represents the Y direction of the secondary encoding; the 13th digit represents the X direction of the tertiary encoding, and the 14th digit represents the Y direction of the tertiary encoding;

[0013] The encoding formula is based on the input longitude and latitude, and the encoding formula is as follows (see formula 1):

[0014]

[0015] Among them, min is the starting point coordinate, the starting point coordinate is (0,0); gridsize is the accuracy, the first to third level grid accuracy is set to 0.01, 0.002, 0.0004 respectively; lat is the longitude coordinate, lon is the latitude coordinate, min lat and min lon are the initial minimum longitude and latitude for map gridding, respectively;

[0016] S104, assigning codes to all road sections, assigning a sequence to each road section, the sequence being the coding sequence of the grids that the road section passes through, sorting the sequences according to the direction of the road, and establishing two dictionaries to store the relationship between the two, the first key of the dictionary being the road section number, the value being the coding sequence, the second key of the dictionary being the coding sequence, the value being the road section number within the grid;

[0017] S2, pre-processing the GPS trajectory data, in step S2, including the following steps:

[0018] S201, delete null values: delete the data with some null values ​​(license plate, time, longitude, latitude) in the GPS track data list, delete the data whose spatial location is outside the road network boundary, and sort the data in chronological order;

[0019] S202, classifying and storing vehicles according to license plate numbers;

[0020] S203, retaining the stop points: Filter out the continuous trajectory data (two or more) of each vehicle whose longitude and latitude remain unchanged or whose distance is less than 15 meters. When the time span of the continuous trajectory data is less than 30 minutes, only the first trajectory point is retained. Otherwise, the first trajectory data and the last trajectory data are retained, and the two trajectory data are labeled as stop points (trajectory points where the vehicle position remains unchanged for a period of time, and the vehicle may be in a stop state at this time) so that they will not be deleted in the subsequent deduplication operation;

[0021] S204, delete abnormal data: delete points with abnormal time and speed, calculate the distance and time difference between adjacent coordinate points, and then divide the distance by the time difference to get the speed. If the speed is greater than 34 meters per second, the latter point is regarded as a data abnormality and deleted. If the speed is less than 8 meters per second and the time difference is greater than 600 seconds, the vehicle is regarded as stopped and the latter point is deleted.

[0022] S205, looping steps S203 and S204 for each vehicle to obtain pre-processed trajectory data;

[0023] S3, according to the grid matching section where the vehicle trajectory point is located, each matching section is connected to form a plurality of trajectory segments, and the step S3 includes the following steps:

[0024] S301, matching a grid according to the longitude and latitude of the trajectory point, and adding a column to the original data for storing the code of the matching grid;

[0025] S302, adjacent track point deduplication: determine whether the grid codes of adjacent track points are consistent. If they are consistent, only the first track point is retained, and the duplicate values ​​of adjacent tracks are deleted by a deduplication function. The deduplication function expression is as follows (see formula 2):

[0026] Dedupl(Code list )=Dedupl(Code(code1,code2,,code3...coden))=

[0027] Code list {code1,code2,…coden} (Formula 2)

[0028] Among them, Dedupl() is the deduplication function, Code(code1,code2,…coden) is the set of adjacent trajectory points, Code list It is the trajectory point that is finally retained after deduplication;

[0029] S303, obtaining all road sections in the grid corresponding to the trajectory point through the dictionary 2 in step S104 as a set of candidate road sections for the trajectory point;

[0030] S304: Deletion determination is performed on all trajectory points obtained in step S303 (determine which trajectory points need to be deleted), the determination step length is 3 (i.e., three adjacent trajectory points are determined each time), and the forward step length of each determination is 1; the determination rules are as follows:

[0031] If the candidate road segment candidate sets corresponding to adjacent trajectory points are exactly the same, the road segment set of the next trajectory point is deleted. The formula is as follows (see Formula 3):

[0032] Dedpul{Point1[way1,way2,way3],Point2[way1,way2,way3]}=

[0033] {[Point1, Point2][way1, way2, way3]} (Formula 3)

[0034] Where Dedpul{} is a deduplication function, Point1[way1,way2,way3], Point2[way1,way2,way3] are two adjacent trajectory points with the same corresponding candidate road segment set. This data set is considered to be repeated entry of trajectory point data, and [Point1,Point2][way1,way2,way3] is the trajectory point obtained after deduplication.

[0035] If the road segment sets of two trajectory points separated by one trajectory point are exactly the same, it is considered that the separated trajectory points are offset and deleted. The formula is as follows (see formula 4):

[0036] Dedpul{Point1[way1,way2,way3],Point2[way4,way5],Point3[way1,way2,way3]}=

[0037] {[Point1,Point3][way1,way2,way3],Point2[way4,way5]} (Formula 4)

[0038] Among them, Dedpul{} is the deduplication function, Point1[way1,way2,way3], Point3[way1,way2,way3] are two trajectory points whose corresponding candidate road segments are exactly the same and whose interval distance is one trajectory point apart. This data set is considered to be duplicate data entry caused by trajectory point offset, and [Point1,Point3][way1,way2,way3] is the trajectory point obtained after deduplication;

[0039] S305, constructing a trajectory segment set, which is initially an empty set and is used to store the determination result of step S306;

[0040] S306, the candidate road segment set of the adjacent trajectory points in the result of S304 is retained (determining which road segments in the road segment set need to be retained), the determination step length is 2, if the determination is passed, it is stored in the trajectory road segment set constructed in step S305, and the corresponding relationship between the trajectory point and the candidate road segment is established, if the determination is not passed, it stops and goes to step S307; the first determination stores the candidate road segments that meet the conditions of the first trajectory point and the second trajectory point in the trajectory road segment set, the second determination object is the second trajectory point and the third trajectory point, at this time, the candidate road segment of the second trajectory point is already in the trajectory road segment set, and only the candidate road segment that meets the conditions of the third trajectory point is added, and so on, the object of each subsequent determination is actually the last trajectory point in the trajectory road segment set and its adjacent trajectory points that are not in the set;

[0041] The rule for determining the retention of road segments is as follows: when the same road segment exists in the candidate road segment set of adjacent trajectory points, the same road segment is retained. At this time, the road segment already exists in the trajectory road segment set and does not need to be added; when different road segments exist, the connectivity between the road segments is determined. If the road segments are connected, they are retained and the retained road segment set is added to the trajectory road segment set. The rules for determining the connectivity between road segments are as follows:

[0042] S3061, there are a starting section a and an ending section b, first determine whether the two sections have an intersection, if yes, determine whether the intersection of section a and section b is the starting point of a and the end point of b, if yes, section a cannot reach section b, and the determination ends; if no intersection, store section a in the candidate section set, and continue with the following steps;

[0043] S3062, each time, it is only necessary to search for the next connected segment of the last segment in the candidate segment set (the direction must also be consistent). If there is a connected segment, the segment is added to the corresponding candidate segment set; if there are two connected segments, two candidate segment sets are generated, and the connected segments are stored separately, and so on. The storage rule formula is as follows (see Formula 5. For the end segment with two connected segments, two candidate segment sets can be obtained according to Formula 5 when constructing the trajectory);

[0044] Candidate waylist1 =[way1,way2]

[0045] Candidate waylist2 =[way3,way4]

[0046] Intersection{Candidate waylist1 ,Candidate waylist2}=

[0047] {[PointCode1,PointCode2],[[way1,way3],[way2,way3]]} (Formula 5)

[0048] Among them, Intersection{} is the function for judging connectivity, Candidate waylist is the stored judgment result, PointCode is the trajectory point code, [way1,way2], [way3,way4], [way1,way3], [way2,way3] are the stored start and end sections;

[0049] After all candidate road segments have been processed, go to step S3063;

[0050] S3063, eliminating candidate road sections similar to the road section {1,2,3,1}, which will be judged as alternating main and auxiliary roads;

[0051] S3064, to prevent the connectivity judgment time from being too long, the number of road segments in the candidate road segment set is set to 8. When the number of the candidate road segment set is 8 and no feasible route has been found, the two road segments are considered unreachable; if they are reachable, the candidate road segment set is added to the trajectory road segment set;

[0052] S307, when step S306 is judged not to pass, the trajectory data is segmented, that is, the current trajectory point is considered to be the end point of the path (the last section of the current section set); at the same time, the next trajectory point is considered to be the starting point of the new path (the first section of the new section set), and go to step S305;

[0053] S4. In step S3, multiple track segment sets are obtained, and segments that can connect adjacent track segments are searched within a range of 5 kilometers. If there are multiple track segments for the same batch of track points, each track segment will be connected to the previous track segment and the next track segment, and finally multiple complete tracks are formed;

[0054] There are two situations where the trajectory segments are not connected: (1) the distance between the two trajectory segments is greater than 5 kilometers; (2) there is a difference between the road network used in the program and the road network on which the vehicle travels;

[0055] S5, select the shortest complete trajectory in step S4 as the final matching trajectory, query the node longitude and latitude of the added road segments in step S3 and step S4 and the grid code of the nodes according to the road network relationship, use the nodes to fill in the missing trajectory points, ensure that all road segments have a corresponding relationship with the trajectory points, and finally assign time;

[0056] The time calculation rule for missing trajectory points is as follows: the distance between the trajectory point to be filled and the previous trajectory point is divided by the speed of the previous trajectory point to get the time difference between the two trajectory points. The time of the previous trajectory point plus the time difference is the time to fill the trajectory point.

[0057] S6. By looping steps S3 to S5 for each vehicle, the spatial correspondence between the trajectory points of each vehicle and the road section and the time when the vehicle appears on each road section are obtained; all the obtained vehicle trajectory data are classified and stored according to the road section number (link), and the trajectory data set corresponding to each road section is obtained. Then, according to the time requirement (such as hourly granularity and 15-minute granularity) of aggregation (in traditional traffic planning or traffic demand prediction, the target area or group is usually first divided into several specific aggregates such as small areas or groups, and then the discussion of the problem is carried out with these small areas or groups as basic units. When building a model or enlarging the sample, it is necessary to aggregate the data with this type of aggregate as a unit. The data obtained by the above aggregation processing is called aggregated data, and the model established with the aggregated data is called an aggregated model) the trajectory data set is further divided to obtain the trajectory data set divided into sections and time periods, and the trajectory data is deduplicated. The amount of data after deduplication is the flow of the road section in the time period;

[0058] The trajectory data deduplication rules in this step are as follows: the license plate number is the unique identification mark of the vehicle, so the license plate number column in the trajectory data set is selected as the reference column for data deduplication, and sorted by the license plate number column (either ascending or descending), and the trajectory data with duplicate license plate numbers are deleted, and only the first row of data is retained.

[0059] The daily flow rate, morning and evening peak flow rate or flow rate in different areas of the road section can be aggregated as needed.

[0060] Compared with the existing technology, this method of GPS trajectory data section flow matching based on network coding has the following advantages:

[0061] This patent uses a road traffic matching method for GPS trajectory data based on network coding to construct road topology and fully grid the road network before map matching, fully considers possible situations that may arise in practice and simplifies and pre-processes the trajectory, thereby improving the matching accuracy, reducing the time cost of map matching, and greatly improving the map matching calculation efficiency. It can achieve real-time response application effects when facing large-scale traffic flows in urban traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a schematic diagram of the technical route of the present invention;

[0063] Figure 2 It is a time-consuming distribution diagram of trajectory matching using the method of the present invention;

[0064] Figure 3 It is a time distribution ratio diagram of trajectory matching using the method of the present invention; DETAILED DESCRIPTION

[0065] The technical solution of this patent is further described in detail below in conjunction with specific implementation methods.

[0066] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0067] See also Figure 1 This embodiment provides a method for matching traffic flow of road sections of GPS trajectory data based on network coding. This embodiment takes the trajectory data of a vehicle with a license plate number of Beijing AP5*** as an example, and adopts this method to perform traffic flow matching processing of road sections of GPS trajectory data. The specific steps are as follows:

[0068] S1. Simplify the road network. Select the Beijing road network shp file and extract the spatial information to simplify the topological relationship, including the following steps:

[0069] S101. Obtain road network information: prepare the Beijing road network shp file. The prepared road network file must contain information such as road network nodes, coordinates, and road section directions.

[0070] S102, dividing the road network map into three levels of equal-sized grids; setting the sizes of the three levels of grids according to the actual size of the Beijing road network: the first level grid size is set to 1.2km*609.4m, the second level grid size is set to 152.9m*152.4m, and the third level grid size is set to 39.2m*19m.

[0071] S103, encode the classified grids, and the encoding rules are as follows: the encoding has a total of 14 digits, the first 5 digits represent the X direction of the primary decoding, and the 6th to 10th digits represent the Y direction of the primary encoding; the 11th digit represents the X direction of the secondary encoding, and the 12th digit represents the Y direction of the secondary encoding; the 13th digit represents the X direction of the tertiary encoding, and the 14th digit represents the Y direction of the tertiary encoding;

[0072] The encoding formula is based on the input longitude and latitude, and the encoding formula is as follows (see formula 1):

[0073]

[0074] Among them, min is the starting point coordinate, the starting point coordinate is (0,0); gridsize is the accuracy, the first, second, and third level grid accuracy are set to 0.01, 0.002, and 0.0004 respectively; lat is the longitude coordinate, lon is the latitude coordinate, min lat and minlon They are the initial minimum longitude and latitude for map gridding, respectively.

[0075] S104. Code all road sections. Each road section is assigned a sequence, which is the coding sequence of the grids that the road section passes through. The sequences are sorted according to the direction of the road. For example, the coding sequence of the road ID 4263917 is ["11633039913431","11633039913421","11633039913411","11633039912451","11633039912441"]; two dictionaries are established to store the relationship between the two. The first key of the dictionary is the road section number, and the value is the coding sequence. The second key of the dictionary is the coding sequence, and the value is the road section number in the grid.

[0076] S2, pre-processing the GPS trajectory data, in step S2, including the following steps:

[0077] S201, delete empty values: delete the data with empty values ​​(license plate, time, longitude, latitude) in the GPS trajectory data list, delete the data whose spatial location is outside the road network boundary, and sort the data in chronological order.

[0078] S202: Classify and store vehicles according to license plate numbers.

[0079] S203, retaining the stop points: Filter out the continuous trajectory data (two or more) of each vehicle whose longitude and latitude remain unchanged or whose distance is less than 15 meters. When the time span of the continuous trajectory data is less than 30 minutes, only the first trajectory point is retained. Otherwise, the first trajectory data and the last trajectory data are retained, and the two trajectory data are labeled as stop points (trajectory points where the vehicle position remains unchanged for a period of time, and the vehicle may be in a stop state at this time) so that they will not be deleted in the subsequent deduplication operation.

[0080] S204, delete abnormal data: delete points with abnormal time and speed, calculate the distance and time difference between adjacent coordinate points, and then divide the distance by the time difference to get the speed. If the speed is greater than 34 meters per second, the latter point is regarded as a data abnormality and deleted. If the speed is less than 8 meters per second and the time difference is greater than 600 seconds, it is regarded as a vehicle stop and the latter point is deleted.

[0081] S205. For each vehicle, steps S203 and S204 are looped to obtain pre-processed trajectory data.

[0082] The amount of GPS trajectory data of Beijing AP5*** vehicle after preprocessing is 437. An example of some data of a sampling vehicle on January 13, 2020 after preprocessing is shown in Table 1.

[0083] Table 1 Example of preprocessed vehicle trajectory data

[0084]

[0085]

[0086] S3, according to the grid where the vehicle trajectory point is located, the matching road sections are connected to form multiple trajectory segments. Taking the GPS trajectory data of Beijing AP5*** vehicle as an example, step S3 includes the following steps:

[0087] S301. Match the grid according to the longitude and latitude of each track point of the Beijing AP5*** vehicle, and add a column to the original data to store the code of the matching grid.

[0088] S302, adjacent track point deduplication: determine whether the grid codes of adjacent track points are consistent. If they are consistent, only the first track point is retained, and the duplicate values ​​of adjacent tracks are deleted by a deduplication function. The deduplication function expression is as follows (see formula 2):

[0089] Dedupl(Code list )=Dedupl(Code(code1,code2,,code3...coden))=

[0090] Code list {code1,code2,…coden} (Formula 2)

[0091] Among them, Dedupl() is the deduplication function, Code(code1,code2,…coden) is the set of adjacent trajectory points, Code list It is the trajectory point that is finally retained after deduplication;

[0092] After step S301 and step S302, a total of 62 pieces of grid-coded data are obtained. Examples of partial trajectory data are shown in Table 2.

[0093] Table 2 Example of vehicle trajectory data with grid coding

[0094]

[0095]

[0096] S303, using the dictionary 2 in step S104 to obtain all the road sections in the grid corresponding to the vehicle trajectory point of Beijing AP5*** as the candidate road section set of the trajectory point; a total of 140 links, and a partial data example of the candidate road section set of the trajectory point is shown in Table 3.

[0097] Table 3 Example of trajectory point candidate road segment set

[0098]

[0099] S304, perform deletion determination on all the track points of the Beijing AP5*** vehicle obtained in step S303, with a determination step length of 3 and a forward step length of 1 for each determination; the determination rules are as follows:

[0100] If the candidate road segment candidate sets corresponding to adjacent trajectory points are exactly the same, the road segment set of the next trajectory point is deleted. The formula is as follows (see Formula 3):

[0101] Dedpul{Point1[way1,way2,way3],Point2[way1,way2,way3]}=

[0102] {[Point1, Point2][way1, way2, way3]} (Formula 3)

[0103] Where Dedpul{} is a deduplication function, Point1[way1,way2,way3], Point2[way1,way2,way3] are two adjacent trajectory points with the same corresponding candidate road segment set. This data set is considered to be repeated entry of trajectory point data, and [Point1,Point2][way1,way2,way3] is the trajectory point obtained after deduplication.

[0104] If the road segment sets of two trajectory points separated by one trajectory point are exactly the same, it is considered that the separated trajectory points are offset and deleted. The formula is as follows (see formula 4):

[0105] Dedpul{Point1[way1,way2,way3],Point2[way4,way5],Point3[way1,way2,way3]}=

[0106] {[Point1,Point3][way1,way2,way3],Point2[way4,way5]} (Formula 4)

[0107] Among them, Dedpul{} is the deduplication function, Point1[way1,way2,way3], Point3[way1,way2,way3] are two trajectory points with the same corresponding candidate road segment set and the interval distance is one trajectory point apart. This data set is considered to be duplicate data entry caused by trajectory point offset, and [Point1,Point3][way1,way2,way3] is the trajectory point obtained after deduplication.

[0108] S305 , construct a trajectory segment set, which is initially an empty set and is used to store the determination result of step S306 .

[0109] S306, the candidate road segment set of the adjacent track points in the result of S304 is retained and determined, the determination step is 2, and if the determination is passed, it is stored in the track segment set constructed in step S305, and the corresponding relationship between the track point and the candidate road segment is established. If the determination is not passed, it stops and goes to step S307. The first determination stores the candidate road segments that meet the conditions of the first track point and the second track point in the track segment set, and the second determination object is the second track point and the third track point. At this time, the candidate road segment of the second track point is already in the track segment set, and only the candidate road segment that meets the conditions of the third track point is added. By analogy, the object of each subsequent determination is actually the last track point in the track segment set and its adjacent track points that are not in the set.

[0110] The rule for determining the retention of road segments is as follows: when the same road segment exists in the candidate road segment set of adjacent trajectory points, the same road segment is retained. At this time, the road segment already exists in the trajectory road segment set and does not need to be added; when different road segments exist, the connectivity between the road segments is determined. If the road segments are connected, they are retained and the retained road segment set is added to the trajectory road segment set. The rules for determining the connectivity between road segments are as follows:

[0111] S3061, there are a starting section a and an ending section b, first determine whether the two sections have an intersection, if yes, determine whether the intersection of section a and section b is the starting point of a and the end point of b, if yes, section a cannot reach section b, and the determination ends; if no intersection, store section a in the candidate section set, and continue with the following steps;

[0112] S3062, each time, it is only necessary to search for the next connected segment of the last segment in the candidate segment set (the direction must also be consistent). If there is a connected segment, the segment is added to the corresponding candidate segment set; if there are two connected segments, two candidate segment sets are generated, and the connected segments are stored separately, and so on. The storage rule formula is as follows (see Formula 5. For the end segment with two connected segments, two candidate segment sets can be obtained according to Formula 5 when constructing the trajectory);

[0113] Candidate waylist1 =[way1,way2]

[0114] Candidate waylist2 =[way3,way4]

[0115] Intersection{Candidate waylist1 ,Candidate waylist2}=

[0116] {[PointCode1,PointCode2],[[way1,way3],[way2,way3]]} (Formula 5)

[0117] Among them, Intersection{} is the function for judging connectivity, Candidate waylist is the stored judgment result, PointCode is the trajectory point code, [way1,way2], [way3,way4], [way1,way3], [way2,way3] are the stored start and end sections;

[0118] After all candidate road segments have been processed, go to step S3063;

[0119] S3063, eliminating candidate road sections similar to the road section {1,2,3,1}, which will be judged as alternating main and auxiliary roads;

[0120] S3064. To prevent the connectivity judgment time from being too long, the number of segments in the candidate segment set is set to 8. When the number of candidate segment sets is 8 and no feasible route has been found, the two segments are considered unreachable; if they are reachable, the candidate segment set is added to the trajectory segment set.

[0121] S307. When step S306 is judged as not passed, the trajectory data is segmented, that is, the current trajectory point is considered to be the end point of the path (the last section of the current section set); at the same time, the next trajectory point is considered to be the starting point of the new path (the first section of the new section set), and go to step S305.

[0122] The result of step S3 is shown in Table 4, which is an example of the candidate segment set of each intercepted trajectory segment. Since the trajectory data will be segmented when the connectivity judgment fails, the final candidate segment set is the summary of the candidate set of each trajectory segment. Among them, the grid code only stores the starting point and end point of the trajectory segment; the grid code is used as the key, and the corresponding value is the candidate path of the trajectory segment. There can be multiple candidate paths, all of which are used as candidates for the final segment.

[0123]

[0124]

[0125] Table 4 Examples of candidate road segment sets for each trajectory segment

[0126] S4. In step S3, multiple trajectory segment sets are obtained. The segments that can connect adjacent trajectory segments are searched within a range of 5 kilometers. If there are multiple trajectory segments for the same batch of trajectory points, each trajectory segment will be connected to the previous trajectory segment and the next trajectory segment, and finally multiple complete trajectories are formed; for example, from the starting grid 11646039863413 to the end grid 11644039864424 (see Table 4), the complete trajectories are [187844581, 150585627, 240635778, 164948575] and [187844581, 26403549, 240635778, 164948575], and each candidate path will appear in the complete trajectory. There are two cases where the trajectory segments are not connected: (1) the distance between the two trajectory segments is greater than 5 kilometers; (2) there is a difference between the road network used in the program and the road network on which the vehicle travels.

[0127] S5, select the shortest complete trajectory in step S4 as the final matching trajectory, query the node longitude and latitude of the added road segments in step S3 and step S4 and the grid code of the nodes according to the road network relationship, use the nodes to fill in the missing trajectory points, ensure that all road segments have a corresponding relationship with the trajectory points, and finally assign time;

[0128] The time calculation rule for missing track points is as follows: the distance between the track point to be filled and the previous track point is divided by the speed of the previous track point to get the time difference between the two track points. The time of the previous track point plus the time difference is the time to fill the track point. The calculation formula is as follows:

[0129] T 缺失轨迹点 =T 上一轨迹点 +S / V 上一轨迹点

[0130] Where, T 缺失轨迹点 is the time of missing trajectory points, T 上一轨迹点 is the time of the previous trajectory point, S is the distance between the missing trajectory point and the previous trajectory point, V 上一轨迹点 is the velocity of the previous trajectory point.

[0131] S6. By looping steps S3 to S5 for each vehicle, the spatial correspondence between the trajectory points of each vehicle and the road section and the time when the vehicle appears on each road section are obtained; all the obtained vehicle trajectory data are classified and stored according to the road section number (link) to obtain the trajectory data set corresponding to each road section, and then the trajectory data set is further divided according to the time requirement of the aggregation (such as hourly granularity, 15-minute granularity) to obtain the trajectory data set divided by road section and time period, and the trajectory data is deduplicated to finally obtain the traffic of each road section in different time periods.

[0132] The trajectory data deduplication rules in this step are as follows: the license plate number is the unique identification mark of the vehicle, so the license plate number column in the trajectory data set is selected as the reference column for data deduplication, and the data is sorted by the license plate number column. The trajectory data with duplicate license plate numbers are deleted, and only the first row of data is retained.

[0133] Compared with the existing technology, this method of GPS trajectory data section flow matching based on network coding has higher section accuracy and calculation efficiency, as follows:

[0134] (1) Road section accuracy

[0135] Since the matching basis adopted by the present invention is a three-level grid, and the weighted distance between points and lines is not used as the basis for matching, in theory, there will be a situation where continuous trajectory points and matching sections do not overlap. In order to more accurately describe the accuracy of the present invention, a section accuracy index is established. The section accuracy refers to the percentage of correctly matched sections to the total number of sections. If the matched road and trajectory points overlap and the road direction is consistent with the trajectory forward direction, the match is considered correct. The calculation method is shown in Formula 6.

[0136]

[0137] Among them, Accuracy is the accuracy of the road section, Num a To match the correct number of road segments, Num all is the total number of matching road segments.

[0138] The existing map matching algorithm uses a commonly used geometric algorithm, the weighted map matching algorithm of the fusion direction, as a comparison. Among them, the map matching algorithm based on the maximum weight is to obtain the vehicle matching section through the calculation and weight screening of indicators such as direction similarity through several stages of noise reduction, segmentation, compression, nearby road retrieval, matching and combined segmentation. The vehicle trajectory data is selected to calculate the accuracy of the section of the weighted map matching algorithm of the fusion direction and the map matching algorithm involved in the present invention. The results of some vehicles are shown in Table 5.

[0139] Table 5 Comparison of the accuracy of the weighted map matching algorithm with fusion direction and the GPS trajectory data segment flow matching method based on network coding

[0140] Beijing AAP*** Beijing ADM*** Beijing ALX*** BeijingAWP*** Weight algorithm for fusion direction 93.40% 92.90% 89.60% 95.20% Algorithms based on trellis coding 100% 99.40% 97.90% 99.20%

[0141] As can be seen from Table 5, the weighted algorithm in the fusion direction and the algorithm based on grid coding involved in the present invention both have high accuracy, but the algorithm based on grid coding has higher accuracy. In actual matching, the weighted algorithm in the fusion direction will still retain and match the offset data, resulting in a relatively low accuracy.

[0142] (2) Computational efficiency

[0143] The existing map matching algorithm uses a commonly used geometric algorithm, the weighted map matching algorithm with fusion direction, as a comparison. Although this method can complete trajectory matching well, the vertical foot position, vertical distance, trajectory and road network angle all require complex calculations. This method takes an average of about 5 minutes to complete the trajectory matching of a vehicle.

[0144] The method for matching the traffic flow of GPS trajectory data sections based on network coding of the present invention is adopted. The trajectory matching is performed by completely gridding the road network, that is, adopting a three-level gridding method. After experiments, the time distribution diagram is as follows: Figure 2 As shown, the horizontal axis is the time interval (unit: seconds), and the vertical axis is the number of vehicles (unit: vehicle). Figure 2 The corresponding time distribution ratio diagram is as follows Figure 3 As shown, it can be seen that 94% of the vehicles can complete trajectory matching within 10 seconds. This method has high computational efficiency and can meet project requirements in terms of time to achieve real-time rapid response.

[0145] The above describes in detail the preferred implementation of this patent, but this patent is not limited to the above implementation. Various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of this patent.

Claims

1. A method for matching road traffic of GPS trajectory data based on network coding, characterized in that: The following steps are involved: S1. Simplifying the road network. Step S1 includes the following steps: S101, obtaining road network information: preparing a road network file, the prepared road network file needs to contain information such as road network nodes, coordinates, and road section directions; S102, dividing the road network map into three levels of grids of equal size, where the grid size is determined according to the size of the road network; S103, encode the classified grids, and the encoding rules are as follows: the encoding has a total of 14 digits, the first 5 digits represent the X direction of the primary decoding, and the 6th to 10th digits represent the Y direction of the primary encoding; the 11th digit represents the X direction of the secondary encoding, and the 12th digit represents the Y direction of the secondary encoding; the 13th digit represents the X direction of the tertiary encoding, and the 14th digit represents the Y direction of the tertiary encoding; The encoding formula is based on the input longitude and latitude, and the encoding formula is as follows: Among them, min is the starting point coordinate, the starting point coordinate is (0,0); gridsize is the accuracy; lat is the longitude coordinate, lon is the latitude coordinate, min lat and min lon are the initial minimum longitude and latitude for map gridding, respectively; S104, assigning codes to all road sections, assigning a sequence to each road section, the sequence being the coding sequence of the grids that the road section passes through, sorting the sequences according to the direction of the road, and establishing two dictionaries to store the relationship between the two, the first key of the dictionary being the road section number, the value being the coding sequence, the second key of the dictionary being the coding sequence, the value being the road section number within the grid; S2, pre-processing the GPS trajectory data, in step S2, including the following steps: S201, delete null values: delete the data with null license plate, time, longitude or latitude in the GPS track data list, delete the data whose spatial location is outside the road network boundary, and sort the data in chronological order; S202, classifying and storing vehicles according to license plate numbers; S203, retaining the stop points: Filter out the continuous trajectory data (two or more) of each vehicle whose longitude and latitude remain unchanged or whose distance is less than 15 meters. When the time span of the continuous trajectory data is less than 30 minutes, only the first trajectory point is retained. Otherwise, the first trajectory data and the last trajectory data are retained, and the two trajectory data are labeled as stop points (trajectory points where the vehicle position remains unchanged for a period of time, and the vehicle may be in a stop state at this time) so that they will not be deleted in the subsequent deduplication operation; S204, delete abnormal data: delete points with abnormal time and speed, calculate the distance and time difference between adjacent coordinate points, and then divide the distance by the time difference to get the speed. If the speed is greater than 34 meters per second, the latter point is regarded as a data abnormality and deleted. If the speed is less than 8 meters per second and the time difference is greater than 600 seconds, the vehicle is regarded as stopped and the latter point is deleted. S205, looping steps S203 and S204 for each vehicle to obtain pre-processed trajectory data; S3, matching road sections according to the grid where the vehicle trajectory point is located, each matching road section is connected to form multiple trajectory segments, and step S3 includes the following steps: S301, matching a grid according to the longitude and latitude of the trajectory point, and adding a column to the original data for storing the code of the matching grid; S302, adjacent track point deduplication: determine whether the grid codes of adjacent track points are consistent. If they are consistent, only the first track point is retained, and duplicate values ​​of adjacent tracks are deleted by a deduplication function. The deduplication function expression is as follows: Deduplication(Code list )=Dedupl(Code(code1,code2,code3…codes))=Code list {code1,code2,…codes} Among them, Dedupl() is the deduplication function, Code(code1,code2,…coden) is the set of adjacent trajectory points, Code list It is the trajectory point that is finally retained after deduplication; S303, obtaining all road sections in the grid corresponding to the trajectory point through the dictionary 2 in step S104 as a set of candidate road sections for the trajectory point; S304, performing deletion determination on all the trajectory points obtained in step S303, with a determination step length of 3 and a forward step length of 1 for each determination; S305, constructing a trajectory segment set, which is initially an empty set and is used to store the determination result of step S306; S306, the candidate road segment set of the adjacent trajectory points in the result of S304 is retained and determined, the determination step is 2, if the determination is passed, it is stored in the trajectory road segment set constructed in step S305, and the corresponding relationship between the trajectory point and the candidate road segment is established, if the determination is not passed, it stops and goes to step S307; the first determination stores the candidate road segments that meet the conditions of the first trajectory point and the second trajectory point in the trajectory road segment set, the second determination object is the second trajectory point and the third trajectory point, at this time, the candidate road segment of the second trajectory point is already in the trajectory road segment set, and only the candidate road segment that meets the conditions of the third trajectory point is added, and so on, the object of each subsequent determination is actually the last trajectory point in the trajectory road segment set and its adjacent trajectory points that are not in the set; S307, when step S306 is judged not to pass, the trajectory data is segmented, that is, the current trajectory point is considered as the end point of the path; at the same time, the next trajectory point is considered as the starting point of the new path, and the process goes to step S305; S4. In step S3, multiple track segment sets are obtained, and segments that can connect adjacent track segments are searched within a range of 5 kilometers. If there are multiple track segments for the same batch of track points, each track segment will be connected to the previous track segment and the next track segment, and finally multiple complete tracks are formed; S5, select the shortest complete trajectory in step S4 as the final matching trajectory, query the node longitude and latitude of the added road segments in step S3 and step S4 and the grid code of the nodes according to the road network relationship, use the nodes to fill in the missing trajectory points, ensure that all road segments have a corresponding relationship with the trajectory points, and finally assign time; S6. By looping steps S3 to S5 for each vehicle, the spatial correspondence between the trajectory points of each vehicle and the road section and the time when the vehicle appears on each road section are obtained; all the obtained vehicle trajectory data are classified and stored according to the road section number to obtain the trajectory data set corresponding to each road section, and then the trajectory data set is further divided according to the time requirement of the collection to obtain the trajectory data set divided by road section and time period, and the trajectory data are deduplicated. The amount of data after deduplication is the flow rate of the road section in the time period.

2. A method for matching road traffic of GPS trajectory data based on network coding according to claim 1, characterized in that: In step S103, the values ​​of the first-level to third-level grid precision gridsize are set to 0.01, 0.002, and 0.0004, respectively.

3. The method for matching road section flow of GPS trajectory data based on network coding according to claim 1, characterized in that: In step S304, the rules for determining whether to delete the track points are as follows: When the candidate road segment candidate sets corresponding to adjacent trajectory points are exactly the same, the road segment set of the next trajectory point is deleted. The formula is as follows: Dedpul{Point1[way1,way2,way3],Point2[way1,way2,way3]}={[Point1, Point2][way1,way2,way3]} Among them, Dedpul{} is the deduplication function, Point1[way1,way2,way3], Point2[way1,way2,way3] are two adjacent trajectory points with the same corresponding candidate road segment set. This data set is considered to be repeated entry of trajectory point data, and [Point1,Point2][way1,way2,way3] is the trajectory point obtained after deduplication; When the road segment sets of two trajectory points separated by one trajectory point are exactly the same, it is considered that the separated trajectory points are offset and deleted. The formula is as follows: Dedpul{Point1[way1,way2,way3],Point2[way4,way5],Point3[way1,way2,way3]}={[Point1,Point3][way1,way2,way3],Point2[way4,way5]} Among them, Dedpul{} is the deduplication function, Point1[way1,way2,way3], Point3[way1,way2,way3] are two trajectory points with the same corresponding candidate road segment set and the interval distance is one trajectory point apart. This data set is considered to be duplicate data entry caused by trajectory point offset, and [Point1,Point3][way1,way2,way3] is the trajectory point obtained after deduplication.

4. The method for matching road section flow of GPS trajectory data based on network coding according to claim 1, characterized in that: In step S306, the rule for determining the road segment to be retained is: when the same road segment exists in the candidate road segment set of adjacent trajectory points, the same road segment is retained. At this time, the road segment already exists in the trajectory road segment set and does not need to be added; When there are different road segments, the connectivity between the road segments is determined. If the road segments are connected, they are retained and the retained road segment set is added to the trajectory road segment set.

5. A method for matching road section flow of GPS trajectory data based on network coding according to claim 4, characterized in that: The rules for determining the connectivity between road segments are as follows: S3061, there are a starting section a and an ending section b, first determine whether the two sections have an intersection, if yes, determine whether the intersection of section a and section b is the starting point of a and the end point of b, if yes, section a cannot reach section b, and the determination ends; If there is no intersection, store the road section a in the candidate road section set and continue with the following steps; S3062, each time, it is only necessary to search for the next connected road segment of the last road segment in the candidate road segment set. If there is a connected road segment, the road segment is added to the corresponding candidate road segment set; if there are two connected road segments, two candidate road segment sets are generated, and the connected road segments are stored separately, and so on. The storage rule formula is as follows; Candidate waylist1 =[way1,way2] Candidate waylist2 =[way3,way4] Intersection{Candidate waylist1 ,Candidate waylist2 }= {[PointCode1,PointCode2],[[way1,way3],[way2,way3]]} Among them, Intersection{} is the function for judging connectivity, Candidate waylist is the stored judgment result, PointCode is the trajectory point code, [way1,way2], [way3,way4], [way1,way3], [way2,way3] are the stored start and end sections; After all candidate road segments have been processed, go to step S3063; S3063, eliminating candidate road sections similar to the road section {1,2,3,1}, which will be judged as alternating main and auxiliary roads; S3064. To prevent the connectivity judgment time from being too long, the number of segments in the candidate segment set is set to 8. When the number of candidate segment sets is 8 and no feasible route has been found, the two segments are considered unreachable; if they are reachable, the candidate segment set is added to the trajectory segment set.

6. The method for matching road section flow of GPS trajectory data based on network coding according to claim 1, characterized in that: In step S5, the calculation rule for the time assigned to the missing trajectory point is: the distance between the trajectory point to be filled and the previous trajectory point is divided by the speed of the previous trajectory point to obtain the time difference between the two trajectory points, and the time of the previous trajectory point plus the time difference is the time of the filled trajectory point; The calculation formula is as follows: T 缺失轨迹点 =T 上一轨迹点 +S / V 上一轨迹点 Where, T 缺失轨迹点 is the time of missing trajectory points, T 上 A trajectory point is the time of the previous trajectory point, S is the distance between the missing trajectory point and the previous trajectory point, V 上一轨迹点 is the velocity of the previous trajectory point.

7. The method for matching road traffic of GPS trajectory data based on network coding according to claim 1, characterized in that: In step S6, the trajectory data deduplication rule is: take the license plate number as the unique identification of the vehicle, select the license plate number column in the trajectory data set as the reference column for data deduplication, sort by the license plate number column, delete the trajectory data with duplicate license plate numbers, and only retain the first row of data.