Urban traffic flow real-time modeling method and system based on ETC payment data
By constructing vehicle trajectory chains from ETC payment data and comparing them with road network topology, weaving traffic flows can be identified and decomposed into traffic flows with multiple behavioral patterns. This solves the problem of inaccurate traffic flow modeling caused by GPS signal interference and enables more accurate traffic condition assessment.
Patent Information
- Application Number
- CN202511806873.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-17
AI Technical Summary
In complex urban interchanges, existing technologies are prone to GPS signal interference, which can cause vehicle positioning drift and make it difficult to accurately depict the short-distance rapid switching behavior of vehicles, resulting in reduced accuracy in real-time traffic flow modeling.
By acquiring ETC payment data, a vehicle trajectory chain is constructed and compared with the short-distance weaving routes defined by the road network topology. Weaving traffic flows are identified and quantified, and decomposed into through traffic flows, non-weaving merging traffic flows, and weaving traffic flows, thereby constructing a modified traffic flow model.
It improves the accuracy and depth of traffic condition assessment, enabling a more realistic reflection of the actual traffic pressure on main road sections and enhancing the ability to understand the degree and evolution trend of congestion in weaving areas.
Smart Images

Figure CN121686802A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of urban traffic flow monitoring, and in particular to a method and system for real-time modeling of urban traffic flow based on ETC payment data. Background Technology
[0002] Currently, with the acceleration of urbanization and the continuous growth of motor vehicle ownership, urban traffic congestion is becoming increasingly serious. In order to improve the operational efficiency of the transportation system and the public's travel experience, real-time traffic status perception and analysis of urban expressway networks has become crucial.
[0003] In related technologies, traffic flow modeling utilizes GPS trajectory data provided by internet-connected floating cars. This data is then incorporated into the road network through map matching algorithms, and clustering and interpolation are used to estimate the average speed and travel time of road segments. Simultaneously, data from sensors deployed on road sections (such as geomagnetic coils and microwave radar) is used to directly statistically analyze the traffic flow and occupancy of each section. Finally, models such as Kalman filtering or spatiotemporal graph neural networks are employed to fuse speed and flow data from different sources, generating a real-time traffic situation covering the entire road network.
[0004] However, when these technologies are applied to complex urban interchanges, GPS signals are susceptible to interference in multi-level elevated bridges and densely built-up areas, causing positioning drift. This leads to vehicles being incorrectly matched to adjacent or upper / lower level roads, resulting in distorted speed estimates. Simultaneously, traffic flow statistics methods based on fixed cross-sections focus on measuring the total macroscopic traffic volume passing through the cross-section, making it difficult to finely characterize the short-distance, rapid switching behavior of vehicles between ramps. When a large number of such behaviors occur, the model can only observe a decrease in mainline speed but cannot reflect the microscopic causes of this phenomenon, leading to inaccurate attribution of local congestion and reduced accuracy in real-time traffic flow modeling. Summary of the Invention
[0005] This application provides a method and system for real-time urban traffic flow modeling based on ETC payment data, which can improve the accuracy of real-time traffic flow modeling.
[0006] The first aspect of this application provides a method for real-time modeling of urban traffic flow based on ETC payment data, the method comprising: Acquire all ETC payment data within the target road network area; group the ETC payment data based on vehicle identifiers, and sort them sequentially within each group according to timestamps to obtain vehicle trajectory chains; define multiple weaving routes composed of entrance ramp gantry identifiers and exit ramp gantry identifiers based on the topology of the target road network area; compare each vehicle trajectory chain with multiple weaving routes, and classify the vehicles corresponding to the corresponding vehicle trajectory chain as weaving vehicles when a vehicle trajectory chain consists only of the entrance ramp gantry identifier and exit ramp gantry identifier corresponding to a certain weaving route; within a preset time window, count the weaving vehicles classified into each weaving route to obtain the basic weaving traffic flow of each weaving route; calculate the corrected traffic flow of the target main road segment, where the corrected traffic flow is the sum of the count value of through traffic, the count value of non-weaving merging traffic, and the basic weaving traffic flow of the weaving routes within the target main road segment; generate traffic parameters to characterize the traffic state of the target main road segment.
[0007] In the above embodiments, by constructing vehicle trajectory chains and comparing them with short-distance weaving routes defined based on road network topology, weaving traffic flows that are difficult to separate are identified and quantified. A modified traffic flow model is constructed by summing the through traffic flow, non-weaving merging traffic flow, and the quantified weaving traffic flow. This decomposes and reconstructs traffic flows with different behavioral patterns within the weaving area, thereby more realistically and comprehensively reflecting the actual traffic pressure on the target main road segment and improving the accuracy and depth of traffic condition assessment.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, within a preset time window, the basic weaving traffic flow of each weaving route is obtained by counting the weaving vehicles categorized into each weaving route, specifically including: For all weaving vehicles categorized under the same weaving route, the time difference between the entry and exit travel times is calculated to obtain the travel time of each weaving vehicle. A travel time distribution histogram is generated based on the travel time set, and the troughs of the travel time distribution histogram are identified to determine the travel time threshold. Based on the travel time threshold, the travel time set is divided into multiple travel time subsets. Each weaving vehicle under the same weaving route is categorized into the corresponding smooth flow mode, slow flow mode, or congested flow mode according to the travel time subset to which its travel time belongs. Weaving vehicles belonging to the smooth flow mode, slow flow mode, and congested flow mode are counted to obtain the smooth flow sub-weaving traffic flow, slow flow sub-weaving traffic flow, and congested flow sub-weaving traffic flow. The smooth flow sub-weaving traffic flow, slow flow sub-weaving traffic flow, and congested flow sub-weaving traffic flow are used together as the refined weaving traffic flow to characterize the weaving route status, replacing the basic weaving traffic flow.
[0009] In the above embodiments, by analyzing the travel time distribution of weaving vehicles and using trough points to dynamically determine the threshold for classifying different traffic modes, all weaving vehicles can be categorized into specific operating modes such as smooth flow, slow flow, or congestion. Ultimately, the single, vague basic flow count is decomposed into a three-dimensional sub-flow vector that clearly characterizes the internal operating state, improving the model's ability to understand the congestion level and evolution trend of weaving areas.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, after using the smooth sub-weaving traffic flow, the slow-moving sub-weaving traffic flow, and the congested sub-weaving traffic flow together as a refined weaving traffic flow characterizing the weaving route status, instead of the basic weaving traffic flow, the method further includes: Obtain the congested vehicle trajectory chains corresponding to weaving vehicles belonging to the congestion mode; determine the standard gantry sequence corresponding to the weaving route based on the topology of the target road network area; compare each congested vehicle trajectory chain with the standard gantry sequence and calculate the trajectory integrity; when the trajectory integrity is lower than the preset integrity threshold, remove the corresponding weaving vehicle from the congestion mode and reclassify it as a stationary vehicle to obtain the corrected congestion mode; count the weaving vehicles belonging to the corrected congestion mode to obtain the corrected congestion sub-weaving traffic flow, which replaces the congestion sub-weaving traffic flow.
[0011] In the above embodiments, for vehicles initially classified as congestion-prone, by calculating the trajectory integrity of the actual trajectory chain and the standard gantry sequence, false congestion events caused by prolonged stationary stops (rather than slow movement) can be identified. By removing these vehicles from the congestion pattern and recounting them, the final corrected congestion sub-weaving traffic flow eliminates the interference of abnormal events and more realistically reflects the degree of congestion caused by the traffic flow itself, thus improving the reliability and accuracy of traffic condition assessment.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, within a preset time window, the basic weaving traffic flow of each weaving route is obtained by counting the weaving vehicles categorized into each weaving route, specifically including: Extract vehicle type information from the ETC payment data of each weaving vehicle; assign each weaving vehicle to the corresponding vehicle type category based on the vehicle type information; count the weaving vehicles belonging to each vehicle type category to obtain the number of weaving vehicles in each vehicle type category; multiply the number of weaving vehicles in each vehicle type category by the corresponding weaving disturbance equivalent coefficient, and sum all the product results to obtain the weighted weaving traffic flow; replace the basic weaving traffic flow of the weaving route with the weighted weaving traffic flow.
[0013] In the above embodiments, the vehicle types of weaving vehicles are identified and classified, and weaving disturbance equivalent coefficients that characterize the differences in physical size and operating characteristics are assigned to different vehicle types. Then, the weighted weaving traffic flow is obtained by multiplying the number of each vehicle type by its corresponding equivalent coefficient and summing the results. This transforms the heterogeneous mixed traffic flow, which only reflects quantity, into a homogeneous standard traffic flow that reflects real physical traffic pressure. This eliminates the equating of large trucks with small passenger cars, improving the accuracy and physical realism of the model's assessment of the operating status of weaving areas under mixed traffic flow.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, before multiplying the number of weaving vehicles for each vehicle type category by the corresponding weaving disturbance equivalent coefficient and summing all the product results to obtain the weighted weaving traffic flow, the method further includes: Within a preset time window, the proportion of weaving vehicles of each vehicle type to the total number of weaving vehicles is calculated to obtain the real-time traffic flow composition ratio. Based on historical ETC payment data, a dynamic correction function is established between the weaving disturbance equivalent coefficient and the real-time traffic flow composition ratio through function fitting. The real-time traffic flow composition ratio is input into the dynamic correction function to obtain the dynamic correction factor. The preset weaving disturbance equivalent coefficient is multiplied by the dynamic correction factor to obtain the dynamic weaving disturbance equivalent coefficient, which is used to replace the weaving disturbance equivalent coefficient in subsequent steps.
[0015] In the above embodiments, by establishing a dynamic correction function that connects the real-time traffic flow composition and the disturbance coefficient, the originally fixed disturbance equivalent coefficient can be adaptively adjusted according to the proportion of different vehicle types in the current traffic flow, which quantifies the nonlinear group effect of traffic flow. That is, the disturbance capability of a single vehicle type will change with the environment, thereby improving the synchronization rate of real-time traffic conditions.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, within a preset time window, the basic weaving traffic flow of each weaving route is obtained by counting the weaving vehicles categorized into each weaving route, specifically including: Obtain the complete vehicle trajectory chain of weaving vehicles; in the complete vehicle trajectory chain, identify the upstream gantry marker before the gantry marker of the entrance ramp immediately adjacent to the weaving route; if the upstream gantry marker is the mainline gantry, classify the corresponding weaving vehicles as traverse-type weaving vehicles; in the complete vehicle trajectory chain, if the entrance ramp gantry marker of the weaving route is the starting gantry, classify the corresponding weaving vehicles as accompanying-type weaving vehicles; count the traverse-type weaving vehicles and accompanying-type weaving vehicles respectively to obtain the traverse-type weaving traffic flow and the accompanying-type weaving traffic flow; use the traverse-type weaving traffic flow and the accompanying-type weaving traffic flow together as the source fine weaving traffic flow to replace the basic weaving traffic flow.
[0017] In the above embodiments, by tracing the complete trajectory chain of weaving vehicles and identifying the upstream sources before entering the weaving area, the weaving behavior is accurately divided into two modes: traversing type, which merges from the main line, and accompanying type, which merges from the ramp and immediately exits. A two-dimensional flow vector revealing different sources of conflict risk replaces the original single flow count, achieving a deep deconstruction of conflict patterns within the weaving area and improving the targeting and accuracy of traffic risk identification.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after obtaining the basic weaving traffic flow of each weaving route by counting the weaving vehicles classified into each weaving route within a preset time window, the method further includes: Obtain the exit ramp passage timestamps of all weaving vehicles classified as the same weaving route within a preset time window, forming a timestamp set; calculate the statistical standard deviation of the timestamp set, and use the reciprocal of the statistical standard deviation as the weaving synchronicity index; multiply the basic weaving traffic flow by the weaving synchronicity index to obtain the pulse weaving risk index, and use the pulse weaving risk index to update the weaving traffic flow.
[0019] In the above embodiments, a micro-level temporal distribution perspective is introduced on the basis of macro-level traffic statistics. By calculating the standard deviation of the exit timestamps and taking its reciprocal, the concentration of vehicle arrivals is transformed into a synchronicity risk index. Finally, by multiplying the index by the traffic flow, the traffic impulse effect formed by the concentrated arrival of vehicles is quantified, thereby identifying the instantaneous impact risk that average traffic flow data cannot reflect, and improving the early warning capability for sudden congestion.
[0020] Secondly, embodiments of this application provide a real-time urban traffic flow modeling system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, which includes computer instructions, and the one or more processors call the computer instructions to cause the real-time urban traffic flow modeling system to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a real-time urban traffic flow modeling system, cause the real-time urban traffic flow modeling system to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a real-time urban traffic flow modeling system, cause the real-time urban traffic flow modeling system to perform the method described in the first aspect and any possible implementation thereof.
[0023] Understandably, the urban traffic flow real-time modeling system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the urban traffic flow real-time modeling method based on ETC payment data provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This application constructs vehicle trajectory chains and compares them with short-distance weaving routes defined based on road network topology. It identifies and quantifies weaving traffic flows that are difficult to separate, and sums the through traffic flow, non-weaving merging traffic flow, and the quantified weaving traffic flow to construct a modified traffic flow model. By decomposing and reconstructing traffic flows with different behavioral patterns within the weaving area, it can more realistically and comprehensively reflect the actual traffic pressure on the target main road segment, improving the accuracy and depth of traffic condition assessment.
[0025] 2. This application analyzes the travel time distribution of weaving vehicles and uses trough points to dynamically determine the threshold for classifying different traffic modes, thereby enabling the classification of all weaving vehicles into specific operating modes such as smooth flow, slow flow, or congestion. Finally, the single, fuzzy basic flow count is decomposed into a three-dimensional sub-flow vector that can clearly represent the internal operating state, improving the model's ability to understand the degree of congestion and its evolution trend in weaving areas.
[0026] 3. This application, by calculating the trajectory integrity of the actual trajectory chain and the standard gantry sequence for vehicles initially classified as congested, can identify false congestion events caused by prolonged stationary stops (rather than slow movement). By removing these vehicles from the congestion mode and recounting them, the final corrected congestion sub-weaving traffic flow eliminates the interference of abnormal events, more realistically reflecting the degree of congestion caused by the traffic flow itself, and improving the reliability and accuracy of traffic condition assessment. Attached Figure Description
[0027] Figure 1 This is a flowchart illustrating a real-time urban traffic flow modeling method based on ETC payment data in an embodiment of this application. Figure 2This is another flowchart illustrating the real-time urban traffic flow modeling method based on ETC payment data in this application embodiment; Figure 3 This is an exemplary hardware structure diagram of a real-time urban traffic flow modeling system in this application embodiment. Detailed Implementation
[0028] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0029] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0030] In related technologies, traffic flow acquisition primarily relies on fixed sensors deployed on road cross-sections, such as geomagnetic coils or microwave radar. These devices calculate macroscopic traffic flow by counting the number of vehicles passing through the cross-section. However, this cross-section-based statistical method treats all passing vehicles as homogeneous, failing to distinguish their driving intentions and behavioral patterns. For example, it is difficult to differentiate between a steadily straight through vehicle and a weaving vehicle performing complex lane changes to enter or exit ramps. Therefore, when congestion occurs in weaving areas, this method can only observe changes in total cross-sectional flow and speed, but it is difficult to reveal whether the congestion is caused by a surge in through traffic or exacerbated weaving behavior, leading to unclear attribution of traffic pressure and distorted assessment results.
[0031] In this embodiment, vehicle trajectory chains are constructed for each vehicle using ETC payment data covering the road network. By comparing these trajectory chains with short-distance weaving routes defined based on the road network topology, weaving traffic flows are identified and quantified. The mainline traffic flow is decomposed into three components: through traffic flow, non-weaving merging traffic flow, and quantified weaving traffic flow. Based on this, a modified traffic flow model is constructed. The cross-sectional flow count is reconstructed into a structured flow that reflects different driving behaviors, thereby more realistically and comprehensively reflecting the actual traffic pressure on the target mainline segment and improving the accuracy and depth of traffic condition assessment.
[0032] Figure 1 This is a flowchart illustrating a real-time urban traffic flow modeling method based on ETC payment data used in this application, including the following steps: S101. Obtain all ETC payment data within the target road network area.
[0033] The target road network area refers to a specific urban expressway section or interchange hub that this method focuses on, such as a complex interchange with multiple entrances and exits; ETC payment data represents the transaction record generated by the interaction between the roadside unit (RSU) and the on-board unit (OBU) when a vehicle passes through an ETC gantry, including vehicle identification, gantry identification, and timestamp; vehicle identification refers to a code that can uniquely identify a vehicle, usually the OBU serial number or vehicle license plate information; gantry identification refers to a unique geographic or logical code assigned to each ETC gantry to determine the specific location where the vehicle passed; timestamp indicates the exact moment, accurate to the second or millisecond, when the vehicle passed through the gantry.
[0034] Specifically, the deployed computing server initiates data requests to the traffic data management platform (such as a provincial or municipal ETC clearing and settlement center) through secure data interfaces, such as application programming interfaces (APIs) or direct database connections. The request specifies a list of gantry identifiers within one or more target road network areas, along with a time range (e.g., the past five minutes).
[0035] After receiving the request, the data platform will retrieve all matching ETC payment data records from the massive data storage and return this structured data (usually in JSON or XML format) to the server of this method in the form of a data stream or file batch processing.
[0036] S102. Group the ETC payment data based on the vehicle identifier, and sort the data in time sequence according to the timestamp within each group to obtain the vehicle trajectory chain.
[0037] Among them, the vehicle trajectory chain refers to the orderly location sequence formed by linking together scattered ETC passage records belonging to the same vehicle in chronological order.
[0038] Specifically, after obtaining the raw, out-of-order ETC data, all ETC data records obtained by S101 are traversed. For each record, the vehicle identifier is extracted. A data structure, such as a hash map, is maintained with the vehicle identifier as the key. When processing a record, the hash table is checked to see if an entry corresponding to the vehicle identifier exists. If it does not exist, a new entry is created, and the current record's (gantry identifier, timestamp) is stored as a tuple; if it already exists, the tuple is appended to the existing list. After all data within a time window has been processed, each entry in the hash table is traversed again, and within each entry (i.e., the list of all passage records belonging to the same vehicle), the timestamp field is sorted in ascending order. After sorting, each entry constitutes a complete and ordered chain of vehicle trajectories.
[0039] In some embodiments, efficient generation of trajectory chains can be achieved in a variety of ways: Optionally, an in-memory computation method is used: Initialize a hash map (HashMap) with vehicle identifier as the key and toll record list as the value; sequentially read the batch-acquired ETC data, and for each record, add the (gantry identifier, timestamp) tuple to the corresponding value list of the hash map with the vehicle identifier as the key; after the data is read, traverse all values of the hash map (i.e., the record list of all vehicles) in parallel, and sort each list independently according to the timestamp to generate the final track chain set.
[0040] It is understandable that other methods can be used to reconstruct the trajectory, such as using a professional time-series database for querying and aggregation, which is not limited here.
[0041] S103. Based on the topology of the target road network area, define multiple interweaving routes consisting of entrance ramp gantry markers and exit ramp gantry markers.
[0042] In this context, topology refers to the physical connections and logical accessibility between various elements in the road network (such as mainlines, ramps, and gantries), forming a map that describes the backbone of the road network. Weaving routes refer to specific, extremely short driving paths, starting from an entrance ramp and ending at an exit ramp whose distance from the entrance is less than a preset short-distance threshold (set according to urban expressway ramp design specifications). Vehicles completing this route need to weave on the mainline. Entrance / exit ramp gantry identifiers refer to the gantry IDs pre-marked as located on the ramps. The preset short-distance threshold is a distance value (e.g., 2 kilometers) set based on traffic engineering principles and actual road network survey data, used to filter out routes that physically constitute short-distance weaving behavior from all possible entrance / exit pairs.
[0043] Specifically, using a Geographic Information System (GIS) or high-precision map, all gantries belonging to entrance and exit ramps within the target road network area are first identified and marked. Then, all possible entrance-exit gantry pairs are generated.
[0044] For each gantry pair, high-precision map data is queried to calculate the shortest driving distance along the road network from the entrance gantry to the exit gantry. Finally, the calculated distance is compared with a preset short distance threshold. Only gantry pairs with distances less than this threshold are confirmed as valid weaving routes, and the combination of (entrance gantry identifier, exit ramp gantry identifier) is stored in the configuration library.
[0045] In some embodiments, the definition of interlacing routes can be implemented in a variety of ways: Optionally, automatic discovery based on graph algorithms can be adopted: the road network topology is modeled as a directed graph, where nodes are gantries, edges are road segments connecting gantries, and the weight of the edge is the road segment length; for all nodes marked as "entry ramps" in the graph, a depth-limited graph traversal algorithm (such as Dijkstra or BFS) is executed to find all reachable "exit ramp" nodes; during the traversal, if the total path length to a certain exit ramp node is less than a preset short distance threshold, the pair (entry node, exit node) is automatically recorded as a valid weaving route.
[0046] It is understandable that other methods can also be used to generate and manage routes, such as directly importing standard road network data files provided by the design institute; this is not a limitation here.
[0047] S104. Compare each vehicle trajectory chain with multiple weaving routes. When a vehicle trajectory chain consists only of the entrance ramp gantry sign and the exit ramp gantry sign corresponding to a certain weaving route, classify the vehicle corresponding to the vehicle trajectory chain as a weaving vehicle.
[0048] Among them, weaving vehicles refer to vehicles whose complete journey in the road network is observed to start from the beginning of the weaving route and leave directly from the end point, and their behavior pattern is judged as performing short-distance weaving.
[0049] Specifically, all vehicle trajectory chains generated in S102 are traversed. For each trajectory chain, its length, i.e., the number of gantry records it contains, is checked first. The key criterion is "consisting only of...", which technically means that the length of the trajectory chain must be strictly equal to 2. For all trajectory chains of length 2, the identifiers of the first gantry (as the entry point) and the second gantry (as the exit point) are extracted to form ordered gantry pairs. Then, the predefined weaving route library (e.g., a hash set or database table) in S103 is queried. If the gantry pair can be found in the weaving route library, then the vehicle corresponding to the trajectory chain is determined to be a weaving vehicle and marked, while recording which specific weaving route it belongs to.
[0050] In some embodiments, rapid matching of interleaved vehicles can be achieved in a variety of ways: Optionally, a memory matching based on a hash set is used: during initialization, all predefined interweaving routes (entry ID, exit ID) pairs are loaded into the hash set to achieve a query efficiency of nearly O(1); all generated vehicle trajectory chains are traversed and trajectories with a length of 2 are selected; for each selected trajectory, the first and last gantry IDs are combined into a query pair, and then it is checked whether the query pair exists in the hash set. If it exists, the vehicle is classified as an interweaving vehicle.
[0051] It is understandable that other methods can be used to identify trajectory patterns, such as using more complex sequence pattern mining algorithms, which are not limited here.
[0052] S105. Within a preset time window, the basic weaving traffic flow of each weaving route is obtained by counting the weaving vehicles classified into each weaving route.
[0053] The preset time window refers to the time granularity for traffic flow statistics, which is set according to application requirements, such as 5 minutes or 15 minutes, and is determined by those skilled in the art based on the balance between the real-time requirements of the analysis and the stability of the data; the basic weaving traffic flow refers to the total number of vehicles completing a specific weaving route within a given time window.
[0054] Specifically, a counter structure (e.g., a hash table) is maintained, with the weaving route identifier as the key and the count value as the value. Each weaving vehicle being processed carries information about its weaving route. For each categorized weaving vehicle, the time when the weaving action was completed (usually based on the timestamp of its passage through the exit gantry) is checked to determine whether the timestamp falls within the current preset time window.
[0055] If the vehicle belongs to a specific route, locate the counter corresponding to that route and increment its value. At the end of a time window, the final value on each counter represents the base weaving traffic flow for that route within that window. Then, clear all counters and begin statistics for the next time window.
[0056] In some embodiments, to address the problem that basic weaving traffic flow cannot reflect the internal operating status of the weaving area, the single flow count can be refined into sub-flows under different traffic modes by analyzing the travel time distribution of weaving vehicles, and the congestion mode can be further purified, thereby providing a more refined characterization of the weaving state.
[0057] First, for all weaving vehicles belonging to the same weaving route, the difference between the timestamps of their passage through the entrance gantry and the exit gantry is calculated to obtain the individual travel time for each vehicle. The individual travel times within a preset time window (e.g., 15 minutes, a value empirically set by those skilled in the art based on typical cycles of traffic flow state switching) are aggregated to form a travel time set. Based on this set, a travel time distribution histogram is generated. According to traffic flow theory, when multiple traffic states coexist on a road segment, this histogram typically exhibits multiple peaks, corresponding to vehicle groups at different speeds such as smooth flow, slow traffic, and congestion, with distinct troughs between the peaks. Therefore, a peak detection algorithm (such as FindPeaks) is used to identify local minimum points in the histogram, i.e., trough points, and the travel time values corresponding to these trough points are determined as travel time thresholds. For example, if two trough points T1 and T2 are identified, travel times less than T1 are defined as smooth flow, those between T1 and T2 as slow traffic, and those greater than T2 as congestion. This adaptive threshold determination method, based on the distribution characteristics of the data itself, avoids the subjectivity and unsuitability caused by manually setting fixed thresholds. It can dynamically adapt to real-time traffic conditions, thereby improving the accuracy of state classification.
[0058] Each weaving vehicle is categorized into smooth, slow, or congested modes based on its travel time interval, and counted accordingly to obtain the traffic flow of smooth, slow, and congested sub-weaving vehicles. However, judging congestion solely based on travel time carries a potential risk of misjudgment: vehicles may not be taking excessive time due to traffic congestion, but rather due to prolonged non-traffic-related stops within the weaving area (such as illegal parking or vehicle breakdowns). To address this issue, vehicles initially categorized as congested are further screened. First, the complete trajectory chains of these vehicles are obtained, and the standard gantry sequence that the weaving route should ideally pass through is determined based on the road network topology (for short weavings with only two gantry lines, this sequence represents the entrance and exit gantry lines). Subsequently, by comparing the actual trajectory chains of the vehicles with the standard sequence, the trajectory completeness is calculated, which is the ratio of the number of gantry lines actually captured to the number of gantry lines in the standard sequence. When the trajectory integrity is lower than a preset integrity threshold (e.g., 0.8, which is derived from statistical analysis of historical abnormal data to distinguish between occasional missed data collection and persistent missed data collection caused by prolonged stationary states), it is reasonable to believe that the vehicle has been stationary for an extended period at the gantry, resulting in it not being captured by new gantry units in multiple collection cycles. In this case, the vehicle is removed from the congestion mode and reclassified as a stationary vehicle. The vehicles in the purified corrected congestion mode are recounted to obtain the corrected congestion sub-weaving traffic flow. This eliminates the interference of abnormal events on traffic condition assessment, allowing the congestion sub-flow to more accurately reflect the degree of congestion caused by the traffic flow itself. Finally, these three highly differentiated sub-weaving traffic flows (smooth flow, slow flow, and corrected congestion) are used together as a refined weaving traffic flow indicator, replacing the original, generalized basic weaving traffic flow.
[0059] Through the steps described above, this method decomposes the single, fuzzy traffic flow count into three-dimensional vectors with clear physical meaning. This allows the model to not only know how many vehicles are weaving, but also to understand the state in which these vehicles are weaving. This enhances the model's ability to perceive and warn of congestion evolution, thereby improving the accuracy and depth of real-time traffic flow modeling.
[0060] In other embodiments, to address the problem that basic weaving traffic flow cannot distinguish the inherent risk differences of different weaving behaviors, the driving trajectory of weaving vehicles can be traced and classified into subtypes with different disturbance intensities based on their origin before entering the weaving area, thereby enabling the identification of the source of weaving risk.
[0061] First, obtain the complete vehicle trajectory chain for each vehicle classified as a weaving vehicle in S104. Based on the vehicle identifier, retrieve the complete vehicle trajectory chain for this trip from the backend data center. Here, the complete vehicle trajectory chain specifically refers to the ordered sequence of all gantries the vehicle passed during this trip, not just the two constituting the short-distance weaving. The core idea is that the degree of interference to mainline traffic by vehicles with the same weaving start and end points depends heavily on their driving status before entering the weaving area. Therefore, perform an upward tracing operation on the trajectory chain of each weaving vehicle: locate the entrance ramp gantry identifier of the weaving route in the trajectory chain and identify the upstream gantry identifier immediately preceding it.
[0062] There are two scenarios: First, if the upstream gantry marker is pre-marked as a mainline gantry (this marking is done by traffic engineers based on the road network topology), this indicates that the vehicle has already traveled a distance on the mainline before entering the section corresponding to the entrance ramp. To exit from the adjacent exit ramp, the vehicle must continuously change lanes to the right from the inner lane of the mainline within a short distance and in high-density traffic flow, crossing multiple lanes. This behavior causes a severe cutting effect on the normal traffic flow on the mainline, easily triggering a chain reaction of deceleration and congestion. Therefore, this type of vehicle is classified as a traversing weaving vehicle, representing a high-risk, highly disruptive weaving behavior.
[0063] The second scenario involves vehicles whose complete trajectory chain shows that the entrance ramp gantry of the weaving route is the first gantry record of the journey, meaning there is no upstream gantry. This indicates that the vehicle just entered the network from this entrance ramp. Its position is naturally on the far right of the mainline, requiring only lane keeping or minor adjustments to exit via the next exit ramp. This behavior causes minimal disruption to mainline traffic. Therefore, these vehicles are classified as accompanying weaving vehicles, representing low-risk, low-disturbance weaving behavior. This path-based classification clearly separates two behavioral patterns with the same appearance (from A to B) but drastically different inherent risks.
[0064] After classification, within a preset time window, weaving vehicles belonging to "cross-cutting" and "accompanying" types are counted independently to obtain cross-cutting weaving traffic flow and accompanying weaving traffic flow. Finally, these two sub-flows with clear risk orientations are used together as a refined weaving traffic flow indicator, replacing the original, generalized basic weaving traffic flow.
[0065] Through the above steps, the single, fuzzy traffic count is decomposed into a two-dimensional vector with a clear risk orientation, enabling the model to identify the real congestion points and explain why low traffic can sometimes lead to congestion. This enhances the model's ability to predict and attribute sudden congestion in complex interchanges.
[0066] S106. Calculate the corrected traffic flow of the target main road segment, wherein the corrected traffic flow is the sum of the count of through traffic, the count of non-weaving merging traffic, and the basic weaving traffic flow of weaving routes within the target main road segment.
[0067] Among them, the target main line segment refers to the urban expressway arterial road segment that is spatially adjacent to or overlaps with one or more weaving areas, and is the core object of traffic state analysis; the corrected traffic flow refers to a comprehensive flow index that not only considers the traditional main line traffic flow, but also takes into account the impact of weaving traffic flow, thus more accurately reflecting the actual traffic pressure of the road segment; through traffic flow refers to vehicles that completely enter from the upstream of the target main line segment and exit from the downstream; non-weaving merging traffic flow refers to merging traffic flow that enters from the entrance ramp in the middle of the road segment, but whose destination is not the adjacent exit, and is therefore not classified as weaving traffic, and is a supplement to the main line traffic.
[0068] First, based on the definition of the starting and ending gantry of the target main line segment, all vehicles in the trajectory chain that contain these two gantry are selected, and the count value of the through traffic flow is obtained.
[0069] Secondly, vehicles whose starting point is located at an entrance ramp within the target main line segment but are not classified as weaving vehicles in S104 are selected, and the count value of non-weaving merging traffic is obtained.
[0070] Finally, the counts from the first two steps are summed with the baseline weaving traffic flow calculated in S105 for all weaving routes geographically associated with the target main road segment. This sum is the corrected traffic flow, which physically represents the total number of vehicles flowing through the main road segment section within a time window, fully encompassing the traffic flow contributions of the three behavior modes: straight-through, merging, and weaving.
[0071] S107. Generate traffic parameters to characterize the traffic status of the target main road segment.
[0072] Traffic parameters are key performance indicators used to quantitatively describe the traffic operation status, including the average speed of the target main road segment, the corrected traffic flow, and the basic weaving traffic flow. They are the direct basis for traffic managers to conduct situational awareness and decision-making. The average speed refers to the average speed of all vehicles passing through the target main road segment (usually referring to through traffic) within a time window, and is the core indicator reflecting the smoothness of the road segment.
[0073] First, calculate the average vehicle speed. This is usually done by selecting all vehicles that completed the journey through the target main road segment within the time window, obtaining the timestamps of the starting and ending gantries of the main road segment, calculating the travel time for each vehicle, dividing the fixed length of the road segment by the travel time to obtain the speed of each vehicle, and finally calculating the arithmetic mean of the speeds of all vehicles.
[0074] The average vehicle speed, along with the corrected traffic flow calculated by S106 and the basic weaving traffic flow calculated by S105 (or more refined forms such as modal flow, weighted flow, etc.), are packaged into a structured data object or message. This data object is the final set of traffic parameters, which can be pushed to the large screen of the traffic monitoring center for visualization, or provided as input to downstream intelligent transportation application systems such as congestion warning and signal timing optimization.
[0075] In some embodiments, traffic parameters can be calculated and output in a variety of ways: Optionally, an API-oriented output approach can be adopted: internally calculate and cache the latest traffic parameters, including average vehicle speed, corrected flow, and weaving flow; provide a RESTful API interface externally, and return the latest traffic parameters in JSON format when external applications (such as monitoring dashboards or mobile apps) request the interface; the average vehicle speed can be calculated by taking the average of the travel time of through vehicles to obtain the spatial average speed for a more accurate representation.
[0076] It is understandable that other methods can be used to present and apply the final results, such as writing the parameters directly into the database for historical queries, or generating graphic reports, etc., which are not limited here.
[0077] In the above embodiments, by constructing vehicle trajectory chains and comparing them with short-distance weaving routes defined based on road network topology, weaving traffic flows that are difficult to separate are identified and quantified. A modified traffic flow model is constructed by summing the through traffic flow, non-weaving merging traffic flow, and the quantified weaving traffic flow. This decomposes and reconstructs traffic flows with different behavioral patterns within the weaving area, thereby more realistically and comprehensively reflecting the actual traffic pressure on the target main road segment and improving the accuracy and depth of traffic condition assessment.
[0078] In some other embodiments of this application, when operating in weaving areas with a high proportion of mixed passenger and freight traffic, the actual traffic pressure dominated by large vehicles may be underestimated by only counting the total number of vehicles. Using the real-time urban traffic flow modeling method based on ETC payment data provided in this application, a weighted weaving traffic flow that reflects the true level of disturbance can be calculated by identifying vehicle types and introducing a weaving disturbance equivalent coefficient, thereby quantifying the pressure of heterogeneous traffic flows.
[0079] like Figure 2 The diagram shown is another flowchart illustrating the real-time urban traffic flow modeling method based on ETC payment data provided in this application embodiment, including the following steps: S201. Obtain all ETC payment data within the target road network area.
[0080] S202. Group the ETC payment data based on the vehicle identifier, and sort the data in time sequence according to the timestamp within each group to obtain the vehicle trajectory chain.
[0081] S203. Based on the topology of the target road network area, define multiple interweaving routes consisting of entrance ramp gantry markers and exit ramp gantry markers.
[0082] S204. Compare each vehicle trajectory chain with multiple weaving routes. When a vehicle trajectory chain consists only of the entrance ramp gantry sign and the exit ramp gantry sign corresponding to a certain weaving route, classify the vehicle corresponding to the vehicle trajectory chain as a weaving vehicle.
[0083] Steps S201-S204 and Figure 1 Steps S101-S104 in the illustrated embodiment are similar and can be found in the descriptions of steps S101 and S104, which will not be repeated here.
[0084] S205. Extract vehicle model information from the ETC payment data corresponding to each intersecting vehicle.
[0085] Among them, vehicle type information refers to the field recorded in ETC payment data that describes the physical attributes of the vehicle. It is usually coded by the transportation department according to national standards. For example, 1 represents Class I passenger vehicle (small car) and 3 represents Class III freight vehicle (medium-sized freight vehicle).
[0086] Specifically, for each individual vehicle categorized as an interleaved vehicle, the original ETC payment data records are traced back. These records, in addition to vehicle identification, gantry identification, and timestamps, typically contain a vehicle model information field. This field is parsed to extract the code or text description representing the vehicle type. This extraction process involves direct data reading and parsing operations.
[0087] In some embodiments, accurate extraction of vehicle model information can be achieved through multiple methods: Optionally, a data dictionary-based parsing method can be used: a mapping dictionary between vehicle type codes and vehicle descriptions is preloaded, which follows national or local traffic data standards; the interleaved vehicle list is traversed, and for each vehicle, the original vehicle type code is read from the associated ETC data; using this code as a key, the corresponding standardized vehicle type name (such as "small passenger car" or "large truck") is looked up in the dictionary, and this name is used as the extraction result.
[0088] It is understandable that other methods can be used to obtain and standardize vehicle information, such as obtaining more detailed vehicle parameters by associating vehicle identification with a vehicle registration database; this is not limited here.
[0089] S206. Assign each weaving vehicle to the corresponding vehicle type category based on its vehicle type information.
[0090] Among them, vehicle type refers to several major categories formed by merging information on various specific vehicle types based on the similarity of their traffic characteristics (such as size, acceleration, driving behavior, etc.) for traffic analysis purposes. For example, they can be divided into three major categories: "small cars", "medium-sized cars", and "large cars".
[0091] Specifically, a mapping rule from vehicle model information to vehicle model category is predefined. This rule is typically set by traffic engineers based on their professional knowledge. For example, the rule could be defined as follows: all Class I and Class II passenger vehicles (small and medium-sized passenger vehicles) belong to the "small vehicle" category; all trucks and large passenger vehicles belong to the "large vehicle" category. The vehicle model information extracted from S2G05 is iterated through, and a specific vehicle model category label is assigned to each vehicle according to this predefined mapping rule.
[0092] In some embodiments, the scientific classification of vehicle types can be achieved in multiple ways: Optionally, a classification based on traffic engineering standards can be adopted: a built-in mapping table conforming to industry standards such as the "Highway Engineering Technical Standard" (JTG B01) is used; this mapping table clearly categorizes dozens of specific vehicle types defined in the national standard into several key analysis categories such as "passenger cars", "large passenger cars", "small trucks", "medium trucks", and "large trucks"; by querying this mapping table based on the original vehicle type information, the vehicle type category to which it belongs can be obtained directly.
[0093] It is understandable that other methods can be used to classify and group vehicles, such as classifying them based on their power performance; this is not limited here.
[0094] S207. Count the interlaced vehicles belonging to each vehicle type category to obtain the number of interlaced vehicles for each vehicle type category.
[0095] Among them, the number of interweaving vehicles of each vehicle type refers to the total number of vehicles belonging to a specific vehicle type that complete the same interweaving route within a preset time window. It is a traffic flow statistic value broken down by vehicle type.
[0096] Specifically, for each weaving route, a counter structure (e.g., a hash table) is maintained, with vehicle type category as the key and count value as the value. All categorized weaving vehicles are traversed. For each vehicle, it is first checked whether it belongs to the current time window, and then the vehicle type category label assigned in S206 is retrieved. Next, the specific counter corresponding to the weaving route to which the vehicle belongs and the vehicle type category is found, and its value is incremented by one. When a time window ends, the value on each counter represents the number of weaving vehicles of that type category on that weaving route within that window.
[0097] S208. Multiply the number of weaving vehicles for each vehicle type category by the corresponding weaving disturbance equivalent coefficient, and sum all the product results to obtain the weighted weaving traffic flow.
[0098] Among them, the weaving disturbance equivalent coefficient is a dimensionless weighting factor used to quantify the average disturbance degree of different vehicle types to traffic flow when performing weaving behavior. It is determined according to the preset mapping relationship between vehicle type and coefficient. The preset mapping relationship between vehicle type and coefficient refers to a lookup table pre-established by traffic experts based on a large number of simulation experiments or measured data analysis, which assigns a fixed disturbance coefficient value to each vehicle type (for example, 1.0 for small cars and 2.5 for large trucks). The weighted weaving traffic flow is a comprehensive traffic flow index, which is the equivalent standard traffic flow after converting the number of vehicles of different vehicle types according to their disturbance capacity.
[0099] Specifically, firstly, the corresponding weaving disturbance equivalent coefficient is found for each vehicle type from a pre-defined mapping library of vehicle types and coefficients. Then, the number of weaving vehicles for each vehicle type obtained in S207 is iterated through, and the count value for each vehicle type is multiplied by its corresponding equivalent coefficient to obtain the equivalent disturbance amount for that vehicle type. For example, if there are 10 large trucks (coefficient 2.5), the equivalent disturbance amount is 10 * 2.5 = 25. Finally, the equivalent disturbance amounts for all vehicle types are summed, and the total sum represents the weighted weaving traffic flow for that weaving route within that time window. Physically, this value represents the total weaving disturbance generated by the current mixed traffic flow, approximately equal to the disturbance generated by how many standard small cars simultaneously weave.
[0100] In some embodiments, weighted flow can be calculated in a variety of ways: Optionally, use vector dot product operation: Optionally, a database aggregation query can be used: the vehicle type count is stored in the table T_COUNTS(route_id, vehicle_type, count), and the equivalent coefficient is stored in the table T_COEFFS(vehicle_type, coeff); an SQL query is executed, first the two tables are joined by vehicle_type (JOIN), then the product of count*coeff is calculated, and finally the products are grouped by route_id (GROUP BY) and the sum of the products (SUM), thus calculating the weighted weaving traffic flow of each weaving route in one step.
[0101] It is understandable that other methods can be used to achieve the weighted summation process, such as matrix operations in spreadsheet software, which are not limited here.
[0102] In some embodiments, to address the problem that the preset weaving disturbance equivalent coefficient cannot adapt to changes in real-time traffic flow composition, a dynamic correction function can be established and applied before calculating the weighted weaving traffic flow, so that the equivalent coefficient can be adaptively adjusted according to the proportion of different vehicle types in the real-time traffic flow, thereby achieving higher accuracy and dynamism in weaving disturbance assessment.
[0103] Specifically, the disturbance capability of a single vehicle type is not constant but is affected by the group effect of surrounding vehicles. For example, in a traffic flow composed of many small cars, the presence of a large truck will generate a significant disturbance; conversely, in a traffic flow dominated by large trucks, the marginal disturbance increment brought by adding another large truck will decrease. To quantify this effect, modeling is first performed offline based on massive amounts of historical ETC payment data. Weaving segment data under different time periods and different traffic flow composition ratios are selected, and combined with corresponding performance indicators such as average speed and delay of the corresponding segments, a nonlinear relationship between the weaving disturbance equivalent coefficient and the real-time traffic flow composition ratio is established through statistical regression or machine learning methods. This relationship is solidified into a dynamic correction function, for example, a polynomial function f(p_large)=a*p_large^2+b*p_large+c, where p_large is the proportion of large vehicles in the weaving traffic flow, and the output of the function is the dynamic correction factor. This function is essentially a mathematical abstraction of the nonlinear dynamic characteristics of traffic flow, acknowledging that the total system disturbance is not a simple linear superposition of the disturbances of individual parts.
[0104] After calculating the number of weaving vehicles for each vehicle type in S207, but before performing the weighted summation in S208, a real-time calculation is performed: the number of weaving vehicles for each vehicle type is divided by the total number of weaving vehicles to obtain a vector describing the current traffic flow composition, i.e., the real-time traffic flow composition ratio (e.g., [small car ratio: 70%, large car ratio: 30%]). This ratio (or a key value, such as the large car ratio) is then used as input and substituted into a pre-established dynamic correction function to obtain a dynamic correction factor. This factor reflects the amplification or reduction effect of the current traffic flow composition on the base disturbance coefficient. Finally, the preset weaving disturbance equivalent coefficient originally used in S208 (e.g., the base coefficient for large cars is 2.5) is multiplied by this calculated dynamic correction factor (e.g., factor 0.9) to obtain the dynamic weaving disturbance equivalent coefficient (e.g., 2.5 * 0.9 = 2.25). This dynamic coefficient is then used in the weighted summation calculation in S208, replacing the original fixed coefficient.
[0105] Through the above steps, the static, experience-based disturbance coefficients are upgraded to dynamic, intelligent coefficients capable of sensing and responding to changes in the traffic flow environment. Traditional PCE models assume linear interactions between vehicles, while a nonlinear model is established by introducing a dynamic correction function related to traffic flow composition. This allows disturbance assessment to move beyond viewing each vehicle in isolation and consider it within the real, dynamically changing micro-environment of traffic flow, thus enabling more accurate capture of the nonlinear fluctuations in the overall performance of the traffic system caused by changes in traffic flow composition.
[0106] S209, Replace the basic weaving traffic flow of the weaving route with the weighted weaving traffic flow.
[0107] Specifically, a logical replacement operation is performed. In subsequent steps (such as calculating the corrected traffic flow in S210), when the weaving traffic flow parameter is needed, the weighted weaving traffic flow calculated in S208, which better reflects the actual traffic pressure, is used. This replacement operation upgrades from quantitative statistics to a dynamic pressure assessment that considers vehicle heterogeneity and physical influences, thus ensuring that all subsequent analyses and outputs are based on a more accurate foundation.
[0108] In some embodiments, after calculating the weighted weaving traffic flow reflecting the total amount and composition of weaving, in order to further reveal the instantaneous impact risk caused by the concentration of vehicle arrival times, a weaving synchronicity index can be introduced to make a secondary correction to the traffic flow, thereby achieving a quantitative assessment of the impulse effect of weaving behavior.
[0109] Specifically, the same total volume of weaving traffic, if evenly distributed over time, will have a gradual impact on mainline traffic; conversely, if it occurs in a concentrated burst within a short period, it will create traffic pulses, easily overwhelming the buffer capacity of the mainline traffic flow and causing congestion. To quantify this synchronicity, the timestamps of all vehicles belonging to the same weaving route passing through the exit ramp gantry within a preset time window (e.g., 5 minutes, a value set by those skilled in the art based on the desired risk perception sensitivity) are first obtained, forming a timestamp set. Then, the statistical standard deviation is calculated for this timestamp set. The statistical standard deviation is a core indicator for measuring the dispersion of data: if the timestamps are widely and evenly distributed, the standard deviation will be large; if the timestamps are highly concentrated around a certain moment, the standard deviation will be very small.
[0110] Leveraging this characteristic, the reciprocal of the statistical standard deviation is defined as the interleaving synchronicity index. Thus, when vehicle arrival times are dispersed, a large standard deviation results in a small reciprocal (synchronicity index), representing low risk; conversely, when vehicle arrival times are highly concentrated, a small standard deviation results in a sharply increased reciprocal (synchronicity index), representing high risk. This definition intuitively and effectively transforms the concentration of time distribution into a quantifiable risk indicator.
[0111] The weighted weaving traffic flow obtained from S209 (which already reflects the risk of total volume and vehicle type composition) is multiplied by the weaving synchronicity index to obtain the final, comprehensive pulse weaving risk index. This final index integrates risk information from three dimensions: total weaving volume, vehicle type composition, and synchronicity, and is ultimately used to update or replace the original weaving traffic flow parameters, serving as the most comprehensive assessment of weaving risk.
[0112] Through the above steps, a micro-temporal distribution perspective is introduced on the basis of macro-traffic statistics, enabling the model to identify peak risks masked by the mean, and to explain why seemingly smooth traffic flows can suddenly collapse. This enhances the model's ability to provide early warning and attribution analysis for sudden, short-term congestion.
[0113] S210. Calculate the corrected traffic flow of the target main road segment, wherein the corrected traffic flow is the sum of the count of through traffic, the count of non-weaving merging traffic, and the basic weaving traffic flow of weaving routes within the target main road segment.
[0114] S211. Generate traffic parameters to characterize the traffic status of the target main line segment.
[0115] Steps S210-S211 and Figure 1 Steps S106-S107 in the illustrated embodiment are similar and can be found in the descriptions of steps S106-S107, which will not be repeated here.
[0116] In the above embodiments, the vehicle types of weaving vehicles are identified and classified, and weaving disturbance equivalent coefficients that characterize the differences in physical size and operating characteristics are assigned to different vehicle types. Then, the weighted weaving traffic flow is obtained by multiplying the number of each vehicle type with its corresponding equivalent coefficient and summing the results. This transforms the heterogeneous mixed traffic flow that only reflects quantity into homogeneous standard vehicles that can reflect real physical traffic pressure, no longer equating large trucks with small passenger cars, thus improving the accuracy and physical realism of the model's assessment of the operating status of weaving areas under mixed traffic flow. The following describes an exemplary real-time urban traffic flow modeling system 300 provided in an embodiment of this application. Figure 3 This is an exemplary hardware structure diagram of the real-time urban traffic flow modeling system 300 provided in this application embodiment.
[0117] In some embodiments, the real-time urban traffic flow modeling system 300 is a computer device or includes a computer device. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores data. The network interface of the computer device is used to communicate with other external terminals or servers via a network connection. In some embodiments, the network interface can be a wired network interface; in some embodiments, the network interface can also be a wireless network interface. When the computer program is executed by the processor, it implements the methods in the embodiments of this application.
[0118] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0119] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0120] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0121] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0122] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for real-time modeling of urban traffic flow based on ETC payment data, characterized in that, The method comprises: acquiring all ETC payment data in a target road network area; the ETC payment data comprises vehicle identification, gantry identification and a timestamp; grouping the ETC payment data based on the vehicle identification, and sequentially sorting the ETC payment data in each group according to the timestamp to obtain a vehicle trajectory chain; defining a plurality of interweaved routes composed of entrance ramp gantry identification and exit ramp gantry identification based on the topology of the target road network area; the distance between the entrance and the exit of the interweaved route is less than a preset short distance threshold; comparing each vehicle trajectory chain with the plurality of interweaved routes, and when there is a vehicle trajectory chain composed of only the entrance ramp gantry identification and the exit ramp gantry identification corresponding to a certain interweaved route, classifying the vehicle corresponding to the corresponding vehicle trajectory chain as an interweaved vehicle; counting the interweaved vehicles classified in each interweaved route within a preset time window to obtain a basic interweaved vehicle flow of each interweaved route; calculating a corrected traffic flow of a target main line section, wherein the corrected traffic flow is the sum of a through traffic flow, a non-interweaved merging traffic flow and the basic interweaved vehicle flow of the interweaved route in the target main line section; the target main line section is spatially adjacent to one or more interweaved routes; the through traffic flow is a vehicle whose vehicle trajectory chain passes through the target main line section; the non-interweaved merging traffic flow is a vehicle whose vehicle trajectory chain starts from an entrance ramp in the target main line section and is not classified as an interweaved vehicle; generating a traffic parameter for representing the traffic state of the target main line section; the traffic parameter comprises the average speed of the target main line section, the corrected traffic flow and the basic interweaved vehicle flow.
2. The method of claim 1, wherein, The counting of the interweaved vehicles classified in each interweaved route within a preset time window to obtain a basic interweaved vehicle flow of each interweaved route specifically comprises: calculating the time difference between the entrance passing time and the exit passing time of all interweaved vehicles classified in the same interweaved route to obtain the travel time of each interweaved vehicle; generating a travel time distribution histogram according to a travel time set and identifying a trough point of the travel time distribution histogram to determine a travel time threshold; the travel time set is composed of the travel times of all interweaved vehicles under the same interweaved route; dividing the travel time set into a plurality of travel time subsets based on the travel time threshold; each travel time subset is defined as a smooth mode, a slow mode or a congestion mode; classifying each interweaved vehicle under the same interweaved route into the corresponding smooth mode, slow mode or congestion mode according to the travel time subset to which the travel time belongs; counting the interweaved vehicles belonging to the smooth mode, slow mode and congestion mode respectively to obtain a smooth sub-interweaved vehicle flow, a slow sub-interweaved vehicle flow and a congestion sub-interweaved vehicle flow. The smooth sub-interweaved vehicle flow, the slow sub-interweaved vehicle flow and the congestion sub-interweaved vehicle flow are collectively taken as a refined interweaved vehicle flow representing the interweaved route state, instead of the basic interweaved vehicle flow.
3. The method of claim 2, wherein, After the smooth sub-interweaved vehicle flow, the slow sub-interweaved vehicle flow and the congestion sub-interweaved vehicle flow are collectively taken as a refined interweaved vehicle flow representing the interweaved route state, instead of the basic interweaved vehicle flow, the method further comprises: obtaining congestion vehicle trajectory chains corresponding to interweaved vehicles belonging to the congestion mode; determining a standard gantry sequence corresponding to the interweaved route based on the topological structure of the target road network region; the standard gantry sequence is an ordered set of gantry identifiers that should be passed through during normal driving; comparing each of the congestion vehicle trajectory chains with the standard gantry sequence to calculate a trajectory integrity; the trajectory integrity is a ratio of the number of gantries contained in the vehicle trajectory chain to the number of gantries in the standard gantry sequence; when the trajectory integrity is lower than a preset integrity threshold, removing the corresponding interweaved vehicle from the congestion mode and reclassifying it as a stationary vehicle to obtain a modified congestion mode; counting the interweaved vehicles belonging to the modified congestion mode to obtain a modified congestion sub-interweaved vehicle flow, instead of the congestion sub-interweaved vehicle flow.
4. The method of claim 1, wherein, The method for obtaining the basic interweaved vehicle flow of each interweaved route within a preset time window by counting the interweaved vehicles classified in each interweaved route comprises: extracting vehicle type information from the ETC payment data corresponding to each interweaved vehicle; allocating each interweaved vehicle to a corresponding vehicle type category according to the vehicle type information; counting the interweaved vehicles belonging to each vehicle type category to obtain a vehicle type category interweaved vehicle number; multiplying each vehicle type category interweaved vehicle number by a corresponding interweaving disturbance equivalent coefficient and summing all the product results to obtain a weighted interweaved vehicle flow; the interweaving disturbance equivalent coefficient is determined according to a preset mapping relationship between vehicle types and coefficients; replacing the basic interweaved vehicle flow of the interweaved route with the weighted interweaved vehicle flow.
5. The method of claim 4, wherein, Before the step of multiplying each vehicle type category interweaved vehicle number by a corresponding interweaving disturbance equivalent coefficient and summing all the product results to obtain a weighted interweaved vehicle flow, the method further comprises: calculating, within the preset time window, a proportion of the interweaved vehicle number of each vehicle type category in the total interweaved vehicle number to obtain a real-time vehicle flow composition ratio; establishing a dynamic correction function between the interweaving disturbance equivalent coefficient and the real-time vehicle flow composition ratio by function fitting based on historical ETC payment data; inputting the real-time vehicle flow composition ratio into the dynamic correction function to obtain a dynamic correction factor; multiplying the preset interweaving disturbance equivalent coefficient by the dynamic correction factor to obtain a dynamic interweaving disturbance equivalent coefficient, and replacing the interweaving disturbance equivalent coefficient with the dynamic interweaving disturbance equivalent coefficient in subsequent steps.
6. The method of claim 1, wherein, The counting of the weaving vehicles classified in each of the weaving routes in a preset time window to obtain a basic weaving vehicle flow of each of the weaving routes, specifically comprising: Obtaining a complete vehicle trajectory chain of the weaving vehicle; In the complete vehicle trajectory chain, identifying an upstream gantry sign immediately before the entrance ramp gantry sign of the weaving route; In the case that the upstream gantry sign is a main line gantry, classifying the corresponding weaving vehicle as a cross-cut type weaving vehicle; In the complete vehicle trajectory chain, the entrance ramp gantry sign of the weaving route is the starting gantry, and the corresponding weaving vehicle is classified as a companion type weaving vehicle; Counting the cross-cut type weaving vehicles and the companion type weaving vehicles respectively to obtain cross-cut type weaving vehicle flow and companion type weaving vehicle flow; Using the cross-cut type weaving vehicle flow and the companion type weaving vehicle flow as the source fine weaving vehicle flow together to replace the basic weaving vehicle flow.
7. The method of claim 1, wherein, After the counting of the weaving vehicles classified in each of the weaving routes in a preset time window to obtain a basic weaving vehicle flow of each of the weaving routes, the method further comprises: Obtaining the exit ramp passing time stamps of all weaving vehicles classified in the same weaving route in the preset time window to form a time stamp set; Calculating the statistical standard deviation of the time stamp set, and taking the reciprocal of the statistical standard deviation as a weaving synchronization index; Multiplying the basic weaving vehicle flow and the weaving synchronization index to obtain a pulse weaving risk index, and updating the weaving vehicle flow using the pulse weaving risk index.
8. A real-time modeling system for urban traffic flow, characterized in that, The urban traffic flow real-time modeling system comprises one or more processors and a memory; the memory is coupled with the one or more processors, and the memory is used to store computer program code, the computer program code comprising computer instructions, the one or more processors invoking the computer instructions to cause the urban traffic flow real-time modeling system to perform the method of any one of claims 1-7.
9. A computer program product comprising instructions, characterized in that, When the computer program product runs on the urban traffic flow real-time modeling system, the urban traffic flow real-time modeling system is caused to perform the method of any one of claims 1-7.
10. A computer-readable storage medium comprising instructions, characterized in that, When the instructions run on the urban traffic flow real-time modeling system, the urban traffic flow real-time modeling system is caused to perform the method of any one of claims 1-7.
