Differentiated road matching method based on T-Box data and GeoHash index
By using the combination of GeoHash index and the HMM model and topological relationship in the road matching algorithm, the problem of low road matching stability in the existing technology is solved, and more efficient and accurate road matching is achieved.
Patent Information
- Application Number
- CN202510019575.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-08
AI Technical Summary
The prior art has problems such as low stability and easy to mismatch in road matching algorithms, especially in complex road conditions.
Using a differentiated road matching method based on T-Box data and GeoHash index, the speed and accuracy of searching road network data is optimized by establishing a GeoHash index and road network connection relationship database, and differentiated road matching is performed in combination with the HMM model and topological relationship.
It improves the speed and accuracy of road matching, ensures the accuracy and efficiency of matching, and is suitable for different driving states of commercial vehicles.
Smart Images

Figure CN119782444A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spatial information technology, and in particular to a differentiated road matching method based on T-Box data and GeoHash index. Background Art
[0002] In the context of the rapid development of big data and smart cars, many commercial vehicles collect massive amounts of vehicle operation data with the help of T-box devices. Benefiting from the popularization of GPS technology and the improvement of data storage and processing capabilities, these data can be processed efficiently. Research on commercial vehicle road matching can effectively manage and optimize the driving routes of these vehicles, and at the same time provide a data basis for more smart car analysis functions, providing a solution to key issues such as improving transportation efficiency, reducing energy consumption and environmental pollution.
[0003] The current road network matching algorithms and their shortcomings are as follows:
[0004] 1. Geometric matching algorithm: Starting from the geometric level, the GPS trajectory and the road network data are compared by distance or similarity to select a better route. The algorithm is simple and easy to implement, but the stability is not high and it is easy to cause wrong matching.
[0005] 2. Matching algorithm based on topological relationship: Based on geometric matching, the topological relationship of the road is considered. It is easily affected by noise and data sparsity, and is prone to mismatching under complex road conditions.
[0006] 3. Matching algorithm based on probability statistics: By adding a confidence region to the trajectory, the optimal result is calculated on a standard; adding fuzzy logic ideas, the error model is defined by the description of membership functions and candidate roads; using Kalman filtering, by analyzing the support of each candidate road section after Kalman filtering, the road section with the highest support is finally selected; using Bayesian reasoning, using multiple hypothesis technology (MHT) to generate measurement values for all sections within the confidence interval, and then calculating the probability value based on the topological relationship. The algorithm has good real-time and stability, but it is prone to errors and will affect subsequent matching in the absence of an initial matching method.
[0007] 4. Map matching algorithm based on hidden Markov model: Search the road network data, judge the trajectory points point by point, establish the hidden Markov model to solve, and select the optimal path. It is sensitive to map quality and resolution, easy to fall into the local optimal solution, and sensitive to the initial state and state transition assumptions.
[0008] 5. R* index-based matching algorithm: Use the R* algorithm to index the road network data to speed up the search of the map. The rules for building the index are relatively complex, and may show a lower index building and query speed for large-scale road network data. Summary of the invention
[0009] The purpose of the present invention is to provide a differentiated road matching method based on T-Box data and GeoHash index, which optimizes the speed and accuracy of searching road network data by establishing GeoHash index and road network connection relationship database, and improves the speed and accuracy of map matching.
[0010] To achieve the above object, the present invention provides a differentiated road matching method based on T-Box data and GeoHash index, comprising the following steps:
[0011] Step 1: Continuously collect T-Box data through the vehicle-mounted T-Box device;
[0012] Step 2: Create a GeoHash index for the road network data and perform a connection relationship index;
[0013] Step 3: Vehicle T-box data preprocessing;
[0014] Step 4: Perform differentiated road matching based on the HMM model and topological relationship respectively.
[0015] Optionally, in step 1, a real-time connection is established with the vehicle's control system via the CAN bus to ensure that the T-Box can continuously and accurately collect and transmit the vehicle's data, and transmit the data to the vehicle's control center or cloud platform via the on-board data transmission module for data storage and processing.
[0016] Optionally, in step 2, the national road network data is indexed using 7-bit GeoHash encoding to generate a GeoHash index file. In the process of processing the road network data connection relationship, the roads of the road network data are traversed to find other roads that intersect with the road path, and they are recorded in sequence to obtain a connection relationship file for topology matching.
[0017] Optionally, the execution process of step 3 includes the following steps:
[0018] Step 3.1: Segment the trips for data with a time difference of more than 10 minutes;
[0019] Step 3.2: Clean the data based on rules;
[0020] Step 3.3: Perform data segmentation based on the gear reference value;
[0021] Step 3.4: Use GeoHash to convert the vehicle's GPS longitude and latitude information based on the WGS-84 standard into GeoHash-encoded location information to form an alternative road set containing alternative roads for each vehicle trajectory point.
[0022] Optionally, the gear reference value is a reference value of the vehicle gear position at each trajectory point of the vehicle, which is calculated by corresponding engine speed and vehicle speed.
[0023] Optionally, in step 4, all trajectory segments are traversed, and the trajectory segments processed based on the HMM model are solved using the Viterbi algorithm.
[0024] Optionally, when performing topological relationship matching in step 4, the Fréchet distance and sliding window are used to measure the matching degree of the road segment sequence.
[0025] The present invention provides a differentiated road matching method based on T-Box data and GeoHash index. First, the national road network data is indexed by GeoHash index, and the real-time parameters of commercial vehicles are continuously collected. Different road matching methods are used for different states of commercial vehicles. When the vehicle is in high-speed stable driving, the road matching based on topological relationship is used. The remaining sections use the HMM model for road matching. Further, in the specific optimization matching, when the HMM matches the highway or national highway and the speed remains stable for a period of time, the matching is based on the topological relationship and the direction angle. When the vehicle speed changes, it is changed to HMM matching. The present invention divides the trajectory according to the vehicle gear reference value and uses different algorithms for processing at the same time, which not only ensures the accuracy of the matching, but also improves the efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 It is a schematic flow chart of the steps of a differentiated road matching method based on T-Box data and GeoHash index of the present invention.
[0028] Figure 2 It is a schematic diagram of the process of establishing a GeoHash index in the present invention.
[0029] Figure 3 It is a schematic diagram of the algorithm components of the trajectory segment for path processing of the present invention. DETAILED DESCRIPTION
[0030] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0031] See also Figure 1 The present invention provides a differentiated road matching method based on T-Box data and GeoHash index, comprising the following steps:
[0032] S1: Continuously collect T-Box data through the vehicle-mounted T-Box device;
[0033] S2: Create a GeoHash index for the road network data and perform a connection relationship index;
[0034] S3: vehicle T-box data preprocessing;
[0035] S4: Differentiated road matching is performed based on the HMM model and topological relationship respectively.
[0036] The present invention is further described below in conjunction with the implementation steps:
[0037] The execution process of step S1 includes the following steps:
[0038] S1.1 Install a T-Box device in the vehicle, which can collect vehicle status data in real time. The T-Box device is connected to the vehicle electronic system through the vehicle communication system to obtain the following data:
[0039] Information collection time, positioning status, longitude and latitude, cumulative mileage, instrument speed, direction angle, accelerator pedal opening, engine net output torque, engine speed, friction torque, atmospheric pressure, engine fuel flow, engine coolant temperature, fuel tank level, engine torque mode, and cumulative fuel consumption.
[0040] S1.2 is connected to the vehicle's control system in real time via the CAN bus, ensuring that the T-Box can continuously and accurately collect and transmit vehicle data.
[0041] S1.3 T-Box data is transmitted to the vehicle's control center or cloud platform through the vehicle's onboard data transmission module (such as Wi-Fi or LTE module) for data storage and processing.
[0042] Step S2 is the road network data processing process, which is as follows:
[0043] S2.1 Road network data index
[0044] GeoHash is a method of encoding a geographic location as a string. It divides the earth into multiple rectangular areas and assigns a unique string identifier to each area. It is commonly used for location-based personalized services, such as finding people nearby. Unlike longitude and latitude, which represent an exact location on a map, GeoHash represents an area, and all points in the area correspond to the same GeoHash value. For the scenario addressed by the present invention, it is necessary to find road path points around vehicle trajectory points and select alternative routes. GeoHash is a very suitable indexing method.
[0045] When performing GeoHash encoding on a geographic coordinate, first calculate the binary codes of longitude and latitude respectively, and then cross-combine the codes of longitude and latitude according to the rule of "starting from the 0th bit, longitude in even bits and latitude in odd bits" to obtain a complete binary code.
[0046] The binary encoding method is based on the idea of binary division: first determine the initial interval, longitude is [-180°, +180°], latitude is [-90°, +90°], split the initial interval in half to get the left half interval and the right half interval, and determine the binary code of the current bit based on whether the longitude or latitude of the target location falls in the left interval or the right interval, with the left interval taking 0 and the right interval taking 1. Then perform recursive processing, divide the subinterval where the target location is located in the previous step in half, and calculate the binary code of the next bit in the same way until the expected GeoHash length is reached.
[0047] Divide the binary code into groups of five, calculate the decimal value of each group of binary codes and use it as an index to find the corresponding value in the BASE32 code table. Finally, concatenate these values together to get the GeoHash value.
[0048] The present invention uses GeoHash to process the national road network data respectively. GeoHash takes 7 bits, and its minimum frame size is a square with a side length of 152.7m.
[0049] The process of creating an index is as follows: Figure 2 The algorithm shown performs:
[0050] In the flowchart, the algorithm obtains the road network information from the file and creates a word-type (word-type in Python, map type in Java) variable to temporarily store the index information.
[0051] S2.2 Network data connection relationship processing
[0052] Traverse the roads in the road network data, find other roads that intersect with the road path (have common path points), record them in sequence, and obtain a connection relationship file for topology matching.
[0053] Step 3 includes the following process:
[0054] S3.1 Since the present invention can process vehicle T-box data for a week, a month or multiple months, the data must first be segmented into trips, and the data with a time difference of more than 10 minutes will be segmented into trips.
[0055] S3.2 Clean the data based on rules:
[0056] • For the points at the very beginning and end of a journey where the longitude and latitude remain unchanged (points with a speed of 0), only keep the last and first points; if the longitude and latitude of the GPS point set in the journey remain basically unchanged for more than 3 minutes, only keep one point.
[0057] • If the GPS direction value is abnormal, it will be replaced and interpolated. If the direction angle changes by more than 90° within 1 second, it will be considered abnormal data and the average value will be interpolated based on the upper and lower data.
[0058] • If the vehicle speed exceeds 150km / h, it will be treated as abnormal data. The distance can be calculated based on the longitude and latitude of the front and rear points, and the speed can be supplemented by the distance and time difference. If the vehicle speed is still abnormal, it will be deleted directly.
[0059] • When the instrument speed is not 0 but the longitude and latitude remain unchanged, it may be that the vehicle is passing through a tunnel. In this case, the longitude and latitude are interpolated.
[0060] • If the GPS position is abnormal and the difference between the previous and next points reaches 1km, it will be deleted.
[0061] S3.3 Data segmentation based on gear reference value
[0062] Calculate a reference value of the vehicle gear position at each vehicle trajectory point.
[0063] Here we refer to the gearbox gear reduction ratio, and the calculation formula is as follows:
[0064]
[0065] In the formula, is the calculated gear ratio of the gearbox, is the engine speed, is the tire diameter, is the vehicle speed, Main reduction ratio.
[0066] Since the tire diameter of each vehicle is different, the main reduction ratio of each model in the platform is different, so the engine speed / instrument speed is used as the reference value of the vehicle gear. The higher the gear, when the vehicle speed is 0, this value is -1.
[0067] Calculate the stable value of the reference value when the vehicle is running stably, select multiple trajectory points with a speed greater than 65km / h, round the reference values of these points to the nearest integer, and take the mode to obtain the stable value of the reference value for this vehicle.
[0068] For the set of continuous points whose gear reference value is less than its stable value + σ (σ is 2 here), segmentation is performed and marked as "topology algorithm processing", and the other trajectory segments are "HMM processing". When segmenting, in order to facilitate the accuracy of the initial point of the HMM algorithm processing in the middle segment, the front end of the middle "HMM processing" segment intercepts 1 minute of trajectory information. After processing, the path will be divided into roughly Figure 3 of the trajectory segment.
[0069] S3.4 uses GeoHash to convert the GPS latitude and longitude information of the vehicle based on the WGS-84 standard into GeoHash-encoded location information, so as to quickly obtain the alternative road information and form an alternative road set containing the alternative roads of each vehicle track point. Here, the road information stored in its 7-bit GeoHash index and its surrounding 8 indexes is obtained.
[0070] Step S4 is the differentiated road matching process, which traverses all trajectory segments. Those marked as "HMM processing" are solved using the Viterbi algorithm, and those marked as "topology algorithm processing" are processed using the topology algorithm.
[0071] S4.1HMM algorithm matching
[0072] For the HMM algorithm, first describe its observation probability matrix:
[0073] Calculate the observation probability associated with its distance, using a Gaussian distribution:
[0074]
[0075] Indicates observation point Match to its Candidate points The observation probability associated with the distance To match the The state of the candidate point, is the great circle distance between the two, is the mean, is the standard deviation.
[0076] Calculate the observation probability related to its direction angle. At this time, it is necessary to obtain whether it is a one-way or two-way road in the road network information. For a one-way road:
[0077]
[0078] For observation point Match to its Candidate points The angle of the direction angle.
[0079] For two-way roads:
[0080]
[0081]
[0082] is the opposite direction of the direction angle, For observation point Match to its Candidate points The angle of the direction angle.
[0083] Calculate the observation probability related to its direction angle, and Gaussian distribution is also used here:
[0084]
[0085] Indicates observation point Match to its Candidate points The observation probability associated with the direction angle is To match the The state of the candidate point, is the mean, is the standard deviation.
[0086] The observation probability matrix of integrated distance and direction angle information:
[0087]
[0088] For observation point Match to its Candidate points The observation probability of and Used to adjust the weights of distance and direction angle respectively.
[0089] Describe its state transfer matrix:
[0090]
[0091]
[0092] For observation point Match to Candidate points status, For observation point Match to the kth candidate point status, For observation point and The great circle distance, Candidate point and The shortest path length, is the absolute median difference.
[0093] Use the Viterbi algorithm and perform operations according to the recursive formula:
[0094]
[0095] For observation point Match to the kth candidate point When there is no next observation point, find the state with the highest probability from all the candidate points of the last point, and get the optimal matching sequence of the entire trajectory by step-by-step backtracking.
[0096] S4.2 Topology Matching
[0097] Topological matching is performed based on the road connection relationship obtained in S2.2. Here, the Fréchet distance and sliding window are used to measure the matching degree of the road sequence.
[0098] 1. Obtain the trajectory points in the sliding window, find the alternative roads of the vehicle trajectory points in the window from the alternative road set obtained in S3.4, and obtain the connected path according to the road connection relationship;
[0099] 2. Calculate the Fréchet distance between the trajectory and the alternative path in the sliding window, and select the one with the shortest distance as the matching result.
[0100] The sliding window is a method that uses a fixed-length window to traverse data at a fixed moving speed. The sliding window continuously selects a fixed-length data set to perform a matching algorithm to find the road with the closest Fréchet distance from the candidate roads. There are two important parameters in the sliding window method, namely the window size and the moving step length. The window size and the moving step length are calculated based on the data vehicle data sampling frequency. The number of sampling points in 1 minute is selected as the window size, and the moving step length is half of the window size.
[0101] The Fréchet distance is a metric used to measure the similarity between two curves. It considers the distance between points while also focusing on the overall shape and direction of the two curves, and is suitable for describing global features. and , and are two reparameterized functions, is the time point at which the two curves are and The sampling points are and , then the curve and The Fréchet distance is:
[0102]
[0103] Points on the curve and The great circle distance between is the maximum distance under this sampling, Based on and The difference between the two samples gives the infimum of a set of maximum distances.
[0104] In summary, the present invention has the following beneficial effects:
[0105] 1. Use GeoHash to index road network information to speed up the screening of alternative roads.
[0106] 2. The trajectory is segmented according to the vehicle gear reference value and processed using different algorithms. It is suitable for driving scenarios and working conditions of commercial vehicles, which not only ensures the accuracy of matching, but also improves the efficiency of the algorithm.
[0107] What is disclosed above is only one or more preferred embodiments of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and making equivalent changes according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A differentiated road matching method based on T-Box data and GeoHash index, characterized in that: The following steps are involved: Step 1: Continuously collect T-Box data through the vehicle-mounted T-Box device; Step 2: Create a GeoHash index for the road network data and perform a connection relationship index; Step 3: Vehicle T-box data preprocessing; Step 4: Perform differentiated road matching based on the HMM model and topological relationship respectively.
2. The differentiated road matching method based on T-Box data and GeoHash index as claimed in claim 1, characterized in that: In step 1, the CAN bus is used to connect to the vehicle's control system in real time to ensure that the T-Box can continuously and accurately collect and transmit the vehicle's data, and transmit it to the vehicle's control center or cloud platform through the on-board data transmission module for data storage and processing.
3. The differentiated road matching method based on T-Box data and GeoHash index as claimed in claim 2, characterized in that: In step 2, the 7-bit GeoHash code is used to index the national road network data and generate a GeoHash index file. In the process of processing the connection relationship of the road network data, the roads of the road network data are traversed to find other roads that intersect with the road path, and they are recorded in sequence to obtain a connection relationship file for topological matching.
4. The differentiated road matching method based on T-Box data and GeoHash index as claimed in claim 3, characterized in that: The execution process of step 3 includes the following steps: Step 3.1: Segment the trips for data with a time difference of more than 10 minutes; Step 3.2: Clean the data based on rules; Step 3.3: Perform data segmentation based on the gear reference value; Step 3.4: Use GeoHash to convert the vehicle's GPS longitude and latitude information based on the WGS-84 standard into GeoHash-encoded location information to form an alternative road set containing alternative roads for each vehicle trajectory point.
5. The differentiated road matching method based on T-Box data and GeoHash index as claimed in claim 4, characterized in that: The gear reference value is a reference value of the vehicle gear position at each trajectory point of the vehicle, and is obtained by calculating the corresponding engine speed and vehicle speed.
6. The differentiated road matching method based on T-Box data and GeoHash index as claimed in claim 5, characterized in that: In step 4, all trajectory segments are traversed, and the trajectory segments processed based on the HMM model are solved using the Viterbi algorithm.
7. The differentiated road matching method based on T-Box data and GeoHash index as claimed in claim 6, characterized in that: When performing topological relationship matching in step 4, the Fréchet distance and sliding window are used to measure the matching degree of the road segment sequence.