E-police checkpoint and road network space matching method based on editing distance
Through the edit distance-based method, the problem of spatial offset between the latitude and longitude information of the electric alarm bayonet equipment and the road network is solved, and a more accurate matching and more efficient calibration process is achieved.
Patent Information
- Application Number
- CN202510249621.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-20
AI Technical Summary
The latitude and longitude information of the electric alarm bayonet equipment has a spatial offset from the road network, and the existing calibration methods are low in accuracy and huge in workload.
Using an edit distance-based method, the spatial matching of the electric alarm mount and the road network is achieved by generating sets to be selected, building a Chinese label generation model for the road network, calculating the edit distance and constructing a judgment function.
It improves the matching accuracy of the electric alarm checkpoint equipment with the road network, reduces the error matching rate, saves time and reduces labor workload.
Smart Images

Figure CN120179747A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geographic information processing, and particularly relates to a method for spatially matching an electronic police checkpoint and a road network based on the edit distance. Background Art
[0002] An electronic police checkpoint is a common electronic police device, generally installed at the entrance and exit of a road, automatically detecting the status and information of passing vehicles, and can be used for vehicle violations, road traffic flow status assessment, etc. After the electronic police checkpoint device is installed by the device manufacturer, the name and longitude and latitude information of the device will be pre-stored in the database. For real-time vehicle passing data, it will be automatically detected and stored in real-time.
[0003] However, the following problems are found in the process of analyzing the data of the electronic police checkpoint. There is a spatial offset between the longitude and latitude information of the electronic police checkpoint device and the road network, and it is impossible to automatically associate the vehicle information detected by the electronic police checkpoint with the road network. The existing common practices include: directly spatially associating with the nearest road through the longitude and latitude information, or manually checking through the device name or navigation street view. These two checking methods have problems of low accuracy or huge manual workload. Summary of the Invention
[0004] In order to solve the problem that there is a spatial offset between the longitude and latitude information of the electronic police checkpoint device and the road network, and the existing calibration methods have low accuracy and huge workload, the present invention provides a method for spatially matching an electronic police checkpoint and a road network based on the edit distance. The method includes the following steps:
[0005] S1: Generate a candidate set based on the spatial position of the electronic police checkpoint device;
[0006] S2: Construct a Chinese label generation model for the road network according to the candidate set, and generate Chinese labels for the road network;
[0007] S3: Calculate the edit distance between the Chinese labels of the road network and the electronic police checkpoint device;
[0008] S4: Use the edit distance to construct a judgment function to obtain the best matching result.
[0009] Further, S1 is specifically: Select the road intersection points with a distance less than d centered on the longitude and latitude of the electronic police checkpoint device as the candidate selection set.
[0010] Further, in the main urban area, d is taken as 3 to 5 km, and in the suburbs, d is taken as 5 to 8 km.
[0011] Further, in S2, the Chinese labels of the road network include: a first-level label generated according to the position relationship and a second-level label generated according to the district, county and village information.
[0012] Further, S3 specifically includes:
[0013] S31: Traverse the Chinese labels in the road network in S2, perform word segmentation matching with the names of bayonet devices, and select the Chinese labels of the road network that can be effectively matched;
[0014] S32: Use the edit distance algorithm to calculate the edit distance between the effectively matched Chinese labels of the road network and the electronic police bayonet devices.
[0015] Further, in S4, the judgment function is:
[0016]
[0017] where L i represents the link number of the i-th link to be matched; S k represents the k-th electronic police bayonet device; e k,i represents the edit distance from the electronic police bayonet device k to the i-th link; n represents that there are n links to be matched in the candidate set; len k represents the character length of the Chinese label of the bayonet device; d k,i represents the spatial distance from the electronic police bayonet device k to the i-th link; σ is a judgment threshold, and its value range is 0.5 to 0.8.
[0018] The present invention has the following beneficial effects compared with the prior art:
[0019] 1. By considering various information such as road names, intersection nodes, and spatial ranges, the present invention generates first-level and second-level road labels, and combines edit distance calculation to select the best-matched road, which can more accurately associate electronic police bayonet devices to the road network and reduce the error matching rate.
[0020] 2. The present invention uses edit distance to calculate the distance between the Chinese labels of different combinations and the Chinese description of the electronic police bayonet device, and selects the road with the shortest distance as the result, which can quickly and effectively complete the matching process and save time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flowchart of a method for spatial matching between an electronic police bayonet and a road network according to the present invention;
[0022] Figure 2 is a spatial relationship diagram between an electronic police bayonet and a road network. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] Example 1: In combination with Figure 1 This example is described to illustrate a method for spatial matching between an electronic police bayonet and a road network based on edit distance. The method includes the following steps:
[0024] S1: Generate a set of candidates based on the spatial location of the traffic police checkpoint equipment;
[0025] S2: Construct a Chinese label generation model for the road network based on the set of candidates, and generate Chinese labels for the road network;
[0026] S3: Calculate the edit distance between the Chinese labels of the road network and the traffic police checkpoint equipment;
[0027] S4: Use the edit distance to construct a judgment function to obtain the best matching result.
[0028] Specifically, S1 is as follows: Select road intersection points within a distance less than d centered on the longitude and latitude of the traffic police checkpoint equipment as the set of candidates for matching.
[0029] In the main urban area, d is taken as 3 to 5 km, and in the suburbs, d is taken as 5 to 8 km.
[0030] Specifically, the purpose of S1 is to reduce the amount of computation and prevent the interference of roads with the same name at ultra-long distances on the judgment result.
[0031] In S2, the Chinese labels of the road network include: primary labels generated according to the positional relationship and secondary labels generated according to the information of districts, counties, villages, etc.
[0032] Specifically, in the process of constructing the Chinese label generation model for the road network, first, centered on the longitude and latitude of the traffic police checkpoint equipment, search for all road intersections within a certain range. Then traverse these intersections and match them with the associated roads. According to the relationship between the road name, endpoints, and the longitude and latitude of the intersection nodes, generate primary road labels (such as "Road A", "Road B"), and search for relevant information such as districts, counties, villages, etc. within the range of this road to construct secondary labels of spatial subordination (such as "near a certain road", "a certain district or county"). Combine Figure 2 For example:
[0033] Taking intersection node 5 as the set of candidates, generate Chinese labels for roads 2-5, 4-5, 1-5, and 3-5 in sequence. Taking road 5-2 as an example, according to the road associated with intersection node 5, Chinese labels (Road A, Road B) can be generated. According to the longitude and latitude coordinates of node 5 and node 2, the direction of the road can be determined.
[0034] Assume the longitude and latitude of node 5 is (x0, y0), and the longitude and latitude coordinates of node 2 is (x1, y1). Taking O(0, 0) as the origin coordinate, the vector and
[0035]
[0036] Use the arccosine function to calculate the vector Included angle θ:
[0037]
[0038] θ = arccosθ
[0039] Judge the road direction label of road 5-2 according to the size of θ:
[0040]
[0041] Therefore, according to the intersection association relationship and geographical information coordinates, the first-level Chinese label (A Road, B Road, west to east, west entrance) of road 5-2 can be generated.
[0042] Combined with the road name, road grade, district or county where it is located, street, community, etc., the second-level label (expressway, S district, C street, E community, near F road, etc.) can be generated.
[0043] S3 specifically includes:
[0044] S31: Traverse the Chinese labels of the road network described in S2, perform word segmentation matching with the names of bayonet devices, and select the Chinese labels of the road network that can be effectively matched;
[0045] S32: Use the edit distance algorithm to calculate the edit distance between the effectively matched Chinese labels of the road network and the electronic police bayonet device.
[0046] Specifically, the edit distance algorithm is an algorithm for calculating the similarity between strings. By calculating the edit distance between the Chinese labels after different combinations and the Chinese descriptions of the electronic police bayonet devices, the road closest to the device location is determined. Word segmentation processing can improve the matching accuracy, and selecting relevant labels and combined calculations can further optimize the matching results.
[0047] Among them, the edit distance is the minimum number of edits required to transform one character into another string. The editing process includes: inserting characters, deleting characters, and replacing characters. Its calculation uses the dynamic programming method, and the process is as follows:
[0048] Assume that the edit distance between strings a and b is lev a,b (|a|, |b|), where |a| and |b| correspond to the lengths of a and b respectively, then there is:
[0049] lev a,b (i, j) = max(i, j)
[0050] ifmin(i,j)=0mina,b(i-1,j)+1leva,b(i,j-1)+1leva,b(i-1,j-1)+1ai≠ajotherwise
[0051] Among them, lev a,b (i, j) represents the distance between the first i characters in a and the first j characters in b; when min(i, j) = 0, corresponding to the first i characters in string a and the first j characters in string b, at this time, one of i and j has a value of 0, indicating that one of string a and b is an empty string. Then, it only needs to perform max(i, j) single-character editing operations to convert from a to b. Therefore, its edit distance is max(i, j), that is, the maximum value of i and j.
[0052] When min(i, j) ≠ 0, lev a,b (i, j) is the minimum value of the following three cases:
[0053] lev a,b (i - 1, j) represents deleting a i ;
[0054] lev a,b (i, j - 1) represents inserting b j ;
[0055] represents replacing b j ;
[0056] is an indicator function, which takes 0 when a i = a j and takes 1 when a i ≠ a j at other times.
[0057] In S4, the judgment function is:
[0058]
[0059] Among them, L i represents the i-th link number to be matched; S k represents the k-th traffic police checkpoint device; e k,i represents the edit distance from the traffic police checkpoint device k to the i-th link; n represents that there are n links to be matched in the candidate set; len k represents the character length of the Chinese label of the checkpoint device; d k,i represents the spatial distance from the traffic police checkpoint device k to the i-th link; σ is a judgment threshold, and its value range is from 0.5 to 0.8.
[0060] Specifically, first, the text similarity between each checkpoint device and the road to be matched is evaluated by calculating the edit distance. Second, the spatial distance feature is obtained based on the shortest distance between the longitude and latitude of the checkpoint device and the road node. Then, a judgment function is constructed, combining the edit distance and the spatial distance feature to determine the best-matched road. The specific formula comprehensively considers the edit distance and the spatial distance to calculate the matching score, and determines the best matching result according to the score.
[0061] Although the present invention has been described in terms of a limited number of embodiments, those skilled in the art of this technology will appreciate that other embodiments can be contemplated within the scope of the invention as thus described. In addition, it should be noted that the language used in this specification has been principally selected for readability and instructional purposes and not for the purpose of explaining or limiting the subject matter of the invention. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. For the scope of the present invention, the disclosure of the present invention is illustrative, not restrictive, and the scope of the present invention is defined by the appended claims.
Claims
1. A method for spatial matching of electronic police checkpoints and road networks based on edit distance, characterized in that: The method comprises the following steps: S1: Generate a candidate set based on the spatial location of the electronic police checkpoint equipment; S2: constructing a road network Chinese label generation model according to the set to be selected, and generating a road network Chinese label; S3: Calculate the edit distance between the Chinese label of the road network and the electronic police checkpoint device; S4: constructing a judgment function using the edit distance to obtain the best matching result.
2. According to the method of claim 1, the method is characterized by: S1 is specifically: selecting the road intersection points with the latitude and longitude of the electric police checkpoint equipment as the center and the distance less than d as the selection set to be matched.
3. According to the method of claim 2, the method is characterized by: In the main urban area, d is 3 to 5 km, and in the suburbs, d is 5 to 8 km.
4. According to the method of claim 1, the method is characterized by: In S2, the Chinese labels of the road network include: primary labels generated according to location relationships and secondary labels generated according to district, county and village information.
5. According to the method of claim 1, the method is characterized by: S3 specifically includes: S31: traverse the Chinese labels of the road network in S2, perform word segmentation matching with the name of the checkpoint device, and select the Chinese labels of the road network that can be effectively matched; S32: Use an edit distance algorithm to calculate the edit distance between the Chinese labels of the road network that can be effectively matched and the electronic police checkpoint equipment.
6. The method for spatial matching of electronic police checkpoints and road networks based on edit distance according to claim 1 is characterized in that: In S4, the judgment function is: Among them, L i Indicates the link number of the i-th link to be matched; S k represents the kth electronic police checkpoint device; e k,i represents the edit distance from the electronic police card device k to the i-th link; n represents that the set to be selected contains a total of n links to be matched; len k Indicates the character length of the Chinese label of the card slot device; d k,i It represents the spatial distance from the electronic police checkpoint device k to the i-th link; σ is the judgment threshold, which ranges from 0.5 to 0.8.