Road traffic congestion prediction methods, computer equipment, and readable storage media
By acquiring road traffic data, extracting traffic flow density and average speed, and using time-series prediction and fuzzy rules to assess traffic congestion status, this technology solves the problem that existing technologies cannot accurately reflect the continuity and fuzziness of road congestion, thus achieving accuracy and precision in traffic congestion prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies cannot accurately reflect the continuity and ambiguity of road congestion, resulting in significant discrepancies between traffic congestion assessments and actual conditions.
By acquiring road traffic data, extracting traffic flow density and average traffic speed, using a time-series prediction model for prediction, and combining a fuzzy rule base for traffic congestion status assessment, the system outputs traffic congestion probability and early warning information.
It enables accurate assessment of traffic congestion status and accurate prediction of future time periods, improving the accuracy of prediction and reflecting the continuity and ambiguity of road congestion.
Smart Images

Figure CN120412270B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of traffic management technology, and in particular to a method for predicting road traffic congestion, a computer device, and a computer-readable storage medium. Background Technology
[0002] With the acceleration of urbanization and the rapid growth of motor vehicle ownership, urban traffic congestion has become increasingly serious and has become one of the important factors restricting the sustainable development of cities. Therefore, accurately predicting the traffic congestion of urban expressways is of great significance for optimizing traffic management and alleviating traffic congestion.
[0003] Currently, related technologies typically use simple threshold methods to define road congestion status, which lacks precise quantification of the degree of road congestion and cannot accurately reflect the continuity and fuzziness of road congestion. As a result, the road congestion assessment results deviate significantly from the actual situation. Summary of the Invention
[0004] This application provides a road traffic congestion prediction method, computer equipment, and computer-readable storage medium, which can accurately assess the traffic congestion status based on traffic flow density and average traffic speed, and accurately predict the probability of traffic congestion in future time periods. It can reflect the continuity and fuzziness characteristics of road congestion and improve the accuracy of traffic congestion prediction.
[0005] Firstly, this application provides a method for predicting road traffic congestion, the method comprising:
[0006] Acquire road traffic data for the target road; extract traffic parameters from the road traffic data to obtain the first traffic flow density and the first average traffic flow speed of the target road in the current time period; perform time-series prediction of the traffic parameters of the target road based on the first traffic flow density and the first average traffic flow speed to obtain the second traffic flow density and the second average traffic flow speed of the target road in the future time period; predict the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in the future time period.
[0007] In some embodiments, the step of extracting traffic parameters from the road traffic data to obtain the first traffic flow density and the first average traffic flow speed of the target road in the current time period includes:
[0008] The road traffic data is filtered by vehicle trajectory to obtain vehicle trajectory information corresponding to the target road; the vehicle identification number and driving data of each vehicle on the target road are extracted from the vehicle trajectory information; the first traffic flow density corresponding to the target road is determined based on the vehicle identification number of each vehicle, and the first average speed of the traffic flow corresponding to the target road is determined based on the driving data of each vehicle.
[0009] In some embodiments, determining the first traffic density corresponding to the target road based on the vehicle identification number of each vehicle includes:
[0010] Vehicle type identification is performed based on the vehicle identification number of each vehicle, and the number of vehicles corresponding to each vehicle type on the target road is counted; vehicle type conversion is performed on the number of vehicles corresponding to each vehicle type to obtain the equivalent number of vehicles corresponding to the target road; traffic flow density is calculated based on the equivalent number of vehicles and the number of vehicles corresponding to each vehicle type to obtain the first traffic flow density.
[0011] In some embodiments, determining the first average speed of traffic flow corresponding to the target road based on the driving data of each vehicle includes:
[0012] Based on the driving data of each vehicle, the driving speed of each vehicle in the driving direction is statistically analyzed within a preset time period; anomaly detection of the driving speed of each vehicle is performed based on the interquartile range method, and outliers in the driving speed of each vehicle are deleted; the average speed of the driving speed after deleting outliers is calculated to obtain the average speed of the first traffic flow.
[0013] In some embodiments, the method of calculating the speed of each vehicle in the driving direction within a preset time period based on the driving data of each vehicle further includes:
[0014] For each vehicle, a missing value detection is performed on its driving speed, and a target vehicle with a missing driving speed at the first moment is identified. It is then determined whether the driving data contains the driving speed of the target vehicle at a time adjacent to the first moment. If it does, the driving speed of the target vehicle at the first moment is determined based on the driving speed of the target vehicle at the adjacent time. If it does not, the driving speed of the target vehicle at the first moment is determined based on the driving speed of other vehicles in the adjacent lanes of the target vehicle at the first moment.
[0015] In some embodiments, the step of performing time-series prediction of traffic parameters of the target road based on the first traffic flow density and the first average traffic flow speed to obtain a second traffic flow density and a second average traffic flow speed of the target road in a future time period includes:
[0016] The first traffic flow density is input into a preset time-series prediction model for time-series prediction to obtain the second traffic flow density; the first average traffic flow speed is input into the time-series prediction model for time-series prediction to obtain the second average traffic flow speed.
[0017] In some embodiments, the step of inputting the first traffic flow density into a preset time-series prediction model for time-series prediction to obtain the second traffic flow density includes:
[0018] Perform a Fast Fourier Transform on the first traffic flow density to obtain the significant frequency of the first traffic flow density; determine the period length corresponding to the first traffic flow density based on the significant frequency; and extract features from the first traffic flow density based on the period length to obtain the second traffic flow density.
[0019] In some embodiments, the step of extracting features from the first traffic flow density based on the period length to obtain the second traffic flow density includes:
[0020] The first traffic flow density is dimensionally transformed based on the period length to obtain a two-dimensional tensor corresponding to the first traffic flow density. The row elements of the two-dimensional tensor represent the variation values of the first traffic flow density within the period length, and the column elements represent the variation values of the first traffic flow density within the period length. Feature extraction is performed on the two-dimensional tensor to obtain a first spatiotemporal feature of the first traffic flow density within the period length and a second spatiotemporal feature within the period length. The first spatiotemporal feature and the second spatiotemporal feature are then weighted and aggregated to obtain the second traffic flow density.
[0021] In some embodiments, the step of predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in a future time period includes:
[0022] Based on the triangular membership function, the second traffic flow density and the second average traffic flow speed are fuzzified to obtain a first fuzzy membership set corresponding to the second traffic flow density and a second fuzzy membership set corresponding to the second average traffic flow speed. Each fuzzy rule in a preset fuzzy rule base is activated according to the first and second fuzzy membership sets to obtain an initial activation degree for each fuzzy rule. The initial activation degree of each fuzzy rule is clipped according to the first and second fuzzy membership sets to obtain a target activation degree for each fuzzy rule. The target activation degrees of each fuzzy rule are aggregated to obtain the target activation degree of each fuzzy rule under different traffic congestion states. The target activation degrees of each fuzzy rule under different traffic congestion states are defuzzified to obtain the traffic congestion probability.
[0023] In some embodiments, before activating each fuzzy rule in a preset fuzzy rule base according to the first fuzzy membership set and the second fuzzy membership set to obtain the initial activation degree corresponding to each fuzzy rule, the method further includes:
[0024] Based on the triangular membership function, traffic flow density, average traffic speed, and traffic congestion probability of different values are classified to obtain multiple fuzzy subsets of traffic flow density, average traffic speed, and traffic congestion status. Based on these subsets, a fuzzy rule base is constructed, comprising at least one fuzzy rule, each indicating the mapping relationship between traffic flow density, average traffic speed, and traffic congestion status.
[0025] In some embodiments, after predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in a future time period, the method further includes:
[0026] Based on the preset correspondence between traffic congestion probability and warning level, the target warning level corresponding to the traffic congestion probability is determined; the warning details corresponding to the target warning level are obtained, and traffic congestion prompt information is output according to the warning details. The traffic congestion prompt information includes the expected congestion start time, congestion duration, affected area, and detour suggestions.
[0027] In some embodiments, after predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in a future time period, the method further includes:
[0028] Based on the traffic congestion probability, output the traffic congestion heat map and / or traffic congestion probability time series diagram corresponding to the target road.
[0029] Secondly, this application also provides a computer device, which includes a memory and a processor;
[0030] The memory is used to store computer programs;
[0031] The processor is configured to execute the computer program and, in executing the computer program, implement the road traffic congestion prediction method as described above.
[0032] Thirdly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the road traffic congestion prediction method described above.
[0033] This application discloses a road traffic congestion prediction method, computer equipment, and computer-readable storage medium. By extracting traffic parameters from road traffic data, a first traffic flow density and a first average traffic flow speed of the target road in the current time period are obtained. Based on the first traffic flow density and the first average traffic flow speed, the traffic parameters of the target road are predicted in a time series to obtain a second traffic flow density and a second average traffic flow speed of the target road in a future time period. Based on the second traffic flow density and the second average traffic flow speed, the traffic congestion state of the target road is predicted to obtain the traffic congestion probability of the target road in the future time period. This method can accurately assess the traffic congestion state based on traffic flow density and average traffic flow speed and accurately predict the traffic congestion probability in the future time period. It can reflect the continuity and fuzziness characteristics of road congestion and improve the accuracy of predicting the traffic congestion probability. Attached Figure Description
[0034] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application;
[0036] Figure 2This is a schematic flowchart of a road traffic congestion prediction method provided in an embodiment of this application;
[0037] Figure 3 This is a schematic flowchart illustrating a sub-step for extracting traffic parameters provided in an embodiment of this application;
[0038] Figure 4 This is a schematic flowchart illustrating a sub-step of timing prediction provided in an embodiment of this application;
[0039] Figure 5 This is a schematic flowchart illustrating a sub-step of traffic congestion state prediction provided in an embodiment of this application;
[0040] Figure 6 This application provides a traffic congestion heatmap in its embodiments.
[0041] Figure 7 This is a traffic congestion probability time series diagram provided in an embodiment of this application. Detailed Implementation
[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0043] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0044] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0045] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0046] Currently, related technologies typically use simple threshold methods to define road congestion status, which lacks precise quantification of road congestion levels and cannot accurately reflect the continuity and fuzziness of road congestion. In particular, they cannot accurately model the complex nonlinear relationship between traffic density and average traffic speed, resulting in significant deviations between road congestion assessment results and actual conditions.
[0047] Therefore, embodiments of this application provide a road traffic congestion prediction method, a computer device, and a computer-readable storage medium. The road traffic congestion prediction method can be applied to a computer device, enabling accurate assessment of traffic congestion status based on traffic flow density and average traffic speed, and accurate prediction of traffic congestion probability for future time periods. It reflects the continuity and ambiguity of road congestion, solving the problem that related technologies typically use simple threshold methods to define road congestion status, lacking precise quantification of road congestion levels, and failing to accurately reflect the continuity and ambiguity of road congestion, thus leading to significant deviations between road congestion assessment results and actual conditions. This method effectively improves the accuracy of predicting traffic congestion probability.
[0048] It should be noted that the road traffic congestion prediction method provided in this application mainly falls within the technical field of Intelligent Transport Systems (ITS), particularly having significant application value in traffic condition perception, prediction, and early warning subsystems. Furthermore, it provides key technical support in urban traffic monitoring and management, traffic signal control optimization, and vehicle route planning.
[0049] For example, a computer device can be a server or a terminal. The server can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can be an electronic device such as a smartphone, tablet, laptop, or desktop computer.
[0050] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a computer device 1000 provided in an embodiment of this application. The computer device 1000 may include a processor 1001 and a memory 1002, wherein the processor 1001 and the memory 1002 can be connected by a bus, which can be any applicable bus such as an Inter-integrated Circuit (I2C) bus.
[0051] The memory 1002 may include a storage medium and internal memory. The storage medium may be a non-volatile storage medium or a volatile storage medium. The storage medium may store an operating system and computer programs, while the internal memory provides an environment for the computer programs stored in the storage medium to run. The computer programs include program instructions that, when executed, cause the processor to perform the road traffic congestion prediction method described in any embodiment.
[0052] The processor 1001 provides computing and control capabilities to support the operation of the entire computer device 1000.
[0053] The processor 1001 can be a Central Processing Unit (CPU), but it can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or it can be any conventional processor.
[0054] In one embodiment, the processor 1001 is configured to run a computer program stored in the memory 1002 to perform the following steps:
[0055] Acquire road traffic data for the target road; extract traffic parameters from the road traffic data to obtain the first traffic flow density and the first average traffic flow speed of the target road in the current time period; perform time-series prediction of the traffic parameters of the target road based on the first traffic flow density and the first average traffic flow speed to obtain the second traffic flow density and the second average traffic flow speed of the target road in the future time period; predict the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in the future time period.
[0056] In one embodiment, when the processor 1001 extracts traffic parameters from road traffic data to obtain the first traffic flow density and the first average traffic flow speed of the target road in the current time period, it is used to:
[0057] The road traffic data is filtered by vehicle trajectory to obtain the vehicle trajectory information corresponding to the target road; the vehicle identification number and driving data of each vehicle on the target road are extracted from the vehicle trajectory information; the first traffic flow density corresponding to the target road is determined based on the vehicle identification number of each vehicle, and the average speed of the first traffic flow corresponding to the target road is determined based on the driving data of each vehicle.
[0058] In one embodiment, when the processor 1001 determines the first traffic flow density corresponding to the target road based on the vehicle identification number of each vehicle, it is configured to:
[0059] Vehicle type identification is performed based on the vehicle identification number of each vehicle, and the number of vehicles corresponding to each type of vehicle on the target road is counted; the number of vehicles corresponding to each type of vehicle is converted to obtain the equivalent number of vehicles corresponding to the target road; the traffic flow density is calculated based on the equivalent number of vehicles and the number of vehicles corresponding to each type of vehicle to obtain the first traffic flow density.
[0060] In one embodiment, when the processor 1001 determines the first average speed of traffic flow corresponding to the target road based on the driving data of each vehicle, it is configured to:
[0061] The driving speed of each vehicle in the driving direction is calculated based on the driving data of each vehicle within a preset time period; anomaly detection of the driving speed of each vehicle is performed based on the interquartile range method, and outliers in the driving speed of each vehicle are deleted; the average speed of the driving speed after deleting outliers is calculated to obtain the average speed of the first traffic flow.
[0062] In one embodiment, when the processor 1001 calculates the speed of each vehicle in the driving direction within a preset time period based on the driving data of each vehicle, it is also configured to:
[0063] For each vehicle, a missing value detection is performed on its speed, and the target vehicle with a missing speed at the first moment is identified. It is then determined whether the speed of the target vehicle at the moment adjacent to the first moment exists in the driving data. If it exists, the speed of the target vehicle at the first moment is determined based on the speed of the target vehicle at the moment adjacent to the first moment. If it does not exist, the speed of the target vehicle at the first moment is determined based on the speed of other vehicles in the adjacent lanes of the target vehicle.
[0064] In one embodiment, when the processor 1001 performs time-series prediction of traffic parameters of a target road based on a first traffic flow density and a first average traffic flow speed to obtain a second traffic flow density and a second average traffic flow speed for the target road in a future time period, it is configured to:
[0065] The first traffic flow density is input into the preset time-series prediction model for time-series prediction to obtain the second traffic flow density; the first average traffic flow speed is input into the time-series prediction model for time-series prediction to obtain the second average traffic flow speed.
[0066] In one embodiment, when the processor 1001 performs time-series prediction by inputting the first traffic flow density into a preset time-series prediction model to obtain the second traffic flow density, it is used to implement:
[0067] A fast Fourier transform is performed on the first traffic flow density to obtain the significant frequencies of the first traffic flow density; the period length corresponding to the first traffic flow density is determined based on the significant frequencies; and features are extracted from the first traffic flow density based on the period length to obtain the second traffic flow density.
[0068] In one embodiment, when the processor 1001 performs feature extraction on the first traffic flow density based on the cycle length to obtain the second traffic flow density, it is used to implement:
[0069] The first traffic flow density is dimensionally transformed based on the cycle length to obtain a two-dimensional tensor corresponding to the first traffic flow density. In the two-dimensional tensor, the row elements represent the change value of the first traffic flow density between cycle lengths, and the column elements represent the change value of the first traffic flow density within the cycle length. Feature extraction is performed on the two-dimensional tensor to obtain the first spatiotemporal feature of the first traffic flow density between cycle lengths and the second spatiotemporal feature within the cycle length. The first spatiotemporal feature and the second spatiotemporal feature are weighted and aggregated to obtain the second traffic flow density.
[0070] In one embodiment, when the processor 1001 performs traffic congestion state prediction of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in a future time period, it is configured to:
[0071] Based on the triangular membership function, the second traffic flow density and the second traffic flow average speed are fuzzified to obtain the first fuzzy membership set corresponding to the second traffic flow density and the second fuzzy membership set corresponding to the second traffic flow average speed. Each fuzzy rule in the preset fuzzy rule base is activated according to the first and second fuzzy membership sets to obtain the initial activation degree of each fuzzy rule. The initial activation degree of each fuzzy rule is then clipped according to the first and second fuzzy membership sets to obtain the target activation degree of each fuzzy rule. The target activation degrees of each fuzzy rule are then aggregated to obtain the target activation degree of each fuzzy rule under different traffic congestion states. Finally, the target activation degrees of each fuzzy rule under different traffic congestion states are defuzzified to obtain the traffic congestion probability.
[0072] In one embodiment, before the processor 1001 performs rule activation on each fuzzy rule in the preset fuzzy rule base according to the first fuzzy membership set and the second fuzzy membership set to obtain the initial activation degree corresponding to each fuzzy rule, it is also used to perform the following:
[0073] Based on the triangular membership function, traffic flow density, average traffic speed, and traffic congestion probability of different values are classified to obtain multiple fuzzy subsets of traffic flow density, average traffic speed, and traffic congestion status. Based on these subsets, a fuzzy rule base is constructed, which includes at least one fuzzy rule. Each fuzzy rule is used to indicate the mapping relationship between traffic flow density, average traffic speed, and traffic congestion status.
[0074] In one embodiment, after the processor 1001 performs traffic congestion state prediction of the target road based on the second traffic flow density and the second average traffic flow speed, and obtains the traffic congestion probability of the target road in a future time period, it is further configured to:
[0075] Based on the pre-defined correspondence between traffic congestion probability and warning level, the target warning level corresponding to the traffic congestion probability is determined; detailed warning information corresponding to the target warning level is obtained, and traffic congestion prompt information is output according to the detailed warning information. The traffic congestion prompt information includes the expected start time of congestion, the duration of congestion, the scope of impact, and detour suggestions.
[0076] In one embodiment, after the processor 1001 performs traffic congestion state prediction of the target road based on the second traffic flow density and the second average traffic flow speed, and obtains the traffic congestion probability of the target road in a future time period, it is further configured to:
[0077] Based on the traffic congestion probability, output the traffic congestion heat map and / or traffic congestion probability time series diagram corresponding to the target road.
[0078] The following detailed description, in conjunction with the accompanying drawings, outlines some embodiments of this application. Unless otherwise specified, the following embodiments and features described herein can be combined with each other. Please refer to... Figure 2 , Figure 2 This is a schematic flowchart illustrating a road traffic congestion prediction method provided in an embodiment of this application. Figure 2 As shown, the road traffic congestion prediction method may include steps S10 to S40.
[0079] Step S10: Obtain road traffic data for the target road.
[0080] For example, one can connect to the AD4CHE traffic database and obtain the road traffic data for the target road using the road traffic data in the AD4CHE database. It should be noted that the AD4CHE traffic database contains road traffic data for highways and expressways in multiple cities, totaling 68 data segments. Each data segment contains three files: xx_recordingMeta.csv, xx_tracks.csv, and xx_tracksMeta.csv, providing video metadata, vehicle trajectory data, and trajectory metadata, respectively. For instance, the road traffic data for the target road can be extracted from these three key files: xx_recordingMeta.csv (video metadata), xx_tracks.csv (vehicle trajectory data), and xx_tracksMeta.csv (track metadata). The target road can be one or more specified roads, such as a road in a specific city or region.
[0081] Step S20: Extract traffic parameters from the road traffic data to obtain the first traffic flow density and the first average speed of the first traffic flow on the target road in the current time period.
[0082] For example, after obtaining the road traffic data of the target road, traffic parameters can be extracted from the road traffic data to obtain the first traffic flow density and the first average speed of the target road in the current time period.
[0083] It should be noted that related technologies only consider single traffic parameters (such as average speed or flow rate), ignoring multi-dimensional information such as traffic density and vehicle type distribution, thus failing to fully utilize the rich information contained in multi-dimensional traffic data. In particular, the lack of differentiated processing for the impact of different vehicle types (passenger cars, trucks, etc.) reduces the prediction accuracy of traffic congestion status.
[0084] In this embodiment, by extracting two core traffic parameters—vehicle density and average vehicle speed—from road traffic data, and fully utilizing the rich information contained in multidimensional traffic data to predict traffic congestion, the prediction accuracy can be effectively improved. The following will explain in detail how to extract these traffic parameters.
[0085] Please see Figure 3 , Figure 3 This is a schematic flowchart illustrating a sub-step for extracting traffic parameters provided in an embodiment of this application. For example... Figure 3 As shown, step S20 involves extracting traffic parameters from the road traffic data to obtain the first traffic flow density and the first average speed of the first traffic flow on the target road in the current time period, which may include steps S201 to S203.
[0086] Step S201: Filter the vehicle trajectory of the road traffic data to obtain the vehicle trajectory information corresponding to the target road.
[0087] For example, vehicle trajectory information for a target road can be obtained by filtering road traffic data based on the lane identifier of each vehicle.
[0088] Step S202: Extract the vehicle identification number and driving data of each vehicle on the target road from the vehicle trajectory information.
[0089] For example, the vehicle identification number can be the vehicle's license plate number or serial number, and driving data can include driving direction and speed, etc.
[0090] Step S203: Determine the first traffic flow density corresponding to the target road based on the vehicle identification number of each vehicle, and determine the average speed of the first traffic flow corresponding to the target road based on the driving data of each vehicle.
[0091] In some embodiments, determining the first traffic flow density corresponding to the target road based on the vehicle identification number of each vehicle includes: identifying the vehicle type based on the vehicle identification number of each vehicle and counting the number of vehicles corresponding to each vehicle type on the target road; converting the number of vehicles corresponding to each vehicle type to obtain the equivalent number of vehicles corresponding to the target road; and calculating the traffic flow density based on the equivalent number of vehicles and the number of vehicles corresponding to each vehicle type to obtain the first traffic flow density.
[0092] For example, since each vehicle's vehicle identification number (VIN) is unique, the vehicle type can be identified using its VIN, such as car, bus, or truck. Then, the number of vehicles of each type on the target road can be counted; for example, the number of vehicles of each type can be counted within a 5-minute period or other time intervals.
[0093] It should be noted that, considering the different impacts of different vehicle types on traffic flow, the vehicle equivalent method needs to be used when calculating traffic flow density, to convert different vehicle types into the same type of vehicle. For example, all vehicle types should be converted into passenger cars.
[0094] For example, the number of vehicles corresponding to each vehicle type is converted to the equivalent number of vehicles for the target road; the traffic flow density is calculated based on the equivalent number of vehicles and the number of vehicles corresponding to each vehicle type to obtain the first traffic flow density. Specifically, the equivalent number of vehicles can be divided by the total number of vehicles corresponding to all vehicle types to obtain the first traffic flow density, which can be represented as k(t).
[0095] In the above embodiments, by performing vehicle type conversion on the number of vehicles corresponding to each vehicle type, the equivalent number of vehicles corresponding to the target road is obtained. According to the equivalent number of vehicles and the number of vehicles corresponding to each vehicle type, traffic flow density is calculated, which can achieve differential processing of the impacts of different vehicle types (such as passenger cars, trucks, etc.), thereby ensuring the accuracy of the first traffic flow density and further improving the prediction accuracy of subsequent prediction of traffic congestion status.
[0096] In some embodiments, determining the first average traffic flow speed corresponding to the target road according to the driving data of each vehicle includes: statistically calculating the driving speed of each vehicle in the driving direction within a preset time period according to the driving data of each vehicle; performing outlier detection on the driving speed of each vehicle based on the interquartile range method and deleting the outliers in the driving speed of each vehicle; calculating the mean value of the driving speed after deleting the outliers to obtain the first average traffic flow speed.
[0097] Exemplarily, the preset time period can be set according to the actual situation, and the specific value is not limited herein. For example, the preset time period can be 1 second. The driving speed of each vehicle in the driving direction can be statistically calculated every 1 second according to the driving data of each vehicle. Then, outlier detection is performed on the driving speed of each vehicle based on the interquartile range method, and the outliers in the driving speed of each vehicle are deleted. For example, the first quartile Q1 and the third quartile Q3 of the driving speed v can be calculated using the interquartile range method (IQR) to obtain the interquartile range IQR = Q3 - Q1. If the driving speed v of a certain vehicle deviates from the median by more than 1.5 times IQR (i.e., v < Q1 - 1.5IQR or v > Q3 + 1.5IQR), then the driving speed v is marked as an outlier and excluded. Finally, the mean value of the driving speed after deleting the outliers is calculated to obtain the first average traffic flow speed, and the first traffic flow density can be expressed as v(t).
[0098] In the above embodiments, by performing outlier detection on the driving speed of each vehicle based on the interquartile range method and deleting the outliers in the driving speed of each vehicle, the reliability of the data can be improved.
[0099] In the embodiments of the present application, in order to improve data quality, during the process of extracting parameters such as the first traffic flow density and the first average traffic flow speed, relevant parameters need to be preprocessed, such as standardizing the parameters and filling in missing values, etc. Among them, standardization means unifying parameters with different dimensions to the [0, 1] interval, and filling in missing values means performing intelligent interpolation in combination with time proximity and spatial correlation to ensure the continuity of the parameters. The following will take filling in missing values for the driving speed as an example for detailed description.
[0100] In some embodiments, the method of calculating the driving speed of each vehicle in the driving direction within a preset time period based on the driving data of each vehicle further includes: performing missing value detection on the driving speed of each vehicle and identifying the target vehicle whose driving speed is missing at the first moment; determining whether the driving data contains the driving speed of the target vehicle at a time adjacent to the first moment; if it exists, determining the driving speed of the target vehicle at the first moment based on the driving speed of the target vehicle at the adjacent moment; if it does not exist, determining the driving speed of the target vehicle at the first moment based on the driving speed of other vehicles in the adjacent lane of the target vehicle at the first moment.
[0101] For example, at time t, if the speed of the target vehicle in lane 2 is missing, the speeds of the same lane at adjacent times (t-1 and t+1) are checked first. If these data are not available, the speeds of adjacent lanes (lanes 1 and 3) at time t are examined. The speeds of other vehicles in lanes 1 or 3 at time t can be used to determine the speed of the target vehicle at time t.
[0102] In the above embodiment, by detecting missing values for the driving speed of each vehicle and identifying the target vehicle whose driving speed is missing at the first moment, the missing value of the driving speed of the target vehicle can be filled in, thus ensuring the continuity of driving speed.
[0103] In some embodiments, the preprocessed data can also undergo multi-dimensional quality assessment, including integrity, accuracy, and consistency checks. When data quality is detected to be substandard, a feedback loop is triggered to adjust the preprocessing strategy, forming a closed-loop data quality assurance mechanism, thereby effectively improving data quality.
[0104] Step S30: Based on the first traffic flow density and the first average traffic flow speed, perform time-series prediction of the traffic parameters of the target road to obtain the second traffic flow density and the second average traffic flow speed of the target road in the future time period.
[0105] For example, after extracting traffic parameters from road traffic data to obtain the first traffic flow density and first average traffic speed of the target road in the current time period, time-series predictions of the target road's traffic parameters can be made based on the first traffic flow density and first average traffic speed to obtain the second traffic flow density and second average traffic speed of the target road in future time periods. The following will explain in detail how to predict traffic parameters for future time periods based on traffic parameters for the current time period.
[0106] In some embodiments, performing time-series prediction of traffic parameters of a target road based on a first traffic density and a first average traffic speed to obtain a second traffic density and a second average traffic speed of the target road in a future time period may include: inputting the first traffic density into a preset time-series prediction model for time-series prediction to obtain the second traffic density; and inputting the first average traffic speed into the time-series prediction model for time-series prediction to obtain the second average traffic speed.
[0107] For example, the preset time-series prediction model can be the Times Net time-series prediction model. This model can predict traffic parameters for future periods based on current or historical traffic parameters, employing an innovative temporal deep learning architecture to capture complex temporal patterns. It should be noted that the learning architecture of the Times Net time-series prediction model includes four core components: periodicity discovery, one-dimensional to two-dimensional transformation, multi-scale feature extraction, and representation aggregation. It uses a sliding window approach to construct training samples, with the input being traffic parameters at historical time steps L and the output being traffic parameters at future time steps H.
[0108] For example, the Times Net time series prediction model can be a pre-trained model. In the embodiments of this application, the Times Net time series prediction model can be trained using the Adam optimizer, the mean squared error (MSE) loss function, and the learning rate annealing strategy. Dropout and L2 regularization are combined to prevent overfitting, and an early stopping strategy is used to ensure that the Times Net time series prediction model converges to the optimal solution, thereby improving the prediction accuracy and generalization ability of the Times Net time series prediction model.
[0109] It should be noted that traffic parameters exhibit complex temporal characteristics, including multi-periodicity, non-stationarity, and long-term dependence. Existing time-series modeling methods (such as ARIMA and LSTM) struggle to simultaneously capture both short-term fluctuations and long-term trends in traffic parameters, and their ability to model intraday, intraweekly, and seasonal cycles within traffic parameters is limited. Furthermore, traditional recurrent neural networks suffer from the vanishing gradient problem when modeling long sequences, while Transformer models based on attention mechanisms have high computational complexity, making them unsuitable for real-time prediction. In contrast, this application's embodiment utilizes the Times Net time-series prediction model for traffic parameter time-series prediction, enabling the simultaneous capture of both short-term fluctuations and long-term trends in traffic parameters. This overcomes the limitations of traditional time-series models in handling complex periodic data, effectively improving the accuracy and efficiency of time-series prediction.
[0110] For example, the first traffic flow density and the first average traffic flow speed can be input into the trained Times Net time series prediction model for time series prediction. The time series prediction process for the first traffic flow density and the first average traffic flow speed is similar. The following explanation uses the input of the first traffic flow density into the Times Net time series prediction model for time series prediction as an example.
[0111] Please see Figure 4 , Figure 4 This is a schematic flowchart illustrating a sub-step of timing prediction provided in an embodiment of this application. For example... Figure 4 As shown, it may include steps S301 to S303.
[0112] Step S301: Perform a fast Fourier transform on the first traffic flow density to obtain the significant frequencies of the first traffic flow density.
[0113] For example, a Fast Fourier Transform (FFT) can be performed on the first traffic flow density to adaptively identify the significant frequencies of the first traffic flow density. It should be noted that significant frequencies refer to the frequency components with larger amplitudes in the spectrum during the FFT of the first traffic flow density, which are used to represent the main periodic patterns present in the data.
[0114] Step S302: Determine the cycle length corresponding to the first traffic flow density based on the significant frequency.
[0115] For example, after obtaining the significant frequency of the first traffic flow density, the cycle length of the first traffic flow density can be calculated based on the significant frequency, where the cycle length is the reciprocal of the significant frequency and is used to represent the time required for one complete cycle of the first traffic flow density.
[0116] Step S303: Based on the cycle length, perform feature extraction on the first traffic flow density to obtain the second traffic flow density.
[0117] In some embodiments, extracting features from the first traffic flow density based on the period length to obtain the second traffic flow density may include: performing a dimensional transformation on the first traffic flow density according to the period length to obtain a two-dimensional tensor corresponding to the first traffic flow density, wherein the row elements in the two-dimensional tensor represent the change values of the first traffic flow density between period lengths, and the column elements in the two-dimensional tensor represent the change values of the first traffic flow density within the period length; extracting features from the two-dimensional tensor to obtain a first spatiotemporal feature of the first traffic flow density between period lengths and a second spatiotemporal feature within the period length; and performing a weighted aggregation of the first spatiotemporal feature and the second spatiotemporal feature to obtain the second traffic flow density.
[0118] For example, the first traffic flow density is one-dimensional data. The one-dimensional first traffic flow density can be reorganized into a two-dimensional tensor using the period length. In the two-dimensional tensor, the row elements represent the change value of the first traffic flow density between adjacent period lengths, and the column elements represent the change value of the first traffic flow density within the period length, which facilitates the subsequent effective capture of multi-periodic temporal features.
[0119] For example, a parameter-efficient Inception block can be used to extract features from a two-dimensional tensor to obtain first spatiotemporal features of the first traffic flow density within a period length and second spatiotemporal features within a period length. It should be noted that the parameter-efficient Inception block is a network structure used in deep learning that captures multi-scale image features through parallel convolution and pooling operations, and reduces computational complexity and the number of parameters through 1x1 convolutions. In this embodiment, by utilizing the parameter-efficient Inception block to extract features from a two-dimensional tensor, not only can spatiotemporal features at different scales be extracted, but short-term fluctuations and long-term trends can also be captured simultaneously, overcoming the limitations of traditional time-series models.
[0120] For example, based on the amplitude of each period in the frequency domain, corresponding weight values can be set, and the first spatiotemporal features and the second spatiotemporal features can be weighted and aggregated according to the set weight values to obtain the second traffic flow density.
[0121] In some implementations, taking the first traffic flow density collected at 5-minute intervals as an example, the following significant periodicity is identified through FFT analysis: P = 12 (corresponding to a 1-hour period, reflecting short-term fluctuations). For the 1-hour period P = 12, the first traffic flow density {xt} is reorganized into matrix M1, i.e., a two-dimensional tensor, where each row represents a different hour, and each column represents a 5-minute interval within one hour. Matrix element M1[i,j] = x(i×12+j), where i represents the i-th hour, and j represents the j-th 5-minute interval within one hour. For each matrix element M1[i,j], Inception blocks are applied for multi-scale feature extraction: a (3×3) convolution is applied to M1 to capture the relationship between adjacent time periods, and a (5×5) convolution captures a wider range of spatiotemporal dependencies.
[0122] The above embodiments utilize the Times Net time series prediction model to predict the first traffic flow density. By employing FFT analysis to adaptively identify significant frequencies, one-dimensional to two-dimensional tensor reconstruction technology, adaptive weight calculation based on frequency domain amplitude, and multi-scale feature extraction and aggregation strategies, the model can simultaneously capture short-term fluctuations and long-term trends in traffic flow density. This overcomes the limitations of traditional time series models in processing complex periodic data, thereby effectively improving the accuracy and efficiency of time series prediction.
[0123] In some embodiments, inputting the first average traffic flow speed into a time-series prediction model for time-series prediction to obtain the second average traffic flow speed may include: performing a Fast Fourier Transform on the first average traffic flow speed to obtain the significant frequencies of the first average traffic flow speed; determining the period length corresponding to the first average traffic flow speed based on the significant frequencies; and extracting features from the first average traffic flow speed based on the period length to obtain the second average traffic flow speed. The time-series prediction process for the first average traffic flow speed is similar to the time-series prediction process for the first traffic flow density described above. For details, please refer to the detailed explanations of steps S301 to S303 above, which will not be repeated here.
[0124] Step S40: Based on the second traffic flow density and the second traffic flow average speed, predict the traffic congestion status of the target road and obtain the traffic congestion probability of the target road in the future time period.
[0125] For example, the future time period can be set according to the actual situation. For example, the future time period can be 0-5 minutes in the future, or 0-120 minutes in the future, etc.
[0126] For example, the Mamdani fuzzy inference system can be used to predict the traffic congestion status of a target road based on the second traffic flow density and the second traffic flow average speed, thereby achieving accurate quantification of the traffic congestion status in the future time period. The nonlinear and complex relationship between traffic flow parameters and congestion status is processed through fuzzy inference logic.
[0127] It should be noted that the Mamdani fuzzy inference system comprises four steps: fuzzification, rule activation, rule aggregation, and defuzzification. Fuzzification is achieved using a triangular membership function; rule activation uses the min operator to perform an AND operation; rule aggregation uses the max operator to perform an OR operation; and defuzzification uses the centroid method, thus realizing the entire process from precise input to fuzzy inference and then to precise output. The following will detail how to use the Mamdani fuzzy inference system to predict traffic congestion status of a target road based on a second traffic flow density and a second average traffic flow speed.
[0128] Please see Figure 5 , Figure 5 This is a schematic flowchart illustrating the sub-steps of traffic congestion state prediction provided in an embodiment of this application. Figure 5 As shown, step S40 may include steps S401 to S405.
[0129] Step S401: Based on the triangular membership function, the second traffic flow density and the second traffic flow average speed are fuzzified to obtain the first fuzzy membership set corresponding to the second traffic flow density and the second fuzzy membership set corresponding to the second traffic flow average speed.
[0130] For example, based on the triangular membership function, the first fuzzy membership set corresponding to the second traffic flow density and the second fuzzy membership set corresponding to the second traffic flow average speed can be calculated, where the first fuzzy membership set can be represented as μ. i (k), the second fuzzy membership set can be represented as μ i (v).
[0131] Step S402: Activate each fuzzy rule in the preset fuzzy rule base according to the first fuzzy membership set and the second fuzzy membership set to obtain the initial activation degree corresponding to each fuzzy rule.
[0132] For example, rule activation refers to calculating the activation degree of each fuzzy rule. The formula for calculating the initial activation degree of the r-th fuzzy rule is as follows:
[0133] α r =min(μ i (k),μ i (v))
[0134] In the formula, α r This indicates the initial activation level.
[0135] In some embodiments, before activating each fuzzy rule in a preset fuzzy rule base according to a first fuzzy membership set and a second fuzzy membership set to obtain the initial activation degree corresponding to each fuzzy rule, the method further includes: classifying different values of traffic flow density, average traffic flow speed, and traffic congestion probability based on a triangular membership function to obtain multiple fuzzy subsets of traffic flow density, multiple fuzzy subsets of average traffic flow speed, and multiple fuzzy subsets of traffic congestion status; constructing a fuzzy rule base based on the multiple fuzzy subsets of traffic flow density, multiple fuzzy subsets of average traffic flow speed, and multiple fuzzy subsets of traffic congestion status, wherein the fuzzy rule base includes at least one fuzzy rule, and each fuzzy rule is used to indicate the mapping relationship between traffic flow density, average traffic flow speed, and traffic congestion status.
[0136] For example, a triangular membership function can be designed to divide traffic flow density into three fuzzy subsets: "low," "medium," and "high"; average traffic flow speed into three fuzzy subsets: "low," "medium," and "high"; and traffic congestion probability into four fuzzy subsets: "low," "medium," "high," and "completely congested." A fuzzy rule base containing nine IF-THEN fuzzy rules is constructed, forming a nine-grid inference structure, as shown in Table 1.
[0137] Table 1. Fuzzy Rules in the Fuzzy Rule Base
[0138] Serial number Fuzzy rule Rule 1 If(k(t)is low)and(v(t)is low)then(P(t)is medium) Rule 2 If(k(t)is low)and(v(t)is medium)then(P(t)is low) Rule 3 If(k(t)is low)and(v(t)is high)then(P(t)is low) Rule 4 If(k(t)is medium)and(v(t)is low)then(P(t)is high) Rule 5 If(k(t)is medium)and(v(t)is medium)then(P(t)is medium) Rule 6 If(k(t)is medium)and(v(t)is high)then(P(t)is low) Rule 7 If(k(t)is high)and(v(t)is low)then(P(t)is full Rule 8 If(k(t)is high)and(v(t)is medium)then(P(t)is high) Rule 9 If(k(t)is high)and(v(t)is high)then(P(t)is medium)
[0139] In Table 1, P(t) represents the probability of traffic congestion; low indicates low, medium indicates medium, high indicates high, and full indicates complete congestion. For example, the fuzzy rule Rule 1: If (k(t) is low) and (v(t) is low) then (P(t) is medium) means that if the traffic density is "low" and the average traffic speed is "low", then the probability of traffic congestion is "medium".
[0140] Step S403: Cut the initial activation of each fuzzy rule according to the first fuzzy membership set and the second fuzzy membership set to obtain the target activation of each fuzzy rule.
[0141] It should be noted that step S403 is optional. In some embodiments, after activating each fuzzy rule in the fuzzy rule base and obtaining the initial activation degree corresponding to each fuzzy rule, step S404 can be executed directly instead of step S403.
[0142] For example, based on the first fuzzy membership set μ i (k), the second fuzzy membership set μ i (v) The initial activation α of the r-th fuzzy rule r After cropping, the formula for calculating the target activation degree corresponding to the r-th fuzzy rule is as follows:
[0143] μ r ′(x)=min(μ r (x),α r )
[0144] In the formula, μ(x) represents the first fuzzy membership set μ i (k), the second fuzzy membership set μ i Any value in (v).
[0145] It should be noted that the pruning operation uses the activation degree of the fuzzy rule as an upper limit to "truncate" the membership function of the output fuzzy membership set, thus controlling the impact of activation strength on the output result. In other words, it limits the maximum value of the membership function of the output fuzzy membership set to the activation level of the fuzzy rule.
[0146] Step S404: Aggregate the target activation degree corresponding to each fuzzy rule to obtain the target activation degree of each fuzzy rule under different traffic congestion states.
[0147] For example, the formula for calculating the target activation degree of each fuzzy rule under different traffic congestion states is as follows:
[0148]
[0149] In the formula, n represents the number of fuzzy rules, and m represents the number of target activations, which is the number of fuzzy subsets of different traffic congestion states (namely, the four fuzzy subsets of traffic congestion states: "low", "medium", "high" and "completely congested").
[0150] Step S405: Defuzzify the target activation degree of each fuzzy rule under different traffic congestion states to obtain the traffic congestion probability.
[0151] For example, after obtaining the target activation of each fuzzy rule under different traffic congestion states, the centroid method can be used to defuzzify the target activation of each fuzzy rule under different traffic congestion states to obtain the traffic congestion probability. The output traffic congestion probability P(t) ∈ [0,1] is calculated using the centroid method, and the formula for calculating the traffic congestion probability P(t) is as follows:
[0152]
[0153] In the formula, represents the center of the four fuzzy subsets of traffic congestion status.
[0154] In some implementations, taking a second traffic density of k = 30 vehicles / km and an average speed of v = 45km / h as an example, we can illustrate how to predict the probability of traffic congestion.
[0155] 1. Fuzzification: Using triangular membership functions to map precise values to fuzzy sets.
[0156] For the second traffic density k = 30 vehicles / km, the first fuzzy membership set is: μlow(k) = 0.2, μmedium(k) = 0.7, μhigh(k) = 0.1.
[0157] For the second traffic flow with an average speed of v = 45 km / h, the second fuzzy membership set is: μlow(v) = 0.1, μmedium(v) = 0.8, μhigh(v) = 0.1.
[0158] 2. Rule Activation: Use the min operator to implement the AND operation. Take rule 5 in Table 1 above as an example:
[0159] Rule 5: If the traffic density is medium and the average traffic speed is medium, then the probability of traffic congestion is medium.
[0160] The calculated activation level α5 = min(0.7, 0.8) = 0.7.
[0161] 3. Rule aggregation: Use the max operator to implement the "OR" operation and aggregate the output of all active rules.
[0162] If rules 5 and 6 are activated at levels of 0.7 and 0.1 respectively, the aggregate output for "moderate congestion" is max(0.7,0) = 0.7, and the aggregate output for "low congestion" is max(0,0.1) = 0.1.
[0163] 4. Defuzzification: The centroid method is used to calculate the final accurate traffic congestion probability value.
[0164] The above embodiments, by sequentially performing operations such as fuzzification, rule activation, rule aggregation, and defuzzification based on the second traffic flow density and the second average traffic flow speed, can achieve accurate quantification of the traffic congestion probability of the target road in the future time period. This can reflect the continuity and fuzziness characteristics of road congestion, and solve the problem that related technologies usually use simple threshold methods to define the road congestion state, which lacks accurate quantification of the degree of road congestion and cannot accurately reflect the continuity and fuzziness characteristics of road congestion, thus leading to a large deviation between the road congestion assessment results and the actual situation. This can effectively improve the accuracy of traffic congestion prediction.
[0165] In this embodiment, based on newly added road traffic data and prediction bias analysis, a model update process can be automatically triggered to periodically train and update the Times Net time-series prediction model and the Mamdani fuzzy inference system, ensuring adaptation to dynamic changes in traffic patterns and maintaining the accuracy of traffic congestion probability predictions. Simultaneously, when new data patterns are identified or existing road traffic data becomes outdated, a data update process can be triggered to preserve the timeliness of road traffic data.
[0166] In this embodiment of the application, after obtaining the traffic congestion probability of the target road in the future time period, the traffic congestion probability can also be transformed into intuitive early warning information to provide decision support for traffic management departments and travelers.
[0167] In some embodiments, after predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic speed to obtain the traffic congestion probability of the target road in a future time period, the road traffic congestion prediction method in this application embodiment further includes: determining the target warning level corresponding to the traffic congestion probability based on the preset correspondence between the traffic congestion probability and the warning level; obtaining the warning details corresponding to the target warning level; and outputting traffic congestion prompt information based on the warning details. The traffic congestion prompt information includes the expected congestion start time, congestion duration, affected area, and detour suggestions.
[0168] For example, a refined four-level early warning mechanism can be implemented based on the predicted traffic congestion probability P(A). For instance, when the traffic congestion probability P(A) < 0.3, a green warning indicates smooth traffic; when the probability is 0.3 ≤ P(A) < 0.5, a yellow warning indicates mild congestion; when the probability is 0.5 ≤ P(A) < 0.7, an orange warning indicates moderate congestion; and when the probability is P(A) ≥ 0.7, a red warning indicates severe congestion. Different warning levels correspond to different detailed warning information. For example, the detailed warning information may include the expected start time of congestion, the duration of congestion, the cause of congestion, the affected area, and detour suggestions, etc.
[0169] It should be noted that the scope of impact can be generated based on the location of the drone monitoring area, and the cause of congestion can be identified through algorithms. For example, when the congestion type is gradual congestion (i.e., traffic density gradually increases and average traffic speed gradually decreases), the cause of congestion may be increased demand during peak hours; when the congestion type is sudden congestion (i.e., average traffic speed drops sharply and traffic density increases rapidly), the cause of congestion may be traffic accidents; when the congestion type is fluctuating congestion (traffic density and average traffic speed change periodically), the cause of congestion may be upstream and downstream traffic signal timing issues.
[0170] It should be noted that existing early warning systems mostly adopt a broad-based early warning strategy, lacking detailed descriptions of key information such as the degree of traffic congestion, the scope of impact, and the duration, thus reducing the practical value of the early warning information. However, the embodiments of this application, by determining the target early warning level corresponding to the probability of traffic congestion, obtaining detailed early warning information corresponding to the target early warning level, and outputting traffic congestion alerts based on the detailed early warning information, can achieve targeted traffic control and diversion suggestions, thereby improving the practical value of the early warning system.
[0171] In some embodiments, after predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic speed, and obtaining the traffic congestion probability of the target road in a future time period, the method further includes: outputting a traffic congestion heat map and / or a traffic congestion probability time series map corresponding to the target road based on the traffic congestion probability.
[0172] For example, a traffic congestion heatmap can be generated based on the probability of traffic congestion for different roads or road segments. As shown, the traffic congestion heatmap can include the traffic congestion probability of different road segments at different time periods. S1-S10 represent different road segment numbers, and different colors are used to represent the traffic congestion probability. For example, the traffic congestion probability of road segment S1 is 0.07 between 7:00-8:00, 0.68 between 8:00-9:00, 0.1 between 9:00-10:00, 0.23 between 17:00-18:00, 0.86 between 18:00-19:00, and 0 between 19:00-20:00.
[0173] For example, a time series diagram of traffic congestion probability can be generated based on the traffic congestion probability corresponding to different roads or road segments. Figure 6 Figure 7 As shown, the vertical axis represents the probability of congestion, and the horizontal axis represents different dates and time periods. Specifically, a congestion probability of 0-0.3 indicates smooth congestion; 0.3-0.5 indicates light congestion; 0.5-0.7 indicates moderate congestion; and 0.7-1.0 indicates severe congestion. The solid curve represents the congestion probability for the current time period, and the dashed curve represents the predicted congestion probability for future time periods.
[0174] The above embodiments, by outputting a traffic congestion heatmap and / or a traffic congestion probability time series diagram corresponding to the target road based on the traffic congestion probability, can more intuitively display the predicted traffic congestion probability, thereby improving the user experience.
[0175] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0176] The embodiments of this application also provide a computer-readable storage medium storing a computer program, which includes program instructions. A processor executes the program instructions to implement any of the road traffic congestion prediction methods provided in the embodiments of this application.
[0177] For example, when the program is loaded by the processor, it can perform the following steps:
[0178] Acquire road traffic data for the target road; extract traffic parameters from the road traffic data to obtain the first traffic flow density and the first average traffic flow speed of the target road in the current time period; perform time-series prediction of the traffic parameters of the target road based on the first traffic flow density and the first average traffic flow speed to obtain the second traffic flow density and the second average traffic flow speed of the target road in the future time period; predict the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in the future time period.
[0179] The computer-readable storage medium can be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, etc., provided on the computer device.
[0180] Furthermore, the computer-readable storage medium may primarily include a stored program area and a stored data area, wherein the stored program area may store the operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of blockchain nodes, etc.
[0181] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0182] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for predicting road traffic congestion, characterized in that, The method includes: Obtain road traffic data for the target road; Traffic parameters are extracted from the road traffic data to obtain the first traffic flow density and the first average traffic flow speed of the target road in the current time period; Based on the first traffic density and the first average traffic speed, the traffic parameters of the target road are predicted in a time series to obtain the second traffic density and the second average traffic speed of the target road in a future time period. Based on the second traffic density and the second average traffic speed, the traffic congestion status of the target road is predicted, and the traffic congestion probability of the target road in the future time period is obtained. The step of performing time-series prediction of traffic parameters of the target road based on the first traffic flow density and the first average traffic flow speed to obtain the second traffic flow density and the second average traffic flow speed of the target road in a future time period includes: inputting the first traffic flow density into a preset time-series prediction model for time-series prediction to obtain the second traffic flow density; and inputting the first average traffic flow speed into the time-series prediction model for time-series prediction to obtain the second average traffic flow speed. The step of inputting the first traffic flow density into a preset time-series prediction model for time-series prediction to obtain the second traffic flow density includes: performing a fast Fourier transform on the first traffic flow density to obtain the significant frequency of the first traffic flow density; determining the period length corresponding to the first traffic flow density based on the significant frequency; and extracting features from the first traffic flow density based on the period length to obtain the second traffic flow density. The step of extracting features from the first traffic flow density based on the period length to obtain the second traffic flow density includes: performing a dimensional transformation on the first traffic flow density according to the period length to obtain a two-dimensional tensor corresponding to the first traffic flow density, wherein the row elements in the two-dimensional tensor represent the change values of the first traffic flow density within the period length, and the column elements in the two-dimensional tensor represent the change values of the first traffic flow density within the period length; extracting features from the two-dimensional tensor to obtain a first spatiotemporal feature of the first traffic flow density within the period length and a second spatiotemporal feature within the period length; and performing a weighted aggregation of the first spatiotemporal feature and the second spatiotemporal feature to obtain the second traffic flow density.
2. The road traffic congestion prediction method according to claim 1, characterized in that, The step of extracting traffic parameters from the road traffic data to obtain the first traffic flow density and the first average traffic flow speed of the target road in the current time period includes: The road traffic data is filtered by vehicle trajectory to obtain the vehicle trajectory information corresponding to the target road; Extract the vehicle identification number and driving data of each vehicle on the target road from the vehicle trajectory information; The first traffic density corresponding to the target road is determined based on the vehicle identification number of each vehicle, and the first average speed of the traffic flow corresponding to the target road is determined based on the driving data of each vehicle.
3. The road traffic congestion prediction method according to claim 2, characterized in that, The step of determining the first traffic density corresponding to the target road based on the vehicle identification number of each vehicle includes: Vehicle type identification is performed based on the vehicle identification number of each vehicle, and the number of vehicles corresponding to each vehicle type on the target road is counted. The number of vehicles corresponding to each of the aforementioned vehicle types is converted to the vehicle type number to obtain the equivalent number of vehicles corresponding to the target road. The first traffic flow density is obtained by calculating the traffic flow density based on the equivalent number of vehicles and the number of vehicles corresponding to each type of vehicle.
4. The road traffic congestion prediction method according to claim 2, characterized in that, Determining the average speed of the first traffic flow corresponding to the target road based on the driving data of each vehicle includes: The driving speed of each vehicle in the driving direction is calculated based on the driving data of each vehicle within a preset time period; The interquartile range method is used to detect anomalies in the driving speed of each vehicle, and outliers in the driving speed of each vehicle are deleted. The average speed of the first traffic flow is obtained by averaging the driving speeds after removing outliers.
5. The road traffic congestion prediction method according to claim 4, characterized in that, The method further includes: calculating the speed of each vehicle in the driving direction within a preset time period based on the driving data of each vehicle. For each vehicle, a missing value detection is performed on its driving speed, and the target vehicle with a missing driving speed at the first moment is identified. Determine whether the driving data contains the driving speed of the target vehicle at a time adjacent to the first time. If it exists, then the speed of the target vehicle at the first moment is determined based on the speed of the target vehicle at the adjacent time. If it does not exist, the speed of the target vehicle at the first moment is determined based on the speed of other vehicles in the adjacent lanes of the target vehicle at the first moment.
6. The road traffic congestion prediction method according to claim 1, characterized in that, The step of predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed, to obtain the traffic congestion probability of the target road in a future time period, includes: Based on the triangular membership function, the second traffic flow density and the second traffic flow average speed are fuzzified to obtain the first fuzzy membership set corresponding to the second traffic flow density and the second fuzzy membership set corresponding to the second traffic flow average speed. Based on the first fuzzy membership set and the second fuzzy membership set, each fuzzy rule in the preset fuzzy rule base is activated to obtain the initial activation degree corresponding to each fuzzy rule; The initial activation degree of each fuzzy rule is cut according to the first fuzzy membership degree set and the second fuzzy membership degree set to obtain the target activation degree corresponding to each fuzzy rule; Aggregate the target activation degree corresponding to each fuzzy rule to obtain the target activation degree of each fuzzy rule under different traffic congestion states; The target activation degree of each fuzzy rule under different traffic congestion states is defuzzified to obtain the traffic congestion probability.
7. The road traffic congestion prediction method according to claim 6, characterized in that, Before activating each fuzzy rule in the preset fuzzy rule base according to the first fuzzy membership set and the second fuzzy membership set to obtain the initial activation degree corresponding to each fuzzy rule, the method further includes: Based on the triangular membership function, different values of traffic density, average traffic speed and traffic congestion probability are classified to obtain multiple fuzzy subsets of traffic density, multiple fuzzy subsets of average traffic speed and multiple fuzzy subsets of traffic congestion status. The fuzzy rule base is constructed based on multiple fuzzy subsets of traffic flow density, multiple fuzzy subsets of average traffic flow speed, and multiple fuzzy subsets of traffic congestion status. The fuzzy rule base includes at least one fuzzy rule, and each fuzzy rule is used to indicate the mapping relationship between the traffic flow density, the average traffic flow speed, and the traffic congestion status.
8. The road traffic congestion prediction method according to claim 1, characterized in that, After predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in a future time period, the method further includes: Based on the preset correspondence between traffic congestion probability and warning level, the target warning level corresponding to the traffic congestion probability is determined. Obtain detailed warning information corresponding to the target warning level, and output traffic congestion alert information based on the detailed warning information. The traffic congestion alert information includes the expected start time of congestion, the duration of congestion, the scope of impact, and detour suggestions.
9. The road traffic congestion prediction method according to claim 1, characterized in that, After predicting the traffic congestion status of the target road based on the second traffic flow density and the second average traffic flow speed to obtain the traffic congestion probability of the target road in a future time period, the method further includes: Based on the traffic congestion probability, output the traffic congestion heat map and / or traffic congestion probability time series diagram corresponding to the target road.
10. A computer device, characterized in that, The computer device includes a processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the road traffic congestion prediction method as described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the road traffic congestion prediction method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for predicting traffic jam and computer equipment
CN109658697A
Road state prediction method, system and device and storage medium
CN114120655A