Traffic data analysis method and system
The method addresses demand and service gaps in traffic data analysis by integrating multi-source data and constructing dynamic spatiotemporal graphs to optimize public transportation resource allocation and route planning, enhancing service efficiency and user satisfaction.
Patent Information
- Application Number
- CN202411168738.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-08-23
AI Technical Summary
Existing traffic data analysis systems often ignore demand differences and service gaps between regions, leading to unoptimized allocation of public transportation resources and uneven development of services, failing to meet users' travel needs.
A method involving multi-source data collection, construction of a dynamic spatiotemporal graph, evaluation of public transportation service levels, and formulation of differentiated route planning using graph neural networks and machine learning algorithms to predict demand and recommend optimal routes.
Accurately predicts public transportation demand, optimizes resource allocation, and recommends routes based on real-time data, improving service balance and user satisfaction.
Smart Images

Figure CN119181238A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data analysis, and in particular to a traffic data analysis method and system. Background Art
[0002] In recent years, with the acceleration of urbanization and the continuous increase in traffic demand, urban traffic management and the optimization of public transportation systems have become key research areas. Traffic data analysis technology has played an important role in this process. Traditional urban traffic management systems mainly rely on a single data source, such as traffic flow monitors and GPS data, to conduct real-time monitoring and management of traffic conditions. However, the limitation of this method lies in the singleness of its data source, which often makes it difficult to fully reflect the complexity and dynamic changes of urban traffic.
[0003] In order to solve this problem, in recent years, researchers have proposed a multi-source data fusion method to integrate data from different sources to obtain more comprehensive traffic information. This method can better capture the diversity and complexity of traffic flow and improve the accuracy of traffic forecasts. However, although multi-source data fusion technology has improved the comprehensiveness and accuracy of traffic data to a certain extent, the existing system often ignores the demand differences and service gaps between different regions, resulting in less than optimal allocation of public transportation resources, uneven development of public transportation services in different regions, and failure to meet users' public transportation travel needs. Summary of the invention
[0004] In view of the problems existing in the above-mentioned existing traffic data analysis methods and systems, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is that the existing system often ignores the demand differences and service gaps between different regions, resulting in an unoptimized allocation of public transportation resources, uneven development of public transportation services in different regions, and failure to meet users' public transportation travel needs.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: a traffic data analysis method, which includes collecting multi-source data to form a comprehensive urban traffic data system, constructing a dynamic space-time graph to analyze traffic data in different time and space dimensions to obtain public transportation travel demand in different regions; evaluating the public transportation service level in different regions, and formulating differentiated route planning according to the travel demand and public transportation service level in different regions; predicting the vehicle traffic density in different regions and recommending public transportation routes to users based on user travel data.
[0007] As a preferred embodiment of the traffic data analysis method described in the present invention, the collection of multi-source data to form a comprehensive urban traffic data system refers to determining the main data sources including traffic monitoring data, GPS data and social media platform data, collecting data from each data source in real time and pre-processing the data, converting the time and date of all data sources into a unified format and unifying the geographic location information of the data, storing the pre-processed data in a central database to form a comprehensive urban traffic data system and dividing the city into different areas according to geographical regions.
[0008] As a preferred solution of the traffic data analysis method of the present invention, wherein: the construction of a dynamic spatiotemporal graph to analyze traffic data of different time and space dimensions to obtain public transportation travel demand in different regions refers to defining a dynamic graph structure, extracting population and traffic characteristic data from the urban traffic data system, selecting the city's traffic intersections and public transportation stations as nodes, and locating the geographical location of each node using a GIS system and an urban traffic layout map;
[0009] Determine the connecting edges between nodes based on actual traffic routes and public transportation links, integrate population and traffic characteristic data into nodes, use traffic and travel time data to enhance edge attributes, and dynamically update edge weights based on real-time traffic flow data;
[0010] Update the states of nodes and edges in the graph based on real-time data obtained from the urban traffic data system;
[0011] Construct a spatiotemporal tensor network based on the defined nodes and edges, including a spatial tensor graph and a temporal tensor graph:
[0012] The construction of the spatial tensor graph refers to measuring the actual distance between nodes by collecting GIS data, and determining the spatial relationship between nodes based on the geographical distance and traffic flow connection between nodes;
[0013] The connection weights between nodes are calculated based on the traffic flow and commuting data between nodes, and the spatial relationship and weight are converted into a multi-dimensional tensor. Each dimension represents a node, and the connection between nodes is represented by the weight of the tensor.
[0014] The construction of the time tensor graph refers to collecting the time series data of each node, including the daily traffic flow and the impact of special events, creating an independent layer for each time point, each layer represents the traffic status in a time period, and defining the connection between layers through time dependency description;
[0015] Use the projected entanglement pair algorithm to optimize the space-time tensor network, convert the data in the space-time tensor network into a multidimensional array form, select the tensor format according to the dimension and structure of the data, set the core parameters of the projected entanglement pair algorithm, including the virtual dimension and the number of optimization iterations, and use simulation data to test different parameter settings to select the best parameter combination;
[0016] Input multidimensional data into the projected entanglement pair algorithm for tensor decomposition processing, simplify the complex multidimensional data into a format that is easy to manage and analyze, and use the gradient descent algorithm to regularly optimize the parameters of the tensor network based on the latest spatiotemporal data;
[0017] Design a multi-layer graph convolutional network structure, where each layer is responsible for processing node features and integrating information about neighboring nodes, and configures the network layer through residual connections;
[0018] Update the feature representation of each node using the graph convolution formula:
[0019]
[0020] In the formula, is the feature representation of node v at layer l+1, is the feature vector of node v in the lth layer, N(v) is the set of neighbor nodes of node v, and W (l) is the learnable weight matrix of the lth layer, σ is the nonlinear activation function ReLU, c vu is the number of neighbors of node v, u is the neighbor node of node v, is the feature representation of node u at layer l;
[0021] For each node, aggregate its own and neighbor's features to obtain a new node representation, use historical traffic data to train the model and define the cross entropy loss function, calculate the gradient of the loss function with respect to each weight through the back propagation algorithm, apply gradient descent to update the weight, and calculate the model loss in real time during the training process. If the model loss does not decrease in three consecutive cycles, stop training to obtain the graph neural network model.
[0022] The graph neural network model is deployed in the central database to receive traffic data in real time and predict the travel demand of public transportation in various regions.
[0023] As a preferred solution of the traffic data analysis method of the present invention, wherein: the evaluation of the public transportation service level of different regions refers to obtaining the vehicle load rate, on-time rate and passenger flow of the region from the urban traffic data system, obtaining the line coverage rate and station accessibility of the public transportation service through GIS and
[0024] Group the collected data into time periods;
[0025] Analyze vehicle load factor data to identify problem areas and time periods of overload and low vehicle utilization;
[0026] Analyze on-time performance data to assess the reliability of public transportation services during peak traffic periods;
[0027] Analyze passenger flow data to assess whether service demand is being met on major routes and stations;
[0028] Analyze route coverage to assess the coverage of public transportation services in different areas;
[0029] Analyze station accessibility data to analyze the average walking distance residents need to visit the nearest station;
[0030] The obtained analysis results are integrated to identify areas with insufficient public transportation services.
[0031] As a preferred solution of the traffic data analysis method of the present invention, wherein: the formulation of differentiated route planning according to the travel demand and public transportation service level of different regions refers to using the K-means clustering algorithm to classify different areas of the city into high-demand areas and low-demand areas according to traffic demand, and compile a demand characteristic report for each cluster area, including high-demand time periods, passenger preferences and service shortage points;
[0032] Based on the public transportation travel demand and public transportation service level of each region, identify the areas where public transportation travel demand is high but public transportation service level is insufficient. Use GIS tools and data visualization technology to map the specific locations where public transportation travel demand and public transportation service level do not match, and take this area as the primary route optimization target;
[0033] For areas with insufficient public transportation services, formulate strategies to increase public transportation resources, including increasing frequency, extending operating hours, adding new routes, and adjusting existing routes;
[0034] For areas with excess public transportation services, reduce the allocation of public transportation resources in the area, optimize existing routes and merge uneconomical public transportation routes, and reallocate resources to areas with higher public transportation travel demand.
[0035] As a preferred solution of the traffic data analysis method of the present invention, wherein: the prediction of vehicle traffic density in different areas refers to using a convolutional neural network to construct a traffic density prediction model, including an input layer, a convolution layer, a pooling layer and an output layer;
[0036] Use historical traffic flow data as a training set to input the traffic density prediction model for iterative training, define the loss function and Adam optimizer to iteratively optimize the model parameters, and stop iterating when the loss of the demand prediction model no longer decreases significantly during continuous iterations, output the model parameters and update the traffic density prediction model;
[0037] The real-time traffic flow data is input into the traffic density prediction model to obtain the future vehicle traffic density of each area.
[0038] As a preferred solution of the traffic data analysis method of the present invention, wherein: the recommending public transportation routes for users based on user travel data refers to collecting the user's historical travel data including common routes, travel time and frequency, and preference settings, preprocessing the collected data and using the K-means clustering algorithm to classify the users into morning rush hour commuters and weekend travelers based on the user data, using the Apriori algorithm to identify the user's frequent travel combinations, including common starting and destination sites, integrating future vehicle traffic density data and generating a feature vector for each planned public transportation route, including route length, vehicle traffic density, and historical user selection frequency;
[0039] Using the random forest model, historical user travel data is used as training data to input into the random forest model for training. The cross-validation method is used to optimize the number of trees and the depth of the random forest and iterate until the model performance is no longer significantly improved. Then the iteration is stopped to obtain a trained random forest model. The generated feature vector is input into the random forest model to obtain the score of each planned public transportation route. The public transportation routes are sorted in descending order by score, and the public transportation route with the highest score is selected as the optimal public transportation route and pushed to the user in real time.
[0040] Another object of the present invention is to provide a traffic data analysis system, which comprises:
[0041] Data collection module, used to collect traffic data from multiple data sources and store it in the central database after pre-processing to form a comprehensive urban traffic data system;
[0042] The data analysis module is used to build a dynamic graph structure and a spatiotemporal tensor network based on real-time traffic data in the urban traffic data system and predict the travel demand of public transportation in each region through a graph neural network;
[0043] Level assessment module, used to analyze the traffic data of each area in real time to assess the public transportation service level of each area;
[0044] Route planning module, used to plan public transportation routes in various regions based on the travel demand and service level of public transportation in various regions;
[0045] The personalized travel module is used to recommend public transportation routes to users in real time based on the planned public transportation routes and according to the user's travel data and the vehicle traffic density of each public transportation route.
[0046] A computer device comprises: a memory and a processor; the memory stores a computer program, and the processor implements the steps of a traffic data analysis method when executing the computer program.
[0047] A computer-readable storage medium stores a computer program, which implements the steps of a traffic data analysis method when executed by a processor.
[0048] The beneficial effects of the present invention are as follows: the present invention collects and integrates multi-source data, constructs a dynamic spatiotemporal graph to analyze traffic data in different time and space dimensions, thereby accurately predicting public transportation demand in different regions. It can not only capture the complex characteristics of traffic flow more comprehensively, but also formulate differentiated route planning according to the evaluation results of public transportation service levels and recommend the best public transportation routes to users based on predicted traffic density, thereby improving the balance of public transportation services and meeting the public transportation travel needs of regional users. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0050] Figure 1 Schematic diagram of the flow of traffic data analysis method.
[0051] Figure 2 Schematic diagram of the implementation of public transportation service level assessment in different areas.
[0052] Figure 3 This is a structural diagram of the traffic data analysis system. DETAILED DESCRIPTION
[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0054] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0055] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.
[0056] Example 1
[0057] Reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and provides a traffic data analysis method, the traffic data analysis method comprising:
[0058] S1. Collect multi-source data to form a comprehensive urban traffic data system, build a dynamic spatiotemporal graph to analyze traffic data in different time and space dimensions to obtain public transportation travel demand in different regions;
[0059] Specifically, collecting multi-source data to form a comprehensive urban traffic data system means determining the main data sources including traffic monitoring data, GPS data, and social media platform data, collecting data from each data source in real time and pre-processing the data, converting the time and date of all data sources into a unified format and unifying the geographic location information of the data, storing the pre-processed data in a central database to form a comprehensive urban traffic data system and dividing the city into different areas according to geographical regions.
[0060] By integrating data from traffic monitoring, GPS, and social media, a comprehensive urban traffic data system is built. This integration of multi-source data can provide richer and multi-dimensional traffic information, make up for the shortcomings of a single data source, improve the accuracy of traffic condition analysis, store pre-processed data in a central database, centrally manage and maintain it, and provide efficient data storage and retrieval capabilities. This centralized management can improve data security and availability, support large-scale data analysis and processing, provide fast data retrieval and query capabilities, support real-time data analysis and application, and divide the city into different regions based on geographical location, which is conducive to more refined traffic data management and analysis. This regional division can help identify traffic characteristics and needs in different regions and support differentiated traffic management strategies.
[0061] Furthermore, a dynamic spatiotemporal graph is constructed to analyze traffic data in different time and space dimensions to obtain the public transportation travel demand index in different regions, define the dynamic graph structure, extract population and traffic characteristic data from the urban traffic data system, select the city's traffic intersections and public transportation stations as nodes, and use the GIS system and urban traffic layout map to locate the geographical location of each node;
[0062] Determine the connecting edges between nodes based on actual traffic routes and public transportation links, integrate population and traffic characteristic data into nodes, use traffic and travel time data to enhance edge attributes, and dynamically update edge weights based on real-time traffic flow data;
[0063] Update the states of nodes and edges in the graph based on real-time data obtained from the urban traffic data system;
[0064] Construct a spatiotemporal tensor network based on the defined nodes and edges, including a spatial tensor graph and a temporal tensor graph:
[0065] The construction of the spatial tensor graph refers to measuring the actual distance between nodes by collecting GIS data, and determining the spatial relationship between nodes based on the geographical distance and traffic flow connection between nodes;
[0066] The connection weights between nodes are calculated based on the traffic flow and commuting data between nodes, and the spatial relationship and weight are converted into a multi-dimensional tensor. Each dimension represents a node, and the connection between nodes is represented by the weight of the tensor.
[0067] The construction of the time tensor graph refers to collecting the time series data of each node, including the daily traffic flow and the impact of special events (holidays, large-scale events), creating an independent layer for each time point, each layer represents the traffic status in a time period, and defining the connection between layers through the time dependency description (how the traffic flow in the previous period affects the next period);
[0068] Use the projected entanglement pair algorithm to optimize the space-time tensor network, convert the data in the space-time tensor network into a multidimensional array form, select the tensor format according to the dimension and structure of the data, set the core parameters of the projected entanglement pair algorithm, including the virtual dimension and the number of optimization iterations, and use simulation data to test different parameter settings to select the best parameter combination;
[0069] Input multidimensional data into the projected entanglement pair algorithm for tensor decomposition processing, simplify the complex multidimensional data into a format that is easy to manage and analyze, and use the gradient descent algorithm to regularly optimize the parameters of the tensor network based on the latest spatiotemporal data;
[0070] Design a multi-layer graph convolutional network structure, where each layer is responsible for processing node features and integrating information about neighboring nodes, and configures the network layer through residual connections;
[0071] Update the feature representation of each node using the graph convolution formula:
[0072]
[0073] In the formula, is the feature representation of node v at layer l+1, is the feature vector of node v in the lth layer, N(v) is the set of neighbor nodes of node v, and W (l) is the learnable weight matrix of the lth layer, σ is the nonlinear activation function ReLU, c vu is the number of neighbors of node v, u is the neighbor node of node v, is the feature representation of node u at layer l;
[0074] For each node, aggregate its own and neighbor's features to obtain a new node representation, use historical traffic data to train the model and define the cross entropy loss function, calculate the gradient of the loss function with respect to each weight through the back propagation algorithm, apply gradient descent to update the weight, and calculate the model loss in real time during the training process. If the model loss does not decrease in three consecutive cycles, stop training to obtain the graph neural network model.
[0075] The graph neural network model is deployed in the central database to receive traffic data in real time and predict the travel demand of public transportation in various regions.
[0076] A dynamic graph structure refers to a data structure in which the attributes of nodes and edges change dynamically over time. In this embodiment, the dynamic graph structure is used to describe the real-time changes of the urban traffic network and reflect the dynamic update of traffic flow and node characteristics. A space-time tensor network is a multidimensional data structure that integrates time and space dimensions. In this embodiment, the space-time tensor network is used to describe the complex space-time relationship of traffic data, including a space tensor graph and a time tensor graph. The projected entanglement pair state algorithm is an algorithm for processing and optimizing tensor networks.
[0077] By converting complex multidimensional data into a form that is easier to manage and analyze through tensor decomposition, the dynamic spatiotemporal graph structure can update the status of nodes and edges based on real-time traffic flow data to reflect the latest traffic conditions. This dynamic update mechanism ensures the real-time and accuracy of the traffic model. By integrating population and traffic characteristic data, as well as traffic routes and public transportation connections, the dynamic spatiotemporal graph provides a comprehensive perspective on traffic data analysis, which can better capture the complexity of urban transportation networks. The spatiotemporal tensor network provides a multidimensional perspective on traffic data by integrating data in spatial and temporal dimensions. This integration enables the model to capture the temporal and spatial dependencies of traffic flows, improving the accuracy of traffic predictions. The projected entanglement pair algorithm is used to optimize the space-time tensor network, simplifying complex multi-dimensional data into a format that is easy to manage and analyze, improving the efficiency and accuracy of data processing. Through multi-layer convolution operations and residual connections, GCN can effectively integrate the features of nodes and their neighbors, improving the accuracy of node feature representation, and using the gradient descent algorithm and cross entropy loss function to optimize model parameters in real time to ensure that the model continuously improves its performance during training. The GCN model can process and predict traffic data in real time, provide the latest traffic demand forecast results, support traffic management and optimization decisions, and by continuously optimizing and updating model parameters, the GCN model can provide highly accurate traffic forecasts and improve the operating efficiency of public transportation systems.
[0078] S2. Evaluate the public transportation service level in different regions and formulate differentiated route plans based on the travel needs and public transportation service level in different regions;
[0079] Specifically, evaluating the public transportation service level in different regions means obtaining the vehicle load rate, punctuality rate and passenger flow of the region from the urban transportation data system, obtaining the line coverage rate and station accessibility of the public transportation service through GIS, and
[0080] Group the collected data into time periods;
[0081] Analyze vehicle load factor data to identify problem areas and time periods of overload and low vehicle utilization;
[0082] Analyze on-time performance data to assess the reliability of public transportation services during peak traffic periods;
[0083] Analyze passenger flow data to assess whether service demand is being met on major routes and stations;
[0084] Analyze route coverage to assess the coverage of public transportation services in different areas;
[0085] Analyze station accessibility data to analyze the average walking distance residents need to visit the nearest station;
[0086] The obtained analysis results are integrated to identify areas with insufficient public transportation services.
[0087] By obtaining vehicle load factor, on-time rate and passenger flow data from the urban traffic data system, combined with line coverage and station accessibility data obtained from the GIS system, the comprehensiveness and accuracy of the data are ensured. This comprehensive data collection method can provide a reliable basis for subsequent analysis. By analyzing the vehicle load factor data, problem areas and time periods of overload and low vehicle utilization can be identified. Overloaded areas need to increase capacity, while areas with low utilization rates need to optimize resource allocation. After identifying problem areas, measures can be taken to improve service quality, reduce passenger congestion, and improve passengers' travel experience. By analyzing the punctuality data of the flights, the reliability of public transportation services during peak traffic hours can be evaluated, and problems such as flight delays and lateness can be identified. For flights with low punctuality rates, measures can be taken to improve the punctuality rate to ensure the timeliness and reliability of public transportation services. By analyzing passenger flow data, the service demand satisfaction of major routes and stations can be evaluated, and areas with excessively high or low demand can be identified. According to the passenger flow analysis results, the routes and frequency of flights can be adjusted to ensure that public transportation services can meet the actual needs of passengers. Line coverage data can be analyzed to evaluate the coverage of public transportation services in different areas and identify areas with insufficient services. By analyzing the site accessibility data, the average walking distance for residents to visit the nearest site can be evaluated and areas with poor accessibility can be identified. All analysis results can be integrated to identify areas with insufficient public transportation service levels, helping decision makers to formulate improvement measures. By identifying and improving areas with insufficient services, the service level and efficiency of the entire public transportation system can be improved.
[0088] Furthermore, formulating differentiated route planning based on the travel demand and public transportation service level of different regions means using the K-means clustering algorithm to classify different urban areas into high-demand areas and low-demand areas according to transportation demand, and compiling a demand characteristic report for each cluster area, including high-demand time periods, passenger preferences, and under-service points;
[0089] Based on the public transportation travel demand and public transportation service level of each region, identify the areas where public transportation travel demand is high but public transportation service level is insufficient. Use GIS tools and data visualization technology to map the specific locations where public transportation travel demand and public transportation service level do not match, and take this area as the primary route optimization target;
[0090] For areas with insufficient public transportation services, formulate strategies to increase public transportation resources, including increasing frequency, extending operating hours, adding new routes, and adjusting existing routes;
[0091] For areas with excess public transportation services, reduce the allocation of public transportation resources in the area, optimize existing routes and merge uneconomical public transportation routes, and reallocate resources to areas with higher public transportation travel demand.
[0092] Through the K-means clustering algorithm, different areas of the city can be accurately divided into high-demand areas and low-demand areas according to traffic demand. This can better understand the traffic demand characteristics of each area, so as to formulate more effective public transportation planning strategies. The K-means algorithm can process large amounts of data and perform automated analysis, reducing the errors and workload of manual classification and improving work efficiency. By analyzing the public transportation travel demand and service level of each region, areas with high public transportation travel demand and insufficient service level are identified. These problem areas can be used as the focus of public transportation resource optimization to ensure that limited resources are used in the most needed places. Using GIS tools and data visualization technology, the specific locations where public transportation travel demand and service level do not match can be mapped, providing intuitive and visual decision support. For areas with insufficient service levels, increasing the frequency, extending the operating hours, adding new routes and adjusting existing routes can significantly improve the public transportation service level in these areas and meet the travel needs of passengers. By increasing resource investment and optimizing route design, the coverage and convenience of public transportation services can be improved, and the waiting time and travel inconvenience of passengers can be reduced. For areas with excessive public transportation service levels, reducing resource allocation can save operating costs, and the saved resources can be reallocated to areas with higher demand to improve resource utilization efficiency. By optimizing existing routes and merging uneconomical routes, duplication and inefficient services can be reduced and the operational efficiency of the overall route network can be improved.
[0093] S3, predicting vehicle traffic density in different areas and recommending public transportation routes for users based on their travel data;
[0094] Specifically, predicting vehicle traffic density in different areas refers to building a traffic density prediction model using a convolutional neural network, including an input layer, a convolution layer, a pooling layer, and an output layer;
[0095] Use historical traffic flow data as a training set to input the traffic density prediction model for iterative training, define the loss function and Adam optimizer to iteratively optimize the model parameters, and stop iterating when the loss of the demand prediction model no longer decreases significantly during continuous iterations, output the model parameters and update the traffic density prediction model;
[0096] The real-time traffic flow data is input into the traffic density prediction model to obtain the future vehicle traffic density of each area.
[0097] Through the convolutional layer of the convolutional neural network (CNN), the spatiotemporal features in the traffic flow data can be effectively extracted to improve the prediction accuracy of the model. The pooling layer reduces the computational complexity of the model through dimensionality reduction processing, while preventing overfitting problems and improving the generalization ability of the model. By using historical traffic flow data as a training set, the CNN model can learn the historical patterns and laws of traffic flow and improve the accuracy of prediction. By defining the loss function and using the Adam optimizer to iteratively optimize the model parameters, it ensures that the model can continuously converge to the optimal solution during the training process and improve the prediction performance. By inputting real-time traffic flow data into the trained CNN model, the future vehicle traffic density prediction results of each region can be obtained in real time, providing timely traffic information.
[0098] Further, recommending public transportation routes for users based on user travel data refers to collecting historical travel data of users including common routes, travel time and frequency, and preference settings, preprocessing the collected data and using a K-means clustering algorithm to classify users into morning peak commuters and weekend travelers based on the user data, using an Apriori algorithm to identify frequent travel combinations of users, including common starting and destination stations, integrating future vehicle traffic density data and generating a feature vector for each planned public transportation route, including route length, vehicle traffic density, and historical user selection frequency;
[0099] Using the random forest model, historical user travel data is used as training data to input into the random forest model for training. The cross-validation method is used to optimize the number of trees and the depth of the random forest and iterate until the model performance is no longer significantly improved. Then the iteration is stopped to obtain a trained random forest model. The generated feature vector is input into the random forest model to obtain the score of each planned public transportation route. The public transportation routes are sorted in descending order by score, and the public transportation route with the highest score is selected as the optimal public transportation route and pushed to the user in real time.
[0100] The Apriori algorithm is a classic algorithm for frequent item set mining and association rule learning. In this embodiment, the Apriori algorithm is used to identify users' frequent travel combinations, such as frequently used starting and destination sites. By collecting users' historical travel data, including frequently used routes, travel time and frequency, and preference settings, it is possible to fully understand users' travel habits and needs, providing a basis for subsequent personalized recommendations. The K-means clustering algorithm is used to classify users into morning rush hour commuters and weekend travelers based on user data, and the travel modes of different types of users can be identified to improve the pertinence and effectiveness of recommendations. The Apriori algorithm is used to identify users' frequent travel combinations, and it is possible to understand users' frequently used starting and destination sites, providing an important reference for route recommendations and integrating future car The vehicle traffic density data and the feature vector of each planned public transportation route are generated, including route length, vehicle traffic density and historical user selection frequency, to ensure that the recommendation model takes multiple factors into consideration, and uses historical user travel data as training data to input the random forest model for training. The number and depth of trees are optimized through cross-validation to ensure that the model performs stably and well on different data sets, and the real-time traffic flow data is input into the traffic density prediction model to obtain the future vehicle traffic density of each area to ensure that the recommendation results can reflect the latest traffic conditions. The generated feature vector is input into the trained random forest model to obtain the score of each planned public transportation route, and the public transportation routes are sorted in descending order by score, and the public transportation route with the highest score is selected as the optimal public transportation route and pushed to users in real time.
[0101] Example 2
[0102] Reference Figure 3 , which is a second embodiment of the present invention, and which is different from the previous embodiment, provides a traffic data analysis system, which includes:
[0103] Data collection module, used to collect traffic data from multiple data sources and store it in the central database after pre-processing to form a comprehensive urban traffic data system;
[0104] The data analysis module is used to build a dynamic graph structure and a spatiotemporal tensor network based on real-time traffic data in the urban traffic data system and predict the travel demand of public transportation in each region through a graph neural network;
[0105] Level assessment module, used to analyze the traffic data of each area in real time to assess the public transportation service level of each area;
[0106] Route planning module, used to plan public transportation routes in various regions based on the travel demand and service level of public transportation in various regions;
[0107] The personalized travel module is used to recommend public transportation routes to users in real time based on the planned public transportation routes and according to the user's travel data and the vehicle traffic density of each public transportation route.
[0108] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0109] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0110] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0111] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
Claims
1. A traffic data analysis method, characterized in that: include, Collect multi-source data to form a comprehensive urban traffic data system, build a dynamic spatiotemporal graph to analyze traffic data in different time and space dimensions to obtain public transportation travel needs in different regions; Evaluate the public transportation service levels in different regions and formulate differentiated route plans based on the travel needs and public transportation service levels in different regions; Predict vehicle traffic density in different areas and recommend public transportation routes to users based on their travel data.
2. The traffic data analysis method according to claim 1, characterized in that: The said collecting of multi-source data to form a comprehensive urban traffic data system refers to determining the main data sources including traffic monitoring data, GPS data and social media platform data, collecting data from each data source in real time and pre-processing the data, converting the time and date of all data sources into a unified format and unifying the geographic location information of the data, storing the pre-processed data into a central database to form a comprehensive urban traffic data system and divide the city into different areas according to geographical regions.
3. The traffic data analysis method according to claim 2, characterized in that: The construction of the dynamic spatiotemporal graph analyzes traffic data of different time and space dimensions to obtain public transportation travel demand in different regions, and defines the dynamic graph structure, extracts population and traffic characteristic data from the urban traffic data system, selects the traffic intersections and public transportation stations of the city as nodes, and locates the geographical location of each node using the GIS system and the urban traffic layout map; Determine the connecting edges between nodes based on actual traffic routes and public transportation links, integrate population and traffic characteristic data into nodes, use traffic and travel time data to enhance edge attributes, and dynamically update edge weights based on real-time traffic flow data; Update the states of nodes and edges in the graph based on real-time data obtained from the urban traffic data system; Construct a spatiotemporal tensor network based on the defined nodes and edges, including a spatial tensor graph and a temporal tensor graph: The construction of the spatial tensor graph refers to measuring the actual distance between nodes by collecting GIS data, and determining the spatial relationship between nodes based on the geographical distance and traffic flow connection between nodes; The connection weights between nodes are calculated based on the traffic flow and commuting data between nodes, and the spatial relationship and weight are converted into a multi-dimensional tensor. Each dimension represents a node, and the connection between nodes is represented by the weight of the tensor. The construction of the time tensor graph refers to collecting the time series data of each node, including the daily traffic flow and the impact of special events, creating an independent layer for each time point, each layer represents the traffic status in a time period, and defining the connection between layers through time dependency description; Use the projected entanglement pair algorithm to optimize the space-time tensor network, convert the data in the space-time tensor network into a multidimensional array form, select the tensor format according to the dimension and structure of the data, set the core parameters of the projected entanglement pair algorithm, including the virtual dimension and the number of optimization iterations, and use simulation data to test different parameter settings to select the best parameter combination; Input multidimensional data into the projected entanglement pair algorithm for tensor decomposition processing, simplify the complex multidimensional data into a format that is easy to manage and analyze, and use the gradient descent algorithm to regularly optimize the parameters of the tensor network based on the latest spatiotemporal data; Design a multi-layer graph convolutional network structure, where each layer is responsible for processing node features and integrating information about neighboring nodes, and configures the network layer through residual connections; Update the feature representation of each node using the graph convolution formula: In the formula, is the feature representation of node v at layer l+1, is the feature vector of node v in the lth layer, N(v) is the set of neighbor nodes of node v, and W (l) is the learnable weight matrix of the lth layer, σ is the nonlinear activation function ReLU, c vu is the number of neighbors of node v, u is the neighbor node of node v, is the feature representation of node u at layer l; For each node, aggregate its own and neighbor's features to obtain a new node representation, use historical traffic data to train the model and define the cross entropy loss function, calculate the gradient of the loss function with respect to each weight through the back propagation algorithm, apply gradient descent to update the weight, and calculate the model loss in real time during the training process. If the model loss does not decrease in three consecutive cycles, stop training to obtain the graph neural network model. The graph neural network model is deployed in the central database to receive traffic data in real time and predict the travel demand of public transportation in various regions.
4. The traffic data analysis method according to claim 3, characterized in that: The evaluation of the public transportation service level in different regions refers to obtaining the vehicle load rate, on-time rate and passenger flow of the region from the urban transportation data system, obtaining the line coverage and station accessibility of the public transportation service through GIS, and grouping the collected data according to time periods; Analyze vehicle load factor data to identify problem areas and time periods of overload and low vehicle utilization; Analyze on-time performance data to assess the reliability of public transportation services during peak traffic periods; Analyze passenger flow data to assess whether service demand is being met on major routes and stations; Analyze route coverage to assess the coverage of public transportation services in different areas; Analyze station accessibility data to analyze the average walking distance residents need to visit the nearest station; The obtained analysis results are integrated to identify areas with insufficient public transportation services.
5. The traffic data analysis method according to claim 4, characterized in that: The said formulating differentiated route planning according to the travel demand and public transportation service level of different regions refers to using the K-means clustering algorithm to classify different areas of the city into high-demand areas and low-demand areas according to traffic demand, and compiling a demand characteristic report for each cluster area, including high-demand time periods, passenger preferences and service shortage points; Based on the public transportation travel demand and public transportation service level of each region, identify the areas where public transportation travel demand is high but public transportation service level is insufficient. Use GIS tools and data visualization technology to map the specific locations where public transportation travel demand and public transportation service level do not match, and take this area as the primary route optimization target; For areas with insufficient public transportation services, formulate strategies to increase public transportation resources, including increasing frequency, extending operating hours, adding new routes, and adjusting existing routes; For areas with excess public transportation services, reduce the allocation of public transportation resources in the area, optimize existing routes and merge uneconomical public transportation routes, and reallocate resources to areas with higher public transportation travel demand.
6. The traffic data analysis method according to claim 5, characterized in that: The prediction of vehicle traffic density in different areas refers to building a traffic density prediction model using a convolutional neural network, including an input layer, a convolution layer, a pooling layer, and an output layer; Use historical traffic flow data as a training set to input the traffic density prediction model for iterative training, define the loss function and Adam optimizer to iteratively optimize the model parameters, and stop iterating when the loss of the demand prediction model no longer decreases significantly during continuous iterations, output the model parameters and update the traffic density prediction model; The real-time traffic flow data is input into the traffic density prediction model to obtain the future vehicle traffic density of each area.
7. The traffic data analysis method according to claim 6, characterized in that: The recommending of public transportation routes for users based on user travel data refers to collecting historical travel data of users including commonly used routes, travel time and frequency, and preference settings, preprocessing the collected data and using a K-means clustering algorithm to classify users into morning rush hour commuters and weekend travelers based on user data, using an Apriori algorithm to identify frequent travel combinations of users, including commonly used starting and destination stations, integrating future vehicle traffic density data and generating a feature vector for each planned public transportation route, including route length, vehicle traffic density, and historical user selection frequency; Using the random forest model, historical user travel data is used as training data to input into the random forest model for training. The cross-validation method is used to optimize the number of trees and the depth of the random forest and iterate until the model performance is no longer significantly improved. Then the iteration is stopped to obtain a trained random forest model. The generated feature vector is input into the random forest model to obtain the score of each planned public transportation route. The public transportation routes are sorted in descending order by score, and the public transportation route with the highest score is selected as the optimal public transportation route and pushed to the user in real time.
8. A traffic data analysis system based on the traffic data analysis method according to any one of claims 1 to 7, characterized in that: include, Data collection module, used to collect traffic data from multiple data sources and store it in the central database after pre-processing to form a comprehensive urban traffic data system; The data analysis module is used to build a dynamic graph structure and a spatiotemporal tensor network based on real-time traffic data in the urban traffic data system and predict the travel demand of public transportation in each region through a graph neural network; Level assessment module, used to analyze the traffic data of each area in real time to assess the public transportation service level of each area; Route planning module, used to plan public transportation routes in various regions based on the travel demand and service level of public transportation in various regions; The personalized travel module is used to recommend public transportation routes to users in real time based on the planned public transportation routes and according to the user's travel data and the vehicle traffic density of each public transportation route.
9. A computer device comprising: Memory and processor; The memory stores a computer program, wherein the processor implements the steps of the traffic data analysis method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the traffic data analysis method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Gray prediction and support vector machine-based classification type electric vehicle demand temporal-spatial distribution dynamic prediction method
CN107146013A
Road condition information fusion analysis method and device, and storage medium
CN111429744A
Traffic data tensor completion method based on space-time constraint
CN115630211A
Inter-city cross-regional mobility prediction method and device based on private car travel trajectory data
CN116052427A
Public transport station layout optimization method
CN117196197A
Cited By
Urban traffic intelligent planning auxiliary system and method based on big data analysis
CN119918767A
Low-altitude logistics route planning method, system, equipment, medium and product
CN121457725A
