Real-time highway traffic capacity assessment method based on RF-DBSCN
Through the RF-DBSCN method, combined with DBSCN clustering and random forest algorithm, the problem of failure to fully consider vehicle type and traffic flow factors in the existing technology is solved, and more accurate high-speed traffic capacity assessment and real-time traffic management decision support is achieved.
Patent Information
- Application Number
- CN202411130115.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-13
AI Technical Summary
The existing high-speed traffic capacity assessment method fails to fully consider factors such as vehicle type, vehicle speed and traffic flow composition, resulting in a deviation from the actual situation.
Using the real-time high-speed passability assessment method based on RF-DBSCN, the passability feature is constructed by obtaining real-time road data, integrating data from different source formats, extracting passability feature features, using DBSCN clustering model and random forest algorithm to build branch decision trees, and screening passability feature features and prediction.
It improves the accuracy of traffic capacity prediction, can accurately tap into factors that affect road capabilities, dynamically calculate high-speed road traffic capacity in real time, quickly respond to changes in traffic conditions, and provide flexible and intelligent traffic capacity assessment support.
Smart Images

Figure CN119128715A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a real-time high-speed traffic capacity evaluation method based on RF-DBSCN. Background Art
[0002] Highway capacity refers to the maximum hourly flow rate that people and vehicles can reasonably expect to reach through a lane or a certain end of a road or a uniform road surface within a specified time under normal road, traffic and control conditions. With the growing development of traffic demand, the transportation system has also begun to face serious challenges, especially in the deterioration of highway conditions, the decline in capacity due to the different types of vehicles, and the frequent congestion of some sections of highways due to peak traffic, while the capacity of other sections has great potential; therefore, accurately evaluating the traffic operation status is crucial to deeply understand the behavior of the traffic system and make corresponding traffic management decisions.
[0003] In the relevant technology, there are many methods for evaluating the highway capacity, such as the basic capacity method, the headway spacing method, the headway time observation method, and the speed density observation method. The basic capacity method according to the current "Highway Engineering Technical Standards" is one of the commonly used calculation methods. It calculates the maximum capacity of the lane within a certain period of time according to factors such as lane width, number of lanes, lane length and lane curve.
[0004] However, the inventors found that the above basic capacity method only considers the geometric factors of the lane, but does not consider other factors such as vehicle type, vehicle speed, traffic flow composition, etc., which leads to deviations between the calculation results and the actual situation. Summary of the invention
[0005] In view of at least one of the above technical problems, the present invention provides a real-time high-speed traffic capacity evaluation method based on RF-DBSCN to improve the prediction accuracy of high-speed traffic capacity.
[0006] According to one aspect of the present invention, a real-time high-speed traffic capacity evaluation method based on RF-DBSCN is provided, comprising the following steps:
[0007] Obtain real-time data on roads within a set time, including weather data, accident data, maintenance data, and traffic flow data;
[0008] Integrate data from different sources and formats, encode the data in a unified way, and construct a capacity data set;
[0009] Extract the features needed to calculate the traffic capacity, initialize the traffic capacity features to extract its density radius and minimum density;
[0010] Determine the set N of all core objects, and the capacity feature extractor randomly selects an unvisited data node p;
[0011] With p as the core and R as the radius, determine whether the number of data points in the circle exceeds Mints. If so, it is determined as a core object, marked as revisited, and added to the same cluster. Mints represents the density threshold, which is used to define the minimum number of neighborhood points required to form a core store;
[0012] Expand and update clusters, form all clusters, and filter capacity characteristics;
[0013] Input a capacity feature data set, randomly sample with replacement from m capacity feature data sets, construct a branch decision tree, train the branch decision tree, and each branch decision tree outputs a result of the branch decision tree according to the received features;
[0014] The branch decision tree result integration integrates the results of each branch decision tree by the average method and outputs the final capacity calculation result.
[0015] In some embodiments of the present invention, when obtaining real-time data of a road within a set time, the traffic capacity data set is constructed by column based on the data of each minute. The original capacity dataset and the capacity dataset reconstructed by unified coding are shown in Figure 2. in
[0016] Where L represents the original capacity dataset, and L′ represents the reconstructed capacity dataset.
[0017] In some embodiments of the present invention, let L = {L1, L2, ..., L m}, L i = {l i1 ,l i2 ,...,l in}, i∈[1,m], j∈[1,n] represents the traffic capacity calculation data set, The neighborhood with p as the center and ε as the radius is called the ε neighborhood of p, denoted by N_ε(p)={q∈L|d(p,q)≤ε};
[0018] In the formula, p represents the data point, q represents the boundary point, and ε is the distance radius, which represents the radius of the neighborhood.
[0019] In some embodiments of the present invention, if p i ,i∈[1,k] is in the ε neighborhood of data p. If k>Minpts, then data p is called a core point. If the capacity data p is a core point, q i, i∈[1,k] is in the ε neighborhood of the capacity data q, if k<Minpts and p i ∈N_ε(p), then q is called a boundary point; where k represents the number of points in the neighborhood.
[0020] In some embodiments of the present invention, for any point p in L, check the data points contained in the neighborhood of object p. If the number of objects contained in (p) is less than Mints, mark object p as a boundary point; if it is greater than Mints, mark object p as a core point, establish a new cluster C, and add all points in the neighborhood of p to C;
[0021] In the formula, C represents the cluster of data points.
[0022] In some embodiments of the present invention, it is checked that each capacity data object p in L is divided into different clusters, and the screening features of all clusters are counted to complete the work of extracting the capacity features.
[0023] In some embodiments of the present invention, a random forest algorithm is used to construct a capacity data regression model. When constructing a branch decision tree, a CART regression tree is selected. Assume that the multi-type capacity data set L after feature extraction is L = (l ij ) m×n , where X = {l ij |i∈[1,m],j∈[1,n]} are input variables, Y={l i,j-1 |i∈[1,m],j∈[1,n]} is the output variable, n is the number of features, m is the number of samples in the multi-type dataset, and Y is a continuous variable.
[0024] In some embodiments of the present invention, suppose that the j-th feature variable l in the traffic capacity training data set X is (j) and its value v as the segmentation variable and segmentation point, and define two regions T1(j,v)={l|l (j) ≤v} and T2(j,v)={l|l (j) >v}, solve the optimal (j,v) so that the sum of square errors of the two divided regions is minimized.
[0025] In some embodiments of the present invention, after finding the optimal split point (j, v), the input space is divided into two regions in turn, and then the above division process is repeated for each region until the stop condition is met, and finally the following regression decision tree model outputs the real-time road capacity:
[0026] in
[0027] In the formula, Indicates area T mThe mean value of the internal target variable, T m Represents the input space area covered by the mth leaf node in the decision tree.
[0028] In some embodiments of the present invention, the multi-type capacity dataset L contains m samples, k features, and the time complexity is O(mklogm). Finally, the weighted average of the m regression decision trees is performed to obtain the overall prediction accuracy A c , so the time complexity is O(m(mklogm)).
[0029] The beneficial effects of the present invention are:
[0030] 1. The present invention accurately mines the factors that affect road capacity and establishes a fast and accurate method for screening traffic capacity characteristics, thereby more accurately evaluating traffic capacity and helping managers understand the real-time status of the traffic system.
[0031] 2. The present invention is capable of dynamically calculating the capacity of expressways in real time, thereby responding quickly and accurately to changes in traffic conditions and ensuring effective management of real-time traffic.
[0032] 3. The present invention uses machine learning methods to calculate high-speed capacity, and the model can be quickly trained and deployed to improve computing efficiency. The application of machine learning models can not only quickly adapt to new data, but also provide more flexible and intelligent capacity assessment, providing more reliable decision support for actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 It is a flowchart of the steps of the real-time high-speed traffic capacity evaluation method based on RF-DBSCN in an embodiment of the present invention;
[0035] Figure 2 It is a structural schematic diagram of a high-speed traffic capacity evaluation system in an embodiment of the present invention;
[0036] Figure 3 Schematic diagram of the structure of a traffic capacity data processor in an embodiment of the present invention;
[0037] Figure 4 Schematic diagram of the structure of a traffic capacity feature extractor in an embodiment of the present invention;
[0038] Figure 5 Schematic diagram of the structure of a capacity calculator in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0040] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0042] like Figure 1 The real-time high-speed traffic capacity evaluation method based on RF-DBSCN shown includes the following steps:
[0043] S10: Acquire real-time data of the road within a set time, the real-time data including weather data, accident data, maintenance data and traffic flow data;
[0044]
[0045] S20: Integrate data from different sources and formats, encode the data in a unified way, and construct a capacity dataset;
[0046] S30: extracting features required for calculating the traffic capacity, initializing the traffic capacity features to extract the density radius and minimum density;
[0047] S40: determining a set N of all core objects, and the capacity feature extractor randomly selects an unvisited data node p;
[0048] S50: Taking p as the core and R as the radius, determine whether the number of data points in the circle exceeds Mints. If so, it is determined as a core object, marked as revisited, and added to the same cluster, where Mints represents the density threshold, which is used to define the minimum number of neighborhood points required to form a core store;
[0049] S60: Expand and update clusters, form all clusters, and filter capacity characteristics;
[0050] S70: inputting a traffic capacity feature data set, randomly sampling with replacement from m traffic capacity feature data sets, constructing a branch decision tree, training the branch decision tree, and each branch decision tree outputting a result of the branch decision tree according to the received features;
[0051] S80: Branch decision tree result integration, integrate the results of each branch decision tree by the average method, and output the final capacity calculation result. Some experimental results are as follows:
[0052]
[0053] Please refer to Figure 2 , is a structural diagram of the high-speed real-time capacity calculation method based on the random forest algorithm in this application, which mainly includes three parts: a capacity data processor, a capacity feature extractor and a capacity calculator. The capacity data processor integrates data from different sources, completes data preprocessing, and realizes unified encoding of data from different sources. The capacity feature extractor is mainly based on the DBSCN clustering model to quickly and accurately extract features that affect capacity. The capacity calculator is mainly based on the random forest machine learning model to accurately evaluate the real-time road operation status. For details, please refer to Figures 3 to 5 , it mainly includes three parts: a capacity data processor, a capacity feature extractor and a capacity calculator. The capacity data processor fuses data from different sources, completes data preprocessing, and realizes unified encoding of data from different sources. The capacity feature extractor is mainly based on the DBSCN clustering model to quickly and accurately extract features that affect capacity. The capacity calculator is mainly based on the random forest machine learning model to accurately evaluate the real-time road operation status. In the following part of the embodiment of the present invention, the real-time high-speed capacity evaluation method based on RF-DBSCN of this application is described in detail.
[0054] Step 1: Since real-time capacity is related to road traffic conditions (such as traffic accidents, road maintenance, road infrastructure conditions), weather conditions (such as heavy rain, heavy snow, and fog), etc., it is diverse and complex. In order to reduce the diversity, this paper uses real-time data every minute as a feature and reconstructs the capacity dataset by column.
[0055] set up The original capacity dataset and the capacity dataset reconstructed by unified coding are shown in Figure 2. in
[0056] Where L represents the original capacity dataset, and L′ represents the reconstructed capacity dataset.
[0057] Step 2: Let L = {L1, L2, ..., L m}, L i = {l i1 ,l i2 ,...,l in}, i∈[1,m], j∈[1,n] represents the traffic capacity calculation data set, The neighborhood with p as the center and ε as the radius is called the ε neighborhood of p, denoted by N_ε(p)={q∈L|d(p,q)≤ε}; where p represents the data point, q represents the boundary point, ε is the distance radius, and represents the radius of the neighborhood. p i ,i∈[1,k] is in the ε neighborhood of data p. If k>Minpts, then data p is called a core point. If the capacity data p is a core point, q i , i∈[1,k] is in the ε neighborhood of the capacity data q, if k<Minpts and p i ∈N_ε(p), then q is called a boundary point, and k represents the number of points in the neighborhood. p is a core point in the capacity calculation data set L, and the set C(p) consisting of the capacity calculation data points reachable by p density is a cluster, and the same cluster is composed of data affected by similar features.
[0058] Step 3: For any point p inL, check the data points contained in the neighborhood of object p. If the number of objects contained in (p) is less than Mints, mark object p as a boundary point; if it is greater than Mints, mark object p as a core point, and establish a new cluster C, and add all points in the neighborhood of p to C, where C represents the clustering cluster of the data point.
[0059] Step 4: Check that each capacity data object p in L is divided into different clusters, count the screening features of all clusters, and complete the traffic feature extraction work.
[0060] Step 5: The present invention mainly uses the random forest algorithm to construct a capacity data regression model. When constructing a branch decision tree, the CART regression tree is selected. Assume that the multi-type capacity data set L after feature extraction is L = (l ij ) m×n , where X = {l ij |i∈[1,m],j∈[1,n]} are input variables, Y={l i,j-1|i∈[1,m],j∈[1,n]} is the output variable, n is the number of features, m is the number of samples in the multi-type data set, and Y is a continuous variable. For CART regression tree, accurate feature space partitioning is crucial. In the input space, a heuristic method is used to divide each region into two sub-regions, and the output value on each sub-region is determined. Each partition examines all the values of all features in the current set X one by one, and selects the best one as the split point according to the square error minimization criterion.
[0061] Step 6: Assume that the j-th feature variable l in the traffic capacity training data set X (j) and its value v as the segmentation variable and segmentation point, and define two regions T1(j,v)={l|l (j) ≤v} and T2(j,v)={l|l (j) >v}. To find the optimal (j, v) so that the sum of square errors of the two divided regions is minimized, the following formula holds
[0062]
[0063] Step 7: c1 and c2 are the output values that minimize the square error in their respective regions after division. The two optimal output values are equal to the mean of Y in their respective corresponding regions. Step 6 can be solved as
[0064]
[0065] in N1 and N2 are the numbers of data samples divided into T1(j,v) and T2(j,v) regions respectively.
[0066] Step 8: After finding the optimal split point (j, v), divide the input space into two regions in turn, and then repeat the above division process for each region until the stop condition is met. Finally, the following regression decision tree model outputs the real-time road capacity:
[0067] in
[0068] In the formula, Indicates area T m The mean value of the internal target variable, T m Represents the input space area covered by the mth leaf node in the decision tree.
[0069] Step 9: The multi-type capacity dataset L contains m samples, k features, and the time complexity is O(mklogm). Finally, the weighted average of the m regression decision trees is performed to obtain the overall prediction accuracy A. c , so the time complexity is O(m(mklogm)).
[0070] Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A real-time high-speed traffic capacity assessment method based on RF-DBSCN, characterized in that: The following steps are involved: Obtain real-time data on roads within a set time, including weather data, accident data, maintenance data, and traffic flow data; Integrate data from different sources and formats, encode the data in a unified way, and construct a capacity data set; Extract the features needed to calculate the traffic capacity, initialize the traffic capacity features to extract its density radius and minimum density; Determine the set N of all core objects, and the capacity feature extractor randomly selects an unvisited data node p; With p as the core and R as the radius, determine whether the number of data points in the circle exceeds Mints. If so, it is determined as a core object, marked as revisited, and added to the same cluster; Mints represents the density threshold, which is used to define the minimum number of neighborhood points required to form a core store; Expand and update clusters, form all clusters, and filter capacity characteristics; Input a capacity feature data set, randomly sample with replacement from m capacity feature data sets, construct a branch decision tree, train the branch decision tree, and each branch decision tree outputs a result of the branch decision tree according to the received features; The branch decision tree result integration integrates the results of each branch decision tree by the average method and outputs the final capacity calculation result.
2. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 1 is characterized in that: When obtaining real-time data of roads within a set time, the traffic capacity dataset is constructed by column based on the data features of each minute. The original capacity dataset and the capacity dataset reconstructed by unified coding are shown in Figure 2. in for different characteristics at the same time; Where L represents the original capacity dataset, and L′ represents the reconstructed capacity dataset.
3. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 2 is characterized in that: Let L = {L1, L2, ..., L m }, L i = {l i1 ,l i2 ,...,l in }, i∈[1,m], j∈[1,n] represents the traffic capacity calculation data set, The neighborhood with p as the center and ε as the radius is called the ε neighborhood of p, denoted by N_ε(p)={q∈L|d(p,q)≤ε}; In the formula, p represents the data point, q represents the boundary point, and ε is the distance radius, which represents the radius of the neighborhood.
4. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 3 is characterized in that: like p i ,i∈[1,k] is in the ε neighborhood of data p. If k>Minpts, then data p is called a core point. If the capacity data p is a core point, q i , i∈[1,k] is in the ε neighborhood of the capacity data q, if k<Minpts and p i ∈N_ε(p), then q is called a boundary point; where k represents the number of points in the neighborhood.
5. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 4 is characterized in that: For any point in pinL, check the data points contained in the neighborhood of object p. If the number of objects contained in (p) is less than Mints, mark object p as a boundary point; if it is greater than Mints, mark object p as a core point, establish a new cluster C, and add all points in the neighborhood of p to C; In the formula, C represents the cluster of data points.
6. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 5 is characterized in that: Check that each capacity data object p in L is divided into different clusters, count the screening features of all clusters, and complete the traffic feature extraction work.
7. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 6 is characterized in that: The random forest algorithm is used to construct the capacity data regression model. When constructing the branch decision tree, the CART regression tree is selected. The multi-type capacity data set L after feature extraction is set to (l ij ) m×n , where X = {l ij |i∈[1,m],j∈[1,n]} are input variables, Y={l i,j-1 |i∈[1,m],j∈[1,n]} is the output variable, n is the number of features, m is the number of samples in the multi-type dataset, and Y is a continuous variable.
8. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 7 is characterized in that: For the j-th feature variable l in the traffic capacity training data set X (j) and its value v as the segmentation variable and segmentation point, and define two regions T1(j,v)={l|l (j) ≤v} and T2(j,v)={l|l (j) >v}, solve the optimal (j,v) so that the sum of square errors of the two divided regions is minimized.
9. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 8 is characterized in that: After finding the optimal split point (j, v), the input space is divided into two regions in turn, and then the above division process is repeated for each region until the stop condition is met. Finally, the following regression decision tree model is generated to output the real-time road capacity: in In the formula, Indicates area T m The mean value of the internal target variable, T m Represents the input covered by the mth leaf node in the decision tree Enter the space area.
10. The real-time high-speed traffic capacity evaluation method based on RF-DBSCN according to claim 9 is characterized in that: The multi-type capacity dataset L contains m samples, k features, and the time complexity is O(mklogm). Finally, the weighted average of the m regression decision trees is used to obtain the overall prediction accuracy A. c , so the time complexity is O(m(mklogm)).
