Intelligent analysis method and system for urban traffic congestion reasons based on knowledge graph
By constructing a traffic spatiotemporal knowledge graph based on knowledge graphs, and combining multi-hop causal path reasoning with a large language model, the problem of difficulty in deeply exploring causal chains in traditional traffic analysis methods is solved. This enables accurate source tracing and interpretable traffic congestion analysis, improving the intelligence of traffic management and the credibility of decision-making.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional urban traffic congestion analysis methods rely on macro indicators, neglecting the impact of driver behavior on traffic flow. They can only provide correlation analysis rather than delving into the specific causal chains that lead to congestion, thus hindering the development of targeted solutions.
We construct a traffic spatiotemporal knowledge graph based on knowledge graphs. By collecting and analyzing vehicle trajectory data, road network data, point of interest data, and meteorological environment data, we identify semantic tags of driving behavior, establish causal relationships, generate causal transmission paths, and use a large language model to generate natural language reports.
It achieves a leap from describing phenomena to understanding mechanisms, enabling precise tracing of the causes of congestion and generating interpretable natural language reports. It supports quantitative evaluation of intervention effects based on counterfactual inference, thereby improving the intelligence of traffic management and the credibility of decision-making.
Smart Images

Figure CN121838465A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of urban traffic congestion cause analysis, in particular to a method and system for intelligent analysis of urban traffic congestion causes based on a knowledge graph. BACKGROUND
[0002] Urban traffic congestion cause analysis technology is a series of methods and technologies aimed at determining the causes of traffic congestion by analyzing traffic flow data, road structure, event information (such as traffic accidents), weather conditions, and other factors. This analysis can be based on statistical models, machine learning algorithms, or more complex knowledge graph technologies.
[0003] Traditional analysis methods mostly rely on macro indicators such as average speed or flow, ignoring the impact of driver behavior on traffic flow smoothness, and existing methods can only provide correlation analysis rather than in-depth exploration of the specific causal chain leading to congestion, thereby affecting the development of targeted solutions. SUMMARY
[0004] In view of the above existing problems, the present application is proposed.
[0005] Therefore, the present application provides a method for intelligent analysis of urban traffic congestion causes based on a knowledge graph to solve the problem that traditional analysis methods mostly rely on macro indicators such as average speed or flow, ignoring the impact of driver behavior on traffic flow smoothness, and existing methods can only provide correlation analysis rather than in-depth exploration of the specific causal chain leading to congestion, thereby affecting the development of targeted solutions.
[0006] To solve the above technical problems, the present application provides the following technical solutions: In a first aspect, the present application provides a method for intelligent analysis of urban traffic congestion causes based on a knowledge graph, which includes: Collecting vehicle trajectory data, road network data, point of interest (POI) data, traffic signal timing data, and meteorological environment data within a city; Extracting state sequences based on vehicle trajectory data, and identifying driving behavior semantic labels according to speed change rate and heading angle fluctuation, embedding the driving behavior semantic labels into corresponding state entities to form enhanced state entities; Constructing a regular hexagon grid system, spatially aligning the enhanced state entities, road network data, point of interest (POI) data, and grid cells, and establishing a traffic spatio-temporal knowledge graph containing state entities, road segment entities, grid entities, and POI entities; Based on historical state disturbances and road segment traffic state changes, identifying disturbance conduction relationships between road segments, introducing causal relationship types in the traffic spatio-temporal knowledge graph, constructing an explicit causal subgraph layer, and forming a causal enhanced traffic spatio-temporal knowledge graph; In response to the congestion query request, a time interval and a geographical area specified by the query are determined, and entities and causal relationships covering the time-space range are extracted from the causally enhanced traffic time-space knowledge graph; Based on the extracted entities and causal relationships, multi-hop graph traversal is performed to generate a causal conduction path from the initial disturbance event to the final congestion phenomenon; The causal conduction path is input into a large language model agent to generate a congestion traceability report in natural language form, and supports counterfactual reasoning based on the causal subgraph layer to evaluate the intervention effect.
[0007] As a preferred scheme of the knowledge graph-based intelligent analysis method for urban traffic congestion causes, the collection of vehicle trajectory data, road network data, point of interest (POI) data, traffic signal timing data, and meteorological environment data within the city is as follows: A positioning terminal deployed on an operating vehicle continuously records position information at fixed time intervals to form a sequence of original trajectory points composed of time stamps, longitude, latitude, instantaneous speed, and passenger status; Structured road network data is obtained from the city traffic geographic information system, which includes the unique identifier, geometric coordinate string, topological connection relationship, number of lanes, and road function level of each road segment; Point of interest (POI) data is obtained from an electronic map service platform, which includes the name, category, detailed address, and spatial coordinates of each POI; Intersection signal timing schemes are obtained from the city traffic signal control center, which include the start and end times of each phase green light, the complete cycle length, and the phase switching sequence; Real-time meteorological environment data is obtained from the city meteorological monitoring station network, which includes rainfall intensity, horizontal visibility, and wind speed.
[0008] As a preferred scheme of the knowledge graph-based intelligent analysis method for urban traffic congestion causes, the state sequence is extracted based on the vehicle trajectory data, and the driving behavior semantic label is embedded into the corresponding state entity according to the speed change rate and heading angle fluctuation to form an enhanced state entity, and the specific steps are as follows: The original trajectory point sequence is divided into multiple continuous time batches according to a five-minute time window, and the trajectory points in each time batch form a state sequence; For the first trajectory point in the state sequence, the acceleration is calculated, and the calculation method is as follows: ; wherein, instantaneous speed of the previous trajectory point, instantaneous speed of the previous trajectory point, instantaneous speed of the previous trajectory point, time interval between two trajectory points; if the acceleration is less than a preset threshold of emergency braking acceleration and the direction is opposite to the driving direction, the state corresponding to the trajectory point is marked as emergency braking behavior; calculate the steering angle , , if the absolute value of the steering angle exceeds the steering angle threshold value more than the lane changing frequency threshold value in a unit time window, it is marked as frequent lane changing behavior; if the vehicle continuously stays in a state where the speed is lower than the low speed threshold value and the spatial position offset distance is less than the distance threshold value before the intersection stop line, and the duration exceeds the waiting time threshold value, it is marked as intersection lingering behavior; write the identified driving behavior semantic label as a structured attribute field into the corresponding state entity node to form an enhanced state entity.
[0009] As a preferred scheme of the intelligent analysis method for urban traffic congestion reasons based on the knowledge graph, wherein: the regular hexagon grid system is constructed, the enhanced state entity, road network data, and point of interest (POI) data are spatially aligned with the grid unit, and a traffic space-time knowledge graph containing state entities, road segment entities, grid entities, and POI entities is established. The specific steps are as follows: generate a regular hexagon grid with a fixed side length with the city administrative boundary as the circumscribed region, and assign a unique integer identifier to each grid unit; for each enhanced state entity, input its latitude and longitude coordinates, determine its corresponding grid unit through a spatial indexing algorithm, and establish a located_in relationship edge in the graph database; for each road segment entity, perform a spatial intersection operation between its line segment geometry and all grid units, and establish a contained_in relationship edge between the grid units with a non-empty intersection and the road segment; for each point of interest (POI), query the corresponding grid unit according to its spatial coordinates, and establish a belongs_to relationship edge; create four types of node types in the graph database, including state nodes, road segment nodes, grid nodes, and POI nodes, and establish edges according to the above spatial relationships to form an initial traffic space-time knowledge graph.
[0010] As a preferred embodiment of the intelligent analysis method for urban traffic congestion causes based on knowledge graphs described in this invention, the steps of identifying the transmission relationship of disturbances between road segments based on historical state disturbances and changes in road segment traffic status, introducing causal relationship types into the traffic spatiotemporal knowledge graph, constructing explicit causal sub-layers, and forming a causal-enhanced traffic spatiotemporal knowledge graph are as follows: For each section The average traffic speed is calculated in batches over time to form a time series. ; For any two road segments that have a topological connection and Calculate from the upstream section Downstream section The transition entropy is expressed as: ; in, Indicates downstream section In time batch Average traffic speed, Indicates the upstream section Average passage speed of batches within the same time period Represents the joint probability or conditional probability distribution; If the transfer entropy If the value exceeds the preset statistical threshold, then in the road segment... and Create propagates_to causal edges between them; For each POI event If, during the period in which the event occurs, the density of state entities in the surrounding grid cells suddenly increases and the average traffic speed decreases by more than the speed decrease threshold, then a cause-effect relationship edge is created from the POI node to the affected road segment. All newly added causal relationship edges are integrated into the initial traffic spatiotemporal knowledge graph to form a causal-enhanced traffic spatiotemporal knowledge graph with mechanism reasoning capabilities.
[0011] As a preferred embodiment of the knowledge graph-based intelligent analysis method for urban traffic congestion causes described in this invention, the steps of responding to a congestion query request, determining the specified time interval and geographical region, and extracting entities and causal relationships covering the spatiotemporal range from a causal-enhanced traffic spatiotemporal knowledge graph are as follows: It receives congestion query requests in natural language format submitted by users and extracts the target geographic region boundaries and time intervals through the semantic parsing module. ; Transform the geographical region boundary into a set of grid cells. ; Time interval Divide into time batch sets by five-minute granularity ; Filter all state nodes that satisfy the following conditions: its grid cell belongs to set , and its time batch belongs to set ; Extract road segment nodes, grid nodes, and POI nodes directly connected to the state nodes, and load all propagates_to and causes causal relationship edges with these nodes as endpoints to form a subgraph for subsequent analysis .
[0012] As a preferred scheme of the intelligent analysis method for urban traffic congestion causes based on a knowledge graph, wherein: the multi-hop graph traversal is performed based on the extracted entities and causal relationships to generate a causal transmission path from an initial disturbance event to a final congestion phenomenon, and the specific steps are as follows: In the subgraph , identify all state nodes with an average travel speed lower than a severe congestion threshold as a set of candidate end node sets; For each candidate end node, perform a depth-first search in the reverse direction along the causal relationship edges, with a maximum search depth limit of five hops to ensure that the path has actual physical meaning; During the search process, only paths that meet the time sequence constraint are retained, i.e., the time batches corresponding to the nodes on the path are strictly decreasing; For each valid causal path , calculate its overall causal strength , and the calculation formula is: ; Wherein, represents the weight of the causal edge , and the weight value is the standardized transfer entropy value or event association confidence score; Select the path with the largest causal strength as the main causal transmission path to generate the final congestion traceability explanation.
[0013] As a preferred scheme of the intelligent analysis method for urban traffic congestion causes based on a knowledge graph, wherein: the causal transmission path is input into a large language model agent to generate a congestion traceability report in natural language form, and supports counterfactual reasoning based on the causal subgraph layer to evaluate intervention effects, and the specific steps are as follows: Map the node types and relationship types in the main causal transmission path to predefined semantic templates; Call the large language model agent to automatically generate a natural language congestion traceability report with clear structure and logical coherence based on the semantic templates; Identify an intervenable node in the main causal conduction path, the intervenable node being a POI event node or a signal-timed adjustable intersection segment node; Temporarily delete the intervenable node and all causal relationship edges emitted by the intervenable node in the causal enhanced traffic spatiotemporal knowledge graph to form a virtual graph; Repeat the multi-hop graph traversal process on the virtual graph to determine whether the original end-point congestion state disappears or is alleviated; If the end-point congestion state disappears, add an intervention suggestion to the congestion traceability report, and complete the counterfactual reasoning evaluation; Introduce a congestion alleviation index for supporting quantitative evaluation of intervention effects, and the expression is: ; wherein, represents a congestion score of the end-point state in the original graph, represents a congestion score of the corresponding state in the virtual graph, and the congestion score is calculated based on the degree and duration of speed deviation from free flow; If is greater than a preset threshold, it is determined that the intervention measure is effective, and the system will include the conclusion in the final output report.
[0014] In a second aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the computer program, when executed by the processor, implements any step of the knowledge graph-based intelligent analysis method for urban traffic congestion causes according to the first aspect of the present application.
[0015] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the knowledge graph-based intelligent analysis method for urban traffic congestion causes according to the first aspect of the present application.
[0016] The present application has the following beneficial effects: by constructing a causal enhanced traffic spatiotemporal knowledge graph that integrates driving behavior semantics, spatial grid alignment, and explicit causal mechanisms, the present application breaks through the limitations of traditional traffic analysis methods that only rely on macroscopic flow statistics or static event correlation, realizes a leap from phenomenon description to mechanism understanding, and, in combination with multi-hop causal path reasoning and large language model agents, can not only accurately trace the causes of congestion and generate an interpretable natural language report, but also support quantitative evaluation of intervention effects based on counterfactual reasoning, thereby effectively improving the intelligentization, refinement, and decision-making credibility of urban traffic management. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0018] Figure 1 The flowchart of the intelligent analysis method for the cause of urban traffic congestion based on the knowledge graph in Embodiment 1. DETAILED DESCRIPTION
[0019] In order to make the above objectives, features and advantages of the present application more apparent, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0020] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of the present application, therefore the present application is not limited to the specific embodiments disclosed below.
[0021] Secondly, the "one embodiment" or "embodiment" referred to herein means that the specific features, structures or characteristics can be included in at least one implementation of the present application. "In one embodiment" appearing in different places in the specification does not mean the same embodiment, nor is it an independent or alternative embodiment that excludes other embodiments.
[0022] Embodiment 1, with reference to Figure 1 For one embodiment of the present application, the embodiment provides an intelligent analysis method for the cause of urban traffic congestion based on a knowledge graph, comprising the following steps: S1, collecting vehicle trajectory data, road network data, point of interest (POI) data, traffic signal timing data and meteorological environment data in a city.
[0023] Furthermore, the positioning terminal deployed on the operating vehicle continuously records the position information at a fixed time interval to form a sequence of original trajectory points composed of a time stamp, longitude, latitude, instantaneous speed and passenger carrying state; Obtain structured road network data from a city traffic geographic information system, wherein the road network data includes a unique identifier of each road segment, a geometric coordinate string, a topological connection relationship, a number of lanes and a road function level; Obtain point of interest (POI) data from an electronic map service platform, wherein the point of interest (POI) data includes the name, category, detailed address and spatial coordinates of each POI; The intersection signal timing scheme is obtained from the city traffic signal control center. The signal timing scheme includes the start and end times of the green light for each phase, the duration of the complete cycle, and the phase switching sequence. Real-time meteorological environmental data is obtained from the city's meteorological monitoring station network, including rainfall intensity, horizontal visibility, and wind speed.
[0024] It should be noted that the systematic collection and structured integration of multi-source heterogeneous data provides a high spatiotemporal resolution and semantically rich basic input for the subsequent construction of knowledge graphs. This not only covers all elements of "people-vehicle-road-environment-management", but also ensures that the analysis of congestion causes has comprehensive data support and consistency with real physical reality.
[0025] S2. Extract state sequences based on vehicle trajectory data, and identify driving behavior semantic labels based on speed change rate and heading angle fluctuation. Embed the driving behavior semantic labels into the corresponding state entities to form enhanced state entities.
[0026] Furthermore, the original trajectory point sequence is divided into multiple consecutive time batches according to a five-minute time window, and the trajectory points in each time batch constitute a state sequence. For the state sequence of the th Calculate the acceleration of each trajectory point. The calculation method is as follows: ; in, Indicates the first The instantaneous velocity of each trajectory point This represents the instantaneous velocity of the previous trajectory point. This represents the time interval between two trajectory points; If acceleration If the acceleration is less than the preset emergency braking threshold and the direction is opposite to the driving direction, the state corresponding to the trajectory point is marked as an emergency braking behavior. Calculate the trajectory points , , The resulting steering angle If the number of times the absolute value of the steering angle exceeds the steering angle threshold within a unit time window is greater than the lane change frequency threshold, it is marked as frequent lane change behavior. If a vehicle remains at a speed below the low-speed threshold and a spatial position deviation distance less than the distance threshold in front of the stop line at an intersection for an extended period exceeding the waiting time threshold, it is marked as intersection loitering behavior. The identified semantic tags of driving behavior are written as structured attribute fields into the corresponding state entity nodes to form enhanced state entities.
[0027] It should be noted that by explicitly embedding the semantics of micro-driving behavior into state entities, traffic conditions are no longer represented solely by macro-indicators such as speed, but rather by a combination of human driving intentions and operational characteristics. This enables the identification of infrequent congestion sources without external event triggers, and enhances the ability to perceive and attribute occasional and localized congestion phenomena.
[0028] S3. Construct a regular hexagonal grid system, spatially align enhanced state entities, road network data, and point of interest (POI) data with grid cells, and establish a traffic spatiotemporal knowledge graph that includes state entities, road segment entities, grid entities, and POI entities.
[0029] Furthermore, using the city's administrative boundaries as the outer region, a fixed-length regular hexagonal grid is generated, with each grid cell assigned a unique integer identifier. For each enhanced state entity, its latitude and longitude coordinates are used as input, and its grid cell is determined by a spatial indexing algorithm. Then, the located_in relation edge is established in the graph database. For each road segment entity, perform spatial intersection operation between its line segment geometry and all grid cells, and establish contained_in relationship edges between grid cells with non-empty intersections and the road segment. For each point of interest (POI), query its corresponding grid cell using its spatial coordinates and establish a belongs_to relationship edge; Four types of nodes are created in the graph database, including status nodes, road segment nodes, grid nodes and POI nodes, and edges are established based on the above spatial relationships to form an initial traffic spatiotemporal knowledge graph.
[0030] It should be noted that using a regular hexagonal grid as a unified spatial organization unit effectively solves the spatial alignment problem of heterogeneous geographic objects such as trajectory points, road segments, and POIs. This not only maintains the original geometric characteristics of each entity but also realizes the coupled expression of cross-modal data at a unified spatial granularity, laying a precise spatial reference foundation for subsequent causal relationship modeling.
[0031] S4. Based on historical state disturbances and changes in road segment traffic status, identify the disturbance transmission relationship between road segments, introduce causal relationship types into the traffic spatiotemporal knowledge graph, construct explicit causal sub-layers, and form a causal-enhanced traffic spatiotemporal knowledge graph.
[0032] Furthermore, for each section of the road The average traffic speed is calculated in batches over time to form a time series. ; For any two road segments that have a topological connection and Calculate from the upstream section Downstream section the transfer entropy of the state variable, expressed as: ; wherein, denotes the average travel speed of the downstream road segment in the time batch , denotes the average travel speed of the upstream road segment in the same time batch, denotes the joint probability or conditional probability distribution; if the transfer entropy is greater than a preset statistical threshold, a propagates_to causal relationship edge is created between the road segment and ; for each POI event , if the density of the state entity in the surrounding grid cell suddenly increases and the average travel speed decreases by more than a speed decrease threshold during its occurrence period, a causes causal relationship edge is created from the POI node to the affected road segment; all the newly added causal relationship edges are integrated into the initial traffic spatiotemporal knowledge graph to form a causal enhanced traffic spatiotemporal knowledge graph with mechanism reasoning capability.
[0033] It should be noted that by introducing the disturbance conduction recognition mechanism based on the transfer entropy and the explicit causal relationship type, the congestion propagation mechanism that can be calculated and reasoned is embedded in the knowledge graph, which enables the system to jump from traditional "correlation association" to "mechanistic causal modeling", and fundamentally supports the traceable and intervenable analysis of congestion evolution paths.
[0034] S5, in response to a congestion query request, determining a time interval and a geographical area specified by the query, and extracting entities and causal relationships covering the spatiotemporal range from the causal enhanced traffic spatiotemporal knowledge graph.
[0035] Further, receiving a congestion query request in natural language form submitted by a user, extracting the target geographical area boundary and time interval from the query through a semantic parsing module; converting the geographical area boundary into a set of grid cell sets ; dividing the time interval into a set of time batches with a granularity of five minutes; filtering all state nodes that meet the following conditions: the grid cell set to which the state node belongs belongs to the set , and the time batch to which the state node belongs belongs to the set ; Extract the road segment nodes, grid nodes, and POI nodes directly connected to the state nodes, and load all the propagates_to and causes causal relationship edges with these nodes as endpoints to form a subgraph for subsequent analysis .
[0036] It should be noted that by automatically parsing natural language queries into spatio-temporal constraints and dynamically extracting corresponding subgraphs, the seamless integration of user intent and underlying knowledge graph is achieved, avoiding the limitations of manually defined query rules and improving the usability and response efficiency of the system in real business scenarios.
[0037] S6, based on the extracted entities and causal relationships, perform multi-hop graph traversal to generate a causal transmission path from the initial disturbance event to the final congestion phenomenon.
[0038] Further, in the subgraph identify all state nodes with average travel speed below the severe congestion threshold as a set of candidate endpoint nodes; For each candidate endpoint node, perform a depth-first search in reverse along the causal relationship edges, with a maximum search depth limit of five hops to ensure that the path has actual physical meaning; During the search process, only paths that meet the time sequence constraint are retained, i.e., the time batches corresponding to each node on the path are strictly decreasing; For each valid causal path , calculate its overall causal strength , the calculation formula is: ; Where, represents the weight of the causal edge , the weight value is the normalized transfer entropy value or event association confidence score; Select the path with the maximum causal strength as the main causal transmission path to generate the final congestion traceability explanation.
[0039] It should be noted that the multi-hop reverse causal traversal with time constraints and path strength quantification mechanism can accurately locate the dominant congestion transmission chain in complex networks, effectively filter noise paths and secondary associations, and ensure that the final output causal path has physical reasonableness, temporal consistency, and decision-making guidance value.
[0040] S7, input the causal transmission path into a large language model agent to generate a congestion traceability report in natural language form, and support counterfactual reasoning based on the causal subgraph layer to evaluate intervention effects.
[0041] Further, map the node types and relationship types in the main causal transmission path to predefined semantic templates; Call a large language model agent to automatically generate a natural language congestion traceability report with clear structure and logical coherence based on the semantic template; Identify an intervenable node in the main causal conduction path, which is a POI event node or a signal-timed adjustable intersection segment node; Temporarily delete the intervenable node and all causal relationship edges emitted by it in the causal enhanced traffic spatiotemporal knowledge graph to form a virtual graph; Repeat the multi-hop graph traversal process on the virtual graph to determine whether the original end-point congestion state disappears or is alleviated; If the end-point congestion state disappears, add intervention suggestions to the congestion traceability report to complete the counterfactual reasoning evaluation; Introduce a congestion alleviation index For supporting quantitative evaluation of intervention effect, the expression is: ; Wherein, represents the congestion score of the end-point state in the original graph, represents the congestion score of the corresponding state in the virtual graph, which is calculated based on the degree and duration of speed deviation from free flow; If is greater than a preset threshold, it is determined that the intervention measure is effective, and the system will include this conclusion in the final output report.
[0042] It should be noted that by converting the structured causal path into a natural language report and combining counterfactual reasoning and congestion alleviation index quantitative evaluation, not only is the "black box intelligence" transformed into "explainable intelligence", but also provides traffic managers with verifiable, comparable, and implementable intervention strategy suggestions, enhancing the practicality and credibility of intelligent analysis results.
[0043] The embodiment also provides a computer device suitable for the case of the knowledge graph-based urban traffic congestion reason intelligent analysis method, which comprises a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to realize the knowledge graph-based urban traffic congestion reason intelligent analysis method proposed in the above embodiment.
[0044] The computer device can be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The communication interface of the computer device is configured to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved by WIFI, an operator network, NFC (Near Field Communication) or other technologies. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0045] The embodiment also provides a storage medium having a computer program stored thereon, the program being executed by a processor to implement the method for intelligently analyzing reasons for urban traffic congestion based on a knowledge graph as described above. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk or an optical disk.
[0046] In summary, the present application constructs a causal enhanced traffic spatio-temporal knowledge graph that integrates driving behavior semantics, spatial grid alignment and explicit causal mechanisms, breaks through the limitations of traditional traffic analysis methods that only rely on macroscopic traffic statistics or static event correlation, realizes the transition from phenomenon description to mechanism understanding, and combines multi-hop causal path reasoning and large language model agents. The present application can not only accurately trace the causes of congestion and generate an interpretable natural language report, but also support quantitative evaluation of intervention effects based on counterfactual reasoning, effectively improving the intelligentization, refinement and decision-making credibility of urban traffic management.
[0047] It should be noted that the above examples are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalently replaced, without departing from the spirit and scope of the technical solutions of the present application, which should be covered in the scope of the claims of the present application.
Claims
1. A knowledge graph-based intelligent analysis method for the causes of urban traffic congestion, characterized in that: include: Collect vehicle trajectory data, road network data, point of interest (POI) data, traffic signal timing data, and meteorological environmental data within the city; State sequences are extracted from vehicle trajectory data, and semantic labels of driving behavior are identified based on the rate of change of speed and the fluctuation of heading angle. The semantic labels of driving behavior are then embedded into the corresponding state entities to form enhanced state entities. Construct a regular hexagonal grid system, spatially align enhanced state entities, road network data, and point of interest (POI) data with grid cells, and establish a traffic spatiotemporal knowledge graph that includes state entities, road segment entities, grid entities, and POI entities; Based on historical state disturbances and changes in road segment traffic status, the disturbance transmission relationship between road segments is identified. Causal relationship types are introduced into the traffic spatiotemporal knowledge graph, and explicit causal sub-layers are constructed to form a causal-enhanced traffic spatiotemporal knowledge graph. In response to congestion query requests, the system determines the specified time interval and geographical region, and extracts entities and causal relationships covering that spatiotemporal range from the causal-enhanced traffic spatiotemporal knowledge graph. Based on the extracted entities and causal relationships, a multi-hop graph traversal is performed to generate a causal transmission path from the initial disturbance event to the final congestion phenomenon; By inputting causal transmission paths into a large language model agent, a congestion source tracing report in natural language form is generated, and counterfactual inference based on causal sublayers is supported to evaluate the effectiveness of interventions.
2. The intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in claim 1, characterized in that: The specific steps for collecting vehicle trajectory data, road network data, point of interest (POI) data, traffic signal timing data, and meteorological environmental data within the urban area are as follows: Location information is continuously recorded at fixed time intervals by positioning terminals deployed on operating vehicles, forming a sequence of original trajectory points consisting of timestamps, longitude, latitude, instantaneous speed, and passenger status; Structured road network data is obtained from the urban traffic geographic information system. The road network data includes a unique identifier for each road segment, a string of geometric coordinates, topological connections, the number of lanes, and the road function level. The point of interest (POI) data is obtained from the electronic map service platform. The POI data includes the name, category, detailed address and spatial coordinates of each POI. The intersection signal timing scheme is obtained from the city traffic signal control center. The signal timing scheme includes the start and end times of the green light for each phase, the duration of the complete cycle, and the phase switching sequence. Real-time meteorological environmental data is obtained from the city's meteorological monitoring station network, including rainfall intensity, horizontal visibility, and wind speed.
3. The intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in claim 2, characterized in that: The process of extracting state sequences based on vehicle trajectory data, identifying driving behavior semantic labels based on the rate of change of speed and heading angle fluctuations, and embedding these driving behavior semantic labels into corresponding state entities to form enhanced state entities involves the following steps: The original trajectory point sequence is divided into multiple consecutive time batches according to a five-minute time window, and the trajectory points in each time batch constitute a state sequence. For the state sequence of the th Calculate the acceleration of each trajectory point. The calculation method is as follows: ; in, Indicates the first The instantaneous velocity of each trajectory point This represents the instantaneous velocity of the previous trajectory point. This represents the time interval between two trajectory points; If acceleration If the acceleration is less than the preset emergency braking threshold and the direction is opposite to the driving direction, the state corresponding to the trajectory point is marked as an emergency braking behavior. Calculate the trajectory points , , The resulting steering angle If the number of times the absolute value of the steering angle exceeds the steering angle threshold within a unit time window is greater than the lane change frequency threshold, it is marked as frequent lane change behavior. If a vehicle remains at a speed below the low-speed threshold and a spatial position deviation distance less than the distance threshold in front of the stop line at an intersection for an extended period exceeding the waiting time threshold, it is marked as intersection loitering behavior. The identified semantic tags of driving behavior are written as structured attribute fields into the corresponding state entity nodes to form enhanced state entities.
4. The intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in claim 3, characterized in that: The construction of the regular hexagonal grid system involves spatially aligning enhanced state entities, road network data, and Points of Interest (POI) data with grid cells to establish a traffic spatiotemporal knowledge graph containing state entities, road segment entities, grid entities, and POI entities. The specific steps are as follows: Using the city's administrative boundaries as the outer region, a regular hexagonal grid with fixed side lengths is generated, and each grid cell is assigned a unique integer identifier. For each enhanced state entity, its latitude and longitude coordinates are used as input, and its grid cell is determined by a spatial indexing algorithm. Then, the located_in relation edge is established in the graph database. For each road segment entity, perform spatial intersection operation between its line segment geometry and all grid cells, and establish contained_in relationship edges between grid cells with non-empty intersections and the road segment. For each point of interest (POI), query its corresponding grid cell using its spatial coordinates and establish a belongs_to relationship edge; Four types of nodes are created in the graph database, including status nodes, road segment nodes, grid nodes and POI nodes, and edges are established based on the above spatial relationships to form an initial traffic spatiotemporal knowledge graph.
5. The intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in claim 4, characterized in that: The method involves identifying the transmission relationship of disturbances between road segments based on historical state disturbances and changes in road segment traffic status, introducing causal relationship types into the traffic spatiotemporal knowledge graph, constructing explicit causal sub-layers, and forming a causal-enhanced traffic spatiotemporal knowledge graph. The specific steps are as follows: For each section The average traffic speed is calculated in batches over time to form a time series. ; For any two road segments that have a topological connection and Calculate from the upstream section Downstream section The transition entropy is expressed as: ; in, Indicates downstream section In time batch Average traffic speed, Indicates the upstream section Average passage speed of batches within the same time period Represents the joint probability or conditional probability distribution; If the transfer entropy If the value exceeds the preset statistical threshold, then in the road segment... and Create propagates_to causal edges between them; For each POI event If, during the period in which the event occurs, the density of state entities in the surrounding grid cells suddenly increases and the average traffic speed decreases by more than the speed decrease threshold, then a cause-effect relationship edge is created from the POI node to the affected road segment. All newly added causal relationship edges are integrated into the initial traffic spatiotemporal knowledge graph to form a causal-enhanced traffic spatiotemporal knowledge graph with mechanism reasoning capabilities.
6. The intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in claim 5, characterized in that: The response to the congestion query request determines the specified time interval and geographical region, and extracts entities and causal relationships covering this spatiotemporal range from the causal-enhanced traffic spatiotemporal knowledge graph. The specific steps are as follows: It receives congestion query requests in natural language format submitted by users and extracts the target geographic region boundaries and time intervals through the semantic parsing module. ; Transform the geographical region boundary into a set of grid cells. ; Time interval Time batches are divided into sets based on a five-minute granularity. ; Filter all state nodes that meet the following condition: their grid cell belongs to the set And its time batch belongs to a set ; Extract the road segment nodes, grid nodes, and POI nodes directly connected to the state nodes, and load all propagates_to and causes causal relationship edges with these nodes as endpoints to form a subgraph for subsequent analysis. .
7. The intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in claim 6, characterized in that: The process of performing multi-hop graph traversal based on the extracted entities and causal relationships to generate a causal transmission path from the initial disturbance event to the final congestion phenomenon includes the following steps: In subgraph The system identifies all state nodes whose average traffic speed is below the severe congestion threshold and uses them as a set of candidate destination nodes. For each candidate endpoint node, perform a depth-first search in reverse along the causal relationship edge, with a maximum search depth limit of five hops to ensure that the path has actual physical meaning; During the search process, only paths that satisfy the time sequence constraint are retained, that is, the time batches corresponding to each node on the path are strictly decreasing. For each valid causal path Calculate its overall causal strength The calculation formula is: ; in, Indicates causal edge The weights are either standardized transfer entropy values or event association confidence scores. The path with the strongest causal strength is selected as the main causal transmission path to generate the final explanation for the congestion.
8. The intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in claim 7, characterized in that: The process of inputting the causal transmission path into the large language model agent to generate a congestion source tracing report in natural language form, and supporting counterfactual inference based on causal sub-layers to evaluate the intervention effect, includes the following specific steps: Map the node types and relation types in the main causal transmission path to predefined semantic templates; The large language model intelligent agent is invoked to automatically generate a natural language congestion source tracing report with a clear structure and logical coherence based on the semantic template; Identify interventionable nodes in the main causal transmission path, wherein the interventionable nodes are POI event nodes or intersection segment nodes with adjustable signal timing; In the causal-enhanced traffic spatiotemporal knowledge graph, the interventionable node and all its causal relationship edges are temporarily deleted to form a virtual graph. Repeat the multi-hop graph traversal process on the virtual graph to determine whether the congestion at the original endpoint has disappeared or eased. If the congestion at the destination disappears, add intervention recommendations to the congestion source tracing report and complete the counterfactual assessment. Introducing a congestion mitigation index The expression used to support the quantitative assessment of intervention effectiveness is: ; in, This represents the congestion score of the endpoint state in the original graph. The congestion score represents the corresponding state in the virtual map. The congestion score is calculated based on the degree of deviation of speed from free flow and the duration of the deviation. like If the value exceeds the preset threshold, the intervention is deemed effective, and the system includes this conclusion in the final output report.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the intelligent analysis method for urban traffic congestion causes based on knowledge graphs as described in any one of claims 1 to 8.