A vehicle path fitting method and device based on road network topology
Patent Information
- Application Number
- CN202311587605.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-11-24
AI Technical Summary
[0004]鉴于此,本发明实施例提供了一种基于路网拓扑结构的车辆路径拟合方法及装置,以消除或改善现有技术中存在的一个或多个缺陷,解决现有技术难以在车辆通行交易计费过程中对缺失的在途数据进行准确拟合且响应较慢的问题
本发明所述基于路网拓扑结构的车辆路径拟合方法及装置,通过引入全网路网拓扑结构,辅助路径拟合过程,实现在多省跨区通行的复杂路况条件下,对缺失的在途数据进行准确的拟合。引入针对在途数据轨迹点的多种异常检测,提升路径拟合的准确性。在途轨迹序列和全网路网拓扑结构同时记录真实收费单元和虚拟收费单元,并对路径进行拟合,提升了拟合精度和准确性。
Smart Images

Figure CN117912126B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of highway toll technology, and in particular to a vehicle path fitting method and apparatus based on road network topology. Background Technology
[0002] Currently, highway toll collection generally uses ETC (Electronic Toll Collection) for transactions. With the advancement of integration, highway traffic is characterized by longer single-trip distances, higher toll amounts, more inter-provincial travel, and ever-increasing traffic volume. While building ETC gantries to fully cover the road network can record vehicle behavior through the ETC system and other equipment, recording systems such as gantries are frequently affected by factors like equipment, weather, and network issues. This leads to frequent billing failures due to anomalies such as data writing failures, license plate obstruction / misuse, and malicious toll evasion.
[0003] Meanwhile, with the surge in people's travel demand, traffic congestion, especially at toll stations, is frequent. One of the reasons for this is the failure to exit the station due to missing vehicle trajectories. Therefore, there is an urgent need for a reasonable algorithm that can accurately fit the vehicle's trajectory when the vehicle is missing, in order to improve the success rate of online billing and alleviate traffic problems caused by billing anomalies. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a vehicle path fitting method and apparatus based on road network topology to eliminate or improve one or more defects in the prior art, and solve the problem that the prior art is difficult to accurately fit missing on-the-way data and has a slow response in the process of vehicle passage transaction billing.
[0005] One aspect of the present invention provides a vehicle path fitting method based on road network topology, the method comprising the following steps: Obtain the path fitting request message of the target vehicle, and extract the in-transit trajectory sequence from the path fitting request message; the in-transit trajectory sequence includes the real toll units that participate in billing and the virtual toll units that do not participate in billing traversed by the target vehicle. Obtain the latest network topology structure based on the current day; the network topology structure is a directed connected graph that records the connectivity relationships, connection path mileage information, and charging amounts between all real charging units and virtual charging units that do not participate in billing within the target block. In the directed connected graph, nodes are used to mark charging units and virtual units, edges are used to mark the connectivity relationships between nodes, and the weight of the edges is used to mark the total number of hops between real and virtual charging units traversed by the Dijkstra shortest path between nodes. Adjacent trajectory points in the in-transit trajectory sequence are extracted sequentially according to time order. Anomaly detection is performed on each pair of adjacent trajectory points according to the network topology, and abnormal trajectories are removed. The anomaly detection includes at least: handling of duplicate trajectory anomalies, handling of opposing trajectory anomalies, and handling of spatiotemporal anomalies. Based on the network topology, the missing trajectory points of adjacent trajectory points in the trajectory sequence are detected, and a preset algorithm is used to fill in the missing points when they exist. After all adjacent trajectory points in the in-transit trajectory sequence have undergone anomaly detection, missing trajectory point detection and filling, the connectivity of the in-transit trajectory sequence is verified according to the network topology, virtual points are removed to obtain the final fitted path, and a fitted message is generated according to the path fitting format.
[0006] In some embodiments, before obtaining the latest network topology based on the current day, the method further includes: The server synchronizes the latest static road network basic data from the database at a specified time point based on a scheduled task. The static road network basic data includes at least lane information, toll unit information, virtual unit information, connectivity between toll units and virtual units, and mileage information within the target block area. Establish numbers and indexes for each charging unit and each virtual unit, and save them to a static index file; Based on the latitude and longitude location information of the gantries corresponding to each toll collection unit and each virtual unit, save the location information of each toll collection unit and each virtual unit as a static file. Distinguish between the corresponding charging units and virtual units for each charging unit and save them as static files containing the corresponding unit information. Based on a preset tool, a directed connected graph of the entire road network topology is established according to the static road network basic data, the index static file, the location information static file, and the opposing unit information static file.
[0007] In some embodiments, synchronizing the latest static road network infrastructure data from the database at a specified time point includes: Delete static road network basic data older than the current first set time period; If the latest static road network data for the day includes data from the first set time period to the second set time period prior, then an incremental update is performed; otherwise, a full update is performed. The static road network basic data is stored in JSON format.
[0008] In some embodiments, the spatiotemporal anomaly handling includes: For adjacent first trajectory points and second trajectory points, calculate the distance based on the position information of the first trajectory point and the second trajectory point; Obtain the actual travel time difference between the target vehicle and the second trajectory point recorded in the on-the-way trajectory sequence; Calculate the standard time difference between the first trajectory point and the second trajectory point at a preset speed; If the actual travel time difference is zero, the subsequent trajectory points are eliminated. Alternatively, if the actual travel time difference is greater than the standard time difference and the difference is greater than the first threshold, the subsequent trajectory points are removed. Alternatively, if the quotient of the actual travel time difference and the standard time difference is greater than the second threshold, the subsequent trajectory points are removed.
[0009] In some embodiments, missing trajectory points are detected among adjacent trajectory points in the on-the-go trajectory sequence according to the overall network topology, and a preset algorithm is used to fill in the missing points when they exist, including: Verify the total number of hops between adjacent trajectory points in the real and virtual toll units, and mark them as three states: disconnected, adjacent and connected, and connected but not adjacent. For disconnected states, directly generate fitting failure information; for adjacent connected states, directly output the path. For connected but not adjacent states, when the total number of hops is less than the third threshold, a depth-first search algorithm is used to fill in the missing trajectory points according to the minimum number of hops; when the total number of hops is greater than or equal to the third threshold, an A-star Algorithm algorithm is used to fill in the missing trajectory points according to the minimum number of hops algorithm.
[0010] In some embodiments, the first threshold is 3 hours, the second threshold is 10, and the third threshold is 18.
[0011] In some embodiments, connectivity verification of the in-transit trajectory sequence is performed based on the network topology, including: generating and returning fitting failure information when there are cases where adjacent trajectory points are not connected.
[0012] In some embodiments, removing virtual points to obtain the final fitted path and generating a fitted message according to the path fitting format includes: Initialize an empty path sequence S; Retain the entire trajectory sequence S1 from the entrance station to the first actual toll unit e and add it sequentially to the path sequence S; Retain the entire trajectory sequence S2 from the exit station to the first preceding real toll unit f and add it sequentially to the path sequence S; Remove all virtual toll units between the real toll unit e and the real toll unit f to obtain the trajectory sequence S3 and add it to the path sequence S to obtain the final fitted path.
[0013] On the other hand, the present invention also provides a vehicle path fitting device based on road network structure, including a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the above method.
[0014] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0015] The beneficial effects of the present invention are at least as follows: The vehicle path fitting method and apparatus based on road network topology described in this invention introduces the entire road network topology to assist the path fitting process, enabling accurate fitting of missing on-the-road data under complex road conditions involving multi-province and cross-regional travel. Multiple anomaly detection methods for on-the-road data trajectory points are introduced to improve the accuracy of path fitting. The on-the-road trajectory sequence and the entire road network topology simultaneously record both real and virtual toll collection units, and the path is fitted accordingly, further enhancing the fitting precision and accuracy.
[0016] Furthermore, the entire network topology is updated based on scheduled tasks to ensure the accuracy of the network data and prevent deviations in path fitting.
[0017] Furthermore, by distinguishing the number of missing hops between adjacent trajectory points, the depth-first search algorithm or the A-star algorithm is adaptively selected to fill in the missing trajectory points, thereby improving the accuracy of path fitting.
[0018] Furthermore, by removing virtual charging units, the amount of data can be reduced and response speed can be improved.
[0019] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.
[0020] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings: Figure 1 This is a flowchart illustrating the construction of a road network topology and basic data according to an embodiment of the present invention.
[0022] Figure 2 This is a flowchart illustrating the process of fitting a vehicle trajectory based on a request message, as described in another embodiment of the present invention.
[0023] Figure 3 This is a flowchart illustrating a vehicle path fitting method based on road network topology according to an embodiment of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0025] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0026] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0027] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0028] With the rapid development of computer science and continuous technological progress, various machine learning algorithms have been widely applied in various fields of transportation, including path fitting tasks. Currently used machine learning path fitting algorithms mainly include time-series prediction methods based on historical navigation data and methods based on traffic camera video data to assist in vehicle path reconstruction. However, both models have their own drawbacks. Time-series prediction models ignore environmental factors and assume that the observed time series repeats periodically, resulting in poor performance in handling long-term time dependencies. Methods based on traffic camera video data to assist in vehicle trajectory reconstruction rely on video data in addition to transaction data; uneven image quality and the sparsity of traffic cameras significantly impact path fitting results. Furthermore, considering the actual highway traffic volume and the magnitude of the requested fitting data, the path fitting algorithm must support concurrent requests and respond within 1 second, achieving a fitting success rate of at least 99.9% while ensuring connectivity. The two methods mentioned above cannot guarantee path connectivity or adequately meet the concurrent processing requirements of a 1-second response. Therefore, a new path fitting algorithm is urgently needed to achieve more accurate path fitting while meeting business needs.
[0029] Specifically, the present invention provides a vehicle path fitting method based on road network topology, the method comprising the following steps S101~S105: Step S101: Obtain the path fitting request message of the target vehicle, and extract the in-transit trajectory sequence from the path fitting request message; the in-transit trajectory sequence includes the real toll units that participate in billing and the virtual toll units that do not participate in billing that the target vehicle travels through.
[0030] Step S102: Obtain the latest network topology structure based on the current day; the network topology structure is a directed connected graph that records the connectivity relationships, connection path mileage information, and charging amounts between all real charging units and virtual charging units that do not participate in billing within the target block. Nodes in the directed connected graph are used to mark charging units and virtual units, edges are used to mark the connectivity relationships between nodes, and the weight of the edges is used to mark the total number of hops between real and virtual charging units traversed by the Dijkstra shortest path between nodes.
[0031] Step S103: Extract adjacent trajectory points in the trajectory sequence in chronological order, and perform anomaly detection on each pair of adjacent trajectory points according to the network topology and remove abnormal trajectories; the anomaly detection includes at least: handling of duplicate trajectory anomalies, handling of opposing trajectory anomalies and handling of spatiotemporal anomalies.
[0032] Step S104: Based on the network topology, detect missing trajectory points among adjacent trajectory points in the trajectory sequence. If missing points exist, use a preset algorithm to fill in the missing points.
[0033] Step S105: After anomaly detection, missing trajectory point detection and filling are completed for all adjacent trajectory points in the in-transit trajectory sequence, the connectivity of the in-transit trajectory sequence is verified according to the network topology, virtual points are removed to obtain the final fitted path, and a fitted message is generated according to the path fitting format.
[0034] In step S101, there can be multiple target vehicles during actual operation. This invention processes the on-route trajectory sequences of multiple concurrent target vehicles in parallel to improve response speed. Based on the ETC transaction model, during the passage of a target vehicle on the highway, the toll collection unit (i.e., the roadside unit, RSU) writes information about the toll collection units it has passed to the on-board unit (OBU). The toll collection unit is installed on the gantry system and reads and writes data to the on-board unit through a transaction antenna. In this embodiment, the on-route trajectory sequence is used to record the real and virtual toll collection units passed by the target vehicle. For the segmented toll collection model, the real toll collection unit is used for toll transactions, and the virtual toll collection unit is used to write the interactive data generated during passage. Furthermore, to ensure data integrity, the on-route trajectory sequence includes identification information, timestamps, transaction fees, and transaction status of the real and virtual toll collection units passed.
[0035] In step S102, the overall network topology is the latest data for the target block. In this embodiment, to adapt to the needs of actual applications, the target block can be set to the entire domestic region. In other application scenarios, it can also be set to a specific province or sub-region as needed.
[0036] In some embodiments, before obtaining the latest network topology based on the current day, steps S1021 to S1025 are further included: Step S1021: The server synchronizes the latest static road network basic data from the database at a specified time point based on a scheduled task. The static road network basic data includes at least lane information, toll unit information, virtual unit information, connectivity relationships between toll units and virtual units, and mileage information within the target block area.
[0037] Step S1022: Establish the numbers and indexes for each charging unit and each virtual unit, and save them to the static index file; Step S1023: Based on the latitude and longitude location information of the gantry corresponding to each toll collection unit and each virtual unit, save the location information of each toll collection unit and each virtual unit as a static file.
[0038] Step S1024: Distinguish between the corresponding charging units and virtual units for each charging unit and save them as a static file of corresponding unit information.
[0039] Step S1025: Based on the preset tools, establish a directed connected graph of the entire road network topology according to the static road network basic data, index static file, location information static file and opposite unit information static file.
[0040] Figure 1 The process for building the latest network topology and related basic data daily involves: synchronizing all data on toll collection units, toll collection unit connectivity, toll gantries, and toll plazas from the database and saving it as a static file. Using all toll collection units as vertices and toll collection unit connectivity as edges, and employing Dijkstra's algorithm to calculate the shortest path between toll collection units as edge weights, a directed connected graph of toll collection units is constructed using an adjacency matrix, serving as the network topology. Based on the relationship between toll collection units and gantries, the gantry latitude and longitude are used as the toll collection unit latitude and longitude. For toll collection units acting as collection points, the toll plaza latitude and longitude are used as the toll collection unit latitude and longitude. These are then merged to generate the final toll collection unit latitude and longitude information. Based on the corresponding names of toll collection units, they are segmented according to opposite directions, up / down directions, and other fixed characters. Toll collection units with the same name are saved as reverse toll collection unit pairs. This process completes the collection and construction of the network topology and related basic data, and the results are uploaded to object storage services.
[0041] In some embodiments, step S1021, synchronizing the latest static road network basic data from the database at a specified time point, includes: deleting static road network basic data older than a first set time period; if the latest static road network basic data contains data from the first set time period to a second set time period, then performing an incremental update; otherwise, performing a full update; preferably, the first set time period is 15 days, and the second set time period is 10 days. Further, the static road network basic data is stored in JSON format.
[0042] In step S103, Figure 2 The diagram illustrates the implementation flow of the path fitting algorithm: The path sequence, i.e., the toll unit sequence, is extracted from the path fitting request message according to time. 1≤i≤N, where N represents the total number of toll unit sequences in the current message, and two adjacent toll units are taken sequentially. For a given pair of chargeable units, where 1 ≤ i ≤ N-1, the first step is to use an exception handling module to determine if the current pair of chargeable units is duplicated. If they are not equal, then it is further determined whether they are opposing units. If they are not opposing units, the distance D between them is calculated based on the GPS information corresponding to the two toll units. Assuming an average speed of 80 km / h, the average travel time T = D / 80 is calculated, and the distance is extracted. The time difference is T', which is the actual time elapsed between two toll units. If T-T'>3, T' / T>10, or T=0, it is considered a spatiotemporal anomaly. Once the above anomaly detection is successful, the anomaly is removed, and the process returns to the toll unit sequence to continue taking adjacent toll unit pairs and repeating the above anomaly detection process.
[0043] In some embodiments, spatiotemporal anomaly handling includes steps S1031 to S1036: Step S1031: For adjacent first trajectory points and second trajectory points, calculate the distance based on the position information of the first trajectory points and the second trajectory points.
[0044] Step S1032: Obtain the actual travel time difference between the first and second trajectory points recorded in the on-the-way trajectory sequence for the target vehicle.
[0045] Step S1033: Calculate the standard time difference between the first trajectory point and the second trajectory point at a preset speed.
[0046] Step S1034: If the actual travel time difference is zero, remove the subsequent trajectory points.
[0047] Alternatively, in step S1035: if the actual travel time difference is greater than the standard time difference and the difference is greater than the first threshold, the subsequent trajectory points are removed. In some embodiments, the first threshold is 3h.
[0048] Alternatively, in step S1036: if the quotient of the actual travel time difference and the standard time difference is greater than the second threshold, the subsequent trajectory points are removed. In some embodiments, the second threshold is 10.
[0049] In steps S104-S105, after anomaly detection is completed or if there are no anomalies in the current charging unit, then according to... Figure 1 The system uses the road network topology to determine if there are missing toll units and calculates their length. If the missing length is greater than 18, it is defined as a long-term missing anomaly, and the A-star Algorithm (A* algorithm) is used to fill the missing points according to the road network topology. Conversely, if the length is less than 18, it is defined as a short-term missing anomaly, and the Depth-First Search (DFS) algorithm is used to fill the missing points according to the topology. This process is repeated until i=N-1, i.e., the last toll unit pair is obtained. Finally, the sequence after anomaly handling and path filling is verified again by the road network topology to check if it conforms to road network connectivity. If it does, then... Figure 1The obtained virtual toll unit information is used to remove virtual toll units from the current sequence, and the final sequence is returned as the successful path fitting result. Otherwise, a fitting failure message is returned directly.
[0050] In some embodiments, in step S104, missing trajectory points are detected among adjacent trajectory points in the trajectory sequence based on the overall network topology, and a preset algorithm is used to fill in the missing points when they exist, including steps S1041 to S1043: Step S1041: Check the total number of hops between adjacent trajectory points in real and virtual toll units, and mark them as three states: disconnected, adjacent connected, and connected but not adjacent.
[0051] Step S1042: For disconnected states, directly generate fitting failure information; for adjacent connected states, directly output the path.
[0052] Step S1043: For connected but not adjacent states, when the total number of hops is less than the third threshold, the depth-first search algorithm is used to fill in the missing trajectory points according to the minimum number of hops; when the total number of hops is greater than or equal to the third threshold, the A-star Algorithm algorithm is used to fill in the missing trajectory points according to the minimum number of hops algorithm. The third threshold is 18.
[0053] In some embodiments, step S105 involves performing connectivity verification on the on-the-way trajectory sequence based on the network topology, including generating and returning fitting failure information when there are cases where adjacent trajectory points are not connected.
[0054] In some embodiments, step S105 involves removing virtual points to obtain the final fitted path and generating a fitted message according to the path fitting format, including steps S1051 to S1054: Step S1051: Initialize an empty path sequence S.
[0055] Step S1052: Retain the entire trajectory sequence S1 from the entrance station to the first real toll unit e and add it sequentially to the path sequence S.
[0056] Step S1053: Retain the entire trajectory sequence S2 between the exit station and the first preceding real toll unit f and add it sequentially to the path sequence S.
[0057] Step S1053: Remove all virtual toll units between real toll unit e and real toll unit f to obtain trajectory sequence S3 and add it to path sequence S to obtain the final fitted path.
[0058] On the other hand, the present invention also provides a vehicle path fitting device based on road network structure, including a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the above method.
[0059] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0060] The present invention will now be described with reference to a specific embodiment: This embodiment provides a vehicle path fitting method based on road network topology, specifically a precise vehicle trajectory path fitting algorithm service that detects abnormal trajectories in vehicle on-the-go data and accurately fills in trajectory points based on the national expressway road network topology.
[0061] Based on the basic data of the entire expressway network, the network road topology and basic data are constructed. Based on the above topology and basic data, the on-the-way data of the requested path fitting is processed by the anomaly detection module to handle abnormal trajectory points, and then the missing trajectory filling algorithm is used to generate a complete trajectory path. After the generated complete trajectory is checked for connectivity and virtual trajectory points are removed, the final fitted path is returned to provide support data for disputed tolling paths.
[0062] The aforementioned basic data for the entire highway network includes: toll station data and toll plaza data nationwide, mainly containing GPS location information and lane information for toll stations; gantry data, mainly containing basic gantry information and its relationship with toll units; toll unit data; basic information of the minimum tolling segment; toll unit connectivity data, mainly containing adjacent connectivity relationships and mileage information between toll units; virtual toll units; toll unit information nodes that do not participate in tolling; opposing toll units; toll unit pairs that are mutually up and down; and toll unit GPS information, extracted from the corresponding gantries and toll plazas of the toll units. The aforementioned network topology is constructed based on toll units and their connectivity relationships, using the minimum number of toll units required to maintain connectivity between any two toll units as the minimum hop count as the edge weight, to construct a directed connectivity graph of toll units across the entire network. The aforementioned in-transit data consists of real vehicle travel trajectory records recorded by the ETC system or other devices. The aforementioned anomaly detection module processes in-transit data whether each pair of adjacent toll unit trajectory points are duplicate trajectory points, opposing trajectory points, or spatiotemporally abnormal trajectory points. The missing trajectory completion algorithm involves supplementing trajectory points based on the minimum number of hops required for connectivity between any two adjacent trajectory points in the topology after anomaly handling. Different completion algorithms are used depending on the number of missing trajectory points. The connectivity verification involves determining the connectivity between any two adjacent points in the generated fitted path based on the topology; if any two points are not adjacent and connected, the fitting fails. The virtual trajectory removal algorithm involves deleting trajectory points belonging to virtual nodes from the generated path based on whether the toll collection units in the road network data are virtual nodes, thus obtaining the final vehicle-fitted path.
[0063] The steps for implementing the basic data and topology of the expressway are as follows: Step 1.1: Set up a scheduled task on the server to synchronize all data from the database in the charging unit table, charging unit connectivity table, charging plaza table, and gantry information table every morning and save it as a static file on the server. Alternatively, the daily updated data can be saved as a JSON file in shared memory according to the date.
[0064] Step 1.2: Based on the basic data of the charging units, generate the mapping relationship between the charging unit number (id) and the index (idx), and between the index (idx) and the charging unit number (id). Let the total number of charging units be N, and the index idx ∈ {0,1,…,N-1}. Based on the charging unit connectivity relationship, remap the charging unit connectivity relationship (idxi,idxj) using the index idx, and save all charging unit connectivity relationships to a static file.
[0065] Step 1.3: According to the relationship between toll units and gantries, obtain the longitude and latitude of the gantry corresponding to the toll unit as the longitude and latitude data of the current toll unit. For a toll unit collected by a toll station on its behalf, obtain the longitude and latitude of the toll plaza as the longitude and latitude data of the current toll unit, then obtain the longitude and latitude data of all toll units and save it as a toll unit GPS static file.
[0066] Step 1.4: Split the road names corresponding to toll units, and take toll units with the same name after removing separators as opposite-direction toll unit pairs, and save them as a static file.
[0067] Step 1.5: Using the networkx tool, with all toll units as vertices, wherein, , 0<i<N; take the connectivity relationship between toll units as edges , that is, two connected toll units ; take Dijkstra single-source shortest path as edge weights, construct a directed connected graph and save the graph as an adjacency matrix as the road network topology.
[0068] Step 1.6: Starting from step 1.2 above, if the basic data already exists 10 days before the current date, repeat the above steps, but perform incremental update in data processing. Upload the static files generated by full or incremental update and the topology of the entire network of expressways to the Object Storage Service (OBS), and complete the construction of expressway basic data and topology.
[0069] The implementation steps of the anomaly detection algorithm are as follows: Step 2.1: Download the latest road network topology and basic data from OBS.
[0070] Step 2.2: For the original message of requested path fitting, extract the path sequence, which is the toll unit sequence, in chronological order, where the first toll unit is taken as the entrance station and the last toll unit is taken as the exit station.
[0071] Step 2.3: Repeated trajectory processing: sequentially take two adjacent trajectory points, determine whether the last trajectory point has been reached, if yes, return the processed path sequence; otherwise, determine whether the two trajectory points belong to the same toll unit, if they belong to the same toll unit, remove the latter trajectory point, and repeat step 2.3.
[0072] Step 2.4: Handling Anomalies in Reverse Trajectories: Retrieve the information of the reverse tolling units from the basic data, and sequentially retrieve adjacent trajectory points from the path sequence returned in 2.3. Determine whether the adjacent trajectory points are reverse tolling units. If they are, remove the reverse tolling units according to the path direction. If not, determine whether to enable the spatiotemporal verification environment variable. If enabled, start Step 2.5; otherwise, repeat Step 2.4 until all trajectories have been traversed and the processed path sequence is returned, then start Step 3.1.
[0073] Step 2.5: Obtain the GPS latitude and longitude information of the tolling units from the basic data. Calculate the distance D between the two tolling units based on the latitude and longitude. Simultaneously, obtain the time difference T between the two tolling units in the request message. If the time T=0, it is judged as a spatiotemporal anomaly, and the subsequent trajectory points are removed. Repeat Step 2.3. Otherwise, calculate the average time T'=D / 80 between the two tolling units at an average speed of 80km / h. If T'-T>3h (empirical value, statistically, the mileage data of 6 / 100000 adjacent tolling units is within 240km), it is judged as a spatiotemporal anomaly, and the subsequent trajectory points are removed. Repeat Step 2.4. Otherwise, if T' / T>10, it is judged as a spatiotemporal anomaly, and the subsequent trajectory points are removed. Repeat Step 2.4.
[0074] The missing trajectory filling algorithm described above: Step 3.1: Obtain the adjacency matrix of toll units, i.e., the road network structure, from the basic data. Sequentially obtain the adjacent trajectory points of the path sequence returned in 2.4. If the last path trajectory point has been obtained, return the processed path sequence; otherwise, continue to step 3.2.
[0075] Step 3.2: Determine whether a trajectory point is missing based on the minimum hop count between two trajectory points in the adjacency matrix. If the value is 1, it indicates that they are adjacent to the toll unit, and repeat step 3.1. If the value is 0, return the fitting failure information directly. If the value is >1, it indicates that there is a missing point between the two trajectory points. The length of the missing point, i.e., the minimum hop count, is the corresponding value of the two trajectory points in the adjacency matrix. Start step 3.3.
[0076] Step 3.3: If the missing length is less than 18 hops, use the Depth-First Search (DFS) algorithm to fill in the missing trajectory points between the two points using the minimum number of hops. Otherwise, use the A* algorithm to fill in the missing trajectory points using the minimum number of hops. Repeat step 3.1.
[0077] The connectivity verification and virtual node removal implementation steps are as follows: Step 4.1: Connectivity Validation: For the path sequence after anomaly handling and trajectory completion, verify the connectivity relationship based on the adjacency matrix of toll units in the basic data. Take two adjacent trajectories in turn to verify whether they are connected. If they are connected, repeat step 4.1 until the last trajectory point. Otherwise, return the fitting failure information directly.
[0078] Step 4.2: Virtual Node Removal: Initialize an empty path sequence S. For the path sequences that passed the verification in Step 4.1, retain all trajectory sequences S1 between the entry station and the first non-virtual toll unit e, and add S1 to S in sequence. Retain all trajectory sequences S2 between the exit station and the preceding first non-virtual toll unit f. Based on the basic information of virtual toll units, remove all virtual toll units from trajectory point e to trajectory point f to obtain trajectory sequence S3. Append S3 to S, then append S2 to S. Generate the fitted message according to the path fitting format and return a fitting success message.
[0079] The key feature of this invention is that it introduces the national road network topology into the path fitting task to ensure that the final fitting result meets the online billing connectivity verification. Under the condition that the road network topology and response data are correct, a 100% fitting success rate can be achieved. Moreover, the path fitting algorithm used is more efficient than the machine learning-based path fitting algorithm and supports high concurrency processing.
[0080] This method is based on computer science algorithms and application programming interface (API) techniques, and its implementation requires a certain level of programming, algorithm, and operations and maintenance knowledge. The specific real-time implementation consists of two parts. The first part is deployed on a Linux server using a combination of Crontab scheduled tasks, Python scripts, Bash scripts, and Object Storage Service (OBS). The Crontab is set to execute a Bash script at a fixed time each day. The Bash script executes the Python script, which constructs the road network topology and related basic data and saves it to OBS. The second part is the path fitting API service, implemented using the Django framework and written in Python scripts. It provides external API services and is deployed on the Linux server via a Docker Nginx container.
[0081] This invention also provides a computer device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or other means.
[0082] The processor can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0083] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the button blocking method of the vehicle display device in this embodiment of the invention. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory.
[0084] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0085] The one or more modules are stored in the memory, and when executed by the processor, they perform the method described in this embodiment.
[0086] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
[0087] In summary, the vehicle path fitting method and apparatus based on road network topology described in this invention, by introducing the entire road network topology to assist the path fitting process, achieves accurate fitting of missing on-the-road data under complex road conditions involving multi-province and cross-regional travel. Multiple anomaly detection methods for on-the-road data trajectory points are introduced to improve the accuracy of path fitting. The on-the-road trajectory sequence and the entire road network topology simultaneously record both real toll collection units participating in billing and virtual toll collection units not participating in billing, further enhancing the fitting precision and accuracy.
[0088] Furthermore, the entire network topology is updated based on scheduled tasks to ensure the accuracy of the network data and prevent deviations in path fitting.
[0089] Furthermore, by distinguishing the number of missing hops between adjacent trajectory points, the depth-first search algorithm or the A-star algorithm is adaptively selected to fill in the missing trajectory points, thereby improving the accuracy of path fitting.
[0090] Furthermore, by removing virtual charging units, the amount of data can be reduced and response speed can be improved.
[0091] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.
[0092] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0093] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0094] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A vehicle path fitting method based on road network topology, characterized in that, The method includes the following steps: Obtain the path fitting request message of the target vehicle, and extract the in-transit trajectory sequence from the path fitting request message; the in-transit trajectory sequence includes the real toll units that participate in billing and the virtual toll units that do not participate in billing that the target vehicle travels through; Obtain the latest network topology structure based on the current day; the network topology structure is a directed connected graph that records the connectivity relationships, connection path mileage information, and charging amounts between all real charging units and virtual charging units that do not participate in billing within the target block. In the directed connected graph, nodes are used to mark charging units and virtual units, edges are used to mark the connectivity relationships between nodes, and the weight of the edges is used to mark the total number of hops between real and virtual charging units traversed by the Dijkstra shortest path between nodes. Adjacent trajectory points in the in-transit trajectory sequence are extracted sequentially according to time order. Anomaly detection is performed on each pair of adjacent trajectory points according to the network topology, and abnormal trajectories are removed. The anomaly detection includes at least: handling of duplicate trajectory anomalies, handling of opposing trajectory anomalies, and handling of spatiotemporal anomalies. Based on the network topology, the missing trajectory points in the in-travel trajectory sequence are detected, and a preset algorithm is used to fill in the missing points when they exist. After all adjacent trajectory points in the in-transit trajectory sequence have undergone anomaly detection, missing trajectory point detection and filling, the in-transit trajectory sequence is subjected to connectivity verification according to the network topology, and virtual points are removed to obtain the final fitted path and a fitted message is generated according to the path fitting format. The spatiotemporal anomaly processing includes: for adjacent first and second trajectory points, calculating the distance based on the position information of the first and second trajectory points; obtaining the actual travel time difference of the target vehicle passing through the first and second trajectory points recorded in the on-the-road trajectory sequence; calculating the standard time difference of traveling through the first and second trajectory points at a preset speed; if the actual travel time difference is zero, removing the subsequent trajectory point; or, if the actual travel time difference is greater than the standard time difference and the difference is greater than a first threshold, removing the subsequent trajectory point; or, if the quotient of the actual travel time difference and the standard time difference is greater than a second threshold, removing the subsequent trajectory point. Based on the network topology, missing trajectory points are detected in adjacent trajectory points of the in-travel trajectory sequence. When missing points exist, a preset algorithm is used to fill them in, including: checking the total number of hops between adjacent trajectory points in the real and virtual toll units, and marking them as disconnected, adjacent and connected, and connected but not adjacent; for disconnected states, fitting failure information is directly generated, and for adjacent and connected states, the path is directly output; for connected but not adjacent states, when the total number of hops is less than a third threshold, a depth-first search algorithm is used to fill in the missing trajectory points according to the minimum number of hops; when the total number of hops is greater than or equal to the third threshold, the A-starAlgorithm algorithm is used to fill in the missing trajectory points according to the minimum number of hops algorithm.
2. The vehicle path fitting method based on road network topology according to claim 1, characterized in that, Before obtaining the latest network topology based on the current day, the following steps are also included: The server synchronizes the latest static road network basic data from the database at a specified time point based on a scheduled task. The static road network basic data includes at least lane information, toll unit information, virtual unit information, connectivity between toll units and virtual units, and mileage information within the target block area. Establish numbers and indexes for each charging unit and each virtual unit, and save them to a static index file; Based on the latitude and longitude location information of the gantries corresponding to each toll collection unit and each virtual unit, save the location information of each toll collection unit and each virtual unit as a static file. Distinguish between the corresponding charging units and virtual units for each charging unit and save them as static files containing the corresponding unit information. Based on a preset tool, a directed connected graph of the entire road network topology is established according to the static road network basic data, the index static file, the location information static file, and the opposing unit information static file.
3. The vehicle path fitting method based on road network topology according to claim 2, characterized in that, Synchronize the latest static road network basic data from the database at the specified time point, including: Delete static road network basic data older than the current first set time period; If the latest static road network data for the day includes data from the first set time period to the second set time period prior, then perform an incremental update; otherwise, perform a full update. The static road network basic data is stored in JSON format.
4. The vehicle path fitting method based on road network topology according to claim 1, characterized in that, The first threshold is 3 hours, the second threshold is 10, and the third threshold is 18.
5. The vehicle path fitting method based on road network topology according to claim 1, characterized in that, Based on the entire network topology, connectivity verification is performed on the in-transit trajectory sequence, including: When there are cases where adjacent trajectory points are not connected, a fitting failure message is generated and returned.
6. The vehicle path fitting method based on road network topology according to claim 1, characterized in that, Virtual points are removed to obtain the final fitted path, and a fitted message is generated according to the path fitting format, including: Initialize an empty path sequence S; Retain the entire trajectory sequence S1 from the entrance station to the first actual toll unit e and add it sequentially to the path sequence S; Retain the entire trajectory sequence S2 from the exit station to the first preceding real toll unit f and add it sequentially to the path sequence S; Remove all virtual toll units between the real toll unit e and the real toll unit f to obtain the trajectory sequence S3 and add it to the path sequence S to obtain the final fitted path.
7. A vehicle path fitting device based on road network structure, comprising a processor and a memory, characterized in that, The memory stores computer instructions, and the processor executes the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Path fitting method and device for expressway transaction
CN113742394A
Trajectory information processing method and system based on epidemiological investigation
CN117038101A