CN118197060A - Traffic scheduling method, device and equipment for single-channel tunnel and storage medium - Google Patents

Traffic scheduling method, device and equipment for single-channel tunnel and storage medium Download PDF

Info

Publication number
CN118197060A
CN118197060A CN202410601005.3A CN202410601005A CN118197060A CN 118197060 A CN118197060 A CN 118197060A CN 202410601005 A CN202410601005 A CN 202410601005A CN 118197060 A CN118197060 A CN 118197060A
Authority
CN
China
Prior art keywords
data
traffic
flow
prediction
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410601005.3A
Other languages
Chinese (zh)
Inventor
鲁浩
尹正文
魏云波
万军
罗仕庭
何成滔
王洪祥
杨雄兵
赵兴宗
曹瑞恒
余继慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PowerChina Kunming Engineering Corp Ltd
Original Assignee
PowerChina Kunming Engineering Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PowerChina Kunming Engineering Corp Ltd filed Critical PowerChina Kunming Engineering Corp Ltd
Priority to CN202410601005.3A priority Critical patent/CN118197060A/en
Publication of CN118197060A publication Critical patent/CN118197060A/en
Pending legal-status Critical Current

Links

Landscapes

  • Traffic Control Systems (AREA)

Abstract

The application discloses a traffic scheduling method, a traffic scheduling device, traffic scheduling equipment and a traffic scheduling storage medium for a single-channel tunnel, and relates to the technical field of electric digital data processing. According to the method, the passing conditions of motor vehicles, non-motor vehicles, pedestrians and animals in the single-channel tunnel are analyzed through historical flow data, the flow is judged through analyzing the sum of flow weight values at two ends of the single-channel tunnel, a traffic signal lamp is started after the sum of the two weight values exceeds a preset threshold value, when the weight value at one side is large but the weight value at the other side is very low or zero, the sum of the two weight values does not exceed the preset threshold value, the traffic signal lamp can smoothly pass through the side with the large weight value and cannot be influenced by the traffic signal lamp, the traffic signal lamp can be started only after the two ends have considerable passing flow and the sum of the weight values at the two ends exceeds the preset threshold value, otherwise, the traffic signal lamp is started or periodically flashing to remind the passing motor vehicles, the non-motor vehicles and the pedestrians of paying attention to safety, and the passing safety is guaranteed.

Description

Traffic scheduling method, device and equipment for single-channel tunnel and storage medium
Technical Field
The present application relates to the field of digital data processing technology, and in particular, to a traffic scheduling method, apparatus, device and storage medium for a single channel tunnel.
Background
Along with the rapid development of the traffic construction in China, the traffic convenience is greatly improved, but the roads with different grades, such as four-grade roads, village roads and the roads with the following grades, are mainly characterized by remote places and smaller traffic.
When the road is located in a non-flat area, the traffic is mainly realized through a single-channel tunnel, if a double-lane tunnel is arranged, the investment of the double-lane tunnel engineering is larger due to smaller traffic volume, and the built traffic volume is small, so that unnecessary waste is easily caused.
The problem that the traffic efficiency is low, the driving safety hidden trouble is large and the like because the single-channel tunnel cannot be staggered in the tunnel. In order to reduce the adverse effects as much as possible, the common practice is that a single-channel tunnel is mainly a medium-short tunnel, the width of a traffic lane is not smaller than 3.5m, a vehicle-avoiding hole is arranged in the tunnel with the length larger than 250m, and staggered lanes are arranged at two ends of the tunnel. The problems of low single-channel tunnel passing efficiency and high traffic safety hidden trouble are solved as much as possible by controlling the tunnel length and setting engineering measures of the staggered lanes.
However, in actual life, because the tunnel is an engineering structure buried under a mountain, the tunnel has adverse effects of insufficient light, insufficient viewing distance, poor signals and the like, so that the operation effect is not ideal after common engineering measures are adopted, and the difficulty in single-channel tunnel traffic jam and even traffic accidents and the like often occur.
Disclosure of Invention
The application mainly aims to provide a traffic scheduling method, device and equipment for a single-channel tunnel and a storage medium, so as to solve the problem that the safety of the single-channel tunnel in the prior art cannot be guaranteed.
In order to achieve the above object, the present application provides the following technical solutions:
The utility model provides a traffic scheduling method of single channel tunnel, the single channel tunnel is applied to level four highway and below road, the single channel tunnel has first traffic flow and the second traffic flow of opposite direction, mutual conflict, traffic signal lamp and warning light have been installed respectively to the both ends of single channel tunnel, traffic scheduling method includes:
Acquiring a plurality of first traffic flow data of the first traffic flow in a preset history period and a plurality of second traffic flow data of the second traffic flow in the preset history period;
Defining at least two flow types, classifying all first flow data into each flow type, and obtaining a first data classification table;
classifying all second flow data into each flow type to obtain a second data classification table;
Respectively assigning a weight level to each flow type, wherein each weight level is decreased along with the increment of the highest speed per hour of each flow type;
training and learning the first data classification table through a machine learning algorithm to obtain a first prediction data table;
training and learning the second data classification table through a machine learning algorithm to obtain a second prediction data table;
Respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first total weight value and a second total weight value;
obtaining the sum of absolute values of the first overall weight value and the second overall weight value;
And if the sum of the absolute values is smaller than or equal to a preset threshold value, starting the warning lamp, and if the sum of the absolute values is larger than the preset threshold value, starting the traffic signal lamp.
As a further improvement of the present application, acquiring a number of first traffic flow data of the first traffic flow in a preset history period and a number of second traffic flow data of the second traffic flow in the preset history period includes:
Acquiring first image data of the first traffic flow;
intercepting the first image data according to the time period of the preset history period to obtain a plurality of first image fragments;
Respectively acquiring all first moving targets moving to one direction of the single-channel tunnel in each first image fragment through a target detection algorithm, and marking each first moving target as first flow data;
acquiring second image data of the second traffic flow;
intercepting the second image data according to the time period of the preset history period to obtain a plurality of second image fragments;
And respectively acquiring all second moving targets moving to the other direction of the single-channel tunnel in each second image segment through the target detection algorithm, and marking each second moving target as second flow data.
As a further improvement of the present application, defining at least two traffic types and classifying all first traffic data into respective traffic types, a first data classification table is obtained, comprising:
defining a first set of data to be classified according to the first traffic data Wherein/>For the first set to be classified/>/>First flow data,/>The number of the first flow data;
defining a set of categories according to the traffic type Wherein, the method comprises the steps of, wherein,For the category set/>/>Type of traffic,/>The number of the flow types is the number;
calculating a first conditional probability for each first traffic data under each traffic type, respectively, according to equation (1);
(1);
Wherein, To at/>The first data set to be classified/>, under each traffic typeIs a first conditional probability of (2); /(I)For/>A first edge probability for each traffic type; /(I)To at/>/>, Under individual traffic typesA first conditional probability of the first traffic data;
And classifying each first flow data into the flow type with the highest first conditional probability respectively to form the first data classification table.
As a further improvement of the present application, classifying all second traffic data into respective traffic types to obtain a second data classification table, including:
Defining a second set of data to be classified from the second traffic data Wherein/>For the second set of classes/>/>Second flow data,/>A number of the second flow data;
Calculating a second conditional probability for each second traffic data for each traffic type, respectively, according to equation (2);
(2);
Wherein, To at/>The second data set to be classified/>, under each traffic typeIs a second conditional probability of (2); /(I)To at/>/>, Under individual traffic typesA second conditional probability of a second traffic data;
and classifying each second traffic data into the traffic type with the highest conditional probability respectively to form the second data classification table.
As a further improvement of the present application, training and learning the first data classification table by a machine learning algorithm to obtain a first predicted data table includes:
normalizing the first data classification table to obtain a first normalized data set;
Dividing the first normalized data set into a first training set and a first verification set according to a preset proportion;
defining a topological relation of a neural network model, wherein the topological relation comprises an input layer, an implicit layer and an output layer which are sequentially connected through signals;
Outputting the first training set to the input layer, and carrying out iteration for preset times through the neural network model, and respectively obtaining a first root mean square error of the first verification set and the training result of the current time based on each iteration;
acquiring the minimum value of all the first root mean square errors, and acquiring a training result corresponding to the minimum value of all the first root mean square errors as a first prediction model;
Acquiring first real-time flow data of the first traffic flow under a real-time condition, and classifying the first real-time flow data into each flow type to obtain a first real-time flow classification table;
And inputting the first real-time flow classification table into the first prediction model to obtain the first prediction data table.
As a further improvement of the present application, training and learning the second data classification table by a machine learning algorithm to obtain a second prediction data table includes:
normalizing the second data classification table to obtain a second normalized data set;
Dividing the second normalized data set into a second training set and a second verification set according to the preset proportion;
Outputting the second training set to the input layer, and carrying out iteration for preset times through the neural network model, and respectively obtaining a second root mean square error of the second verification set and the training result of the current time based on each iteration;
Acquiring the minimum value of all the second root mean square errors, and acquiring a training result corresponding to the minimum value of all the second root mean square errors as a second prediction model;
Acquiring second real-time flow data of the second traffic flow under real-time conditions, and classifying the second real-time flow data into each flow type to obtain a second real-time flow classification table;
And inputting the second real-time flow classification table into the second prediction model to obtain the second prediction data table.
As a further improvement of the present application, respectively weighted averaging the first prediction data table and the second prediction data table to obtain a first overall weight value and a second overall weight value, includes:
Calculating the first overall weight value according to equation (3):
(3);
Wherein, Is the first global weight value; /(I)For/>The number of first traffic data in the individual traffic types; /(I)For/>First weight values corresponding to the flow types;
Calculating the second overall weight value according to equation (4):
(4);
Wherein, Is the second global weight value; /(I)For/>The amount of second traffic data in the individual traffic types; /(I)For/>And a second weight value corresponding to each flow type.
In order to achieve the above purpose, the present application further provides the following technical solutions:
A traffic scheduling device for a single-channel tunnel, the traffic scheduling device being applied to the traffic scheduling method for a single-channel tunnel as described above, the traffic scheduling device comprising:
the historical traffic flow data acquisition module is used for acquiring a plurality of first traffic flow data of the first traffic flow in a preset historical period and a plurality of second traffic flow data of the second traffic flow in the preset historical period;
the flow type definition and classification module is used for defining at least two flow types and classifying all first flow data into each flow type to obtain a first data classification table;
The flow data classification module is used for classifying all second flow data into each flow type to obtain a second data classification table;
the weight grade giving module is used for giving a weight grade to each flow type respectively, and each weight grade is decreased along with the increment of the highest speed per hour of each flow type;
The first prediction data table acquisition module is used for training and learning the first data classification table through a machine learning algorithm so as to obtain a first prediction data table;
the second prediction data table acquisition module is used for training and learning the second data classification table through a machine learning algorithm so as to obtain a second prediction data table;
The overall weight value calculation module is used for respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first overall weight value and a second overall weight value;
a sum obtaining module of absolute values of total weight values, which is used for obtaining the sum of absolute values of the first total weight value and the second total weight value;
And the total weight absolute value sum judging module is used for starting the warning lamp if the total weight absolute value sum is smaller than or equal to a preset threshold value, and starting the traffic signal lamp if the total weight absolute value sum is larger than the preset threshold value.
In order to achieve the above purpose, the present application further provides the following technical solutions:
An electronic device comprising a processor, a memory coupled to the processor, the memory storing program instructions executable by the processor; and the processor realizes the traffic scheduling method of the single-channel tunnel when executing the program instructions stored in the memory.
In order to achieve the above purpose, the present application further provides the following technical solutions:
a storage medium having stored therein program instructions which, when executed by a processor, implement a traffic scheduling method capable of implementing a single channel tunnel as described above.
The method comprises the steps of obtaining a plurality of first traffic flow data of a first traffic flow in a preset historical period and a plurality of second traffic flow data of a second traffic flow in the preset historical period; defining at least two flow types, classifying all first flow data into each flow type, and obtaining a first data classification table; classifying all second flow data into each flow type to obtain a second data classification table; respectively assigning a weight level to each flow type, wherein each weight level is decreased along with the increment of the highest speed per hour of each flow type; training and learning the first data classification table through a machine learning algorithm to obtain a first prediction data table; training and learning a second data classification table through a machine learning algorithm to obtain a second prediction data table; respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first total weight value and a second total weight value; obtaining the sum of absolute values of the first total weight value and the second total weight value; if the sum of the absolute values is smaller than or equal to a preset threshold value, turning on a warning lamp, and if the sum of the absolute values is larger than the preset threshold value, turning on a traffic signal lamp. According to the application, the passing conditions of the motor vehicle, the non-motor vehicle, the pedestrian and the animal in the single-channel tunnel are analyzed through the historical flow data, the flow is judged through analyzing the sum of the flow weight values at the two ends of the single-channel tunnel, and a traffic signal lamp (traffic light) is started after the sum of the two weight values exceeds a preset threshold value.
Drawings
FIG. 1 is a schematic diagram of the steps in a traffic scheduling method for a single-channel tunnel according to an embodiment of the present application;
FIG. 2 is a schematic diagram of functional modules of an embodiment of a traffic scheduling device for a single-channel tunnel according to the present application;
FIG. 3 is a schematic diagram of an embodiment of an electronic device of the present application;
FIG. 4 is a schematic diagram illustrating the structure of an embodiment of a storage medium according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," "third," and the like in this disclosure are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "first," "second," and "third" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise. All directional indications (such as up, down, left, right, front, back … …) in the embodiments of the present application are merely used to explain the relative positional relationship, movement, etc. between the components in a particular gesture (as shown in the drawings), and if the particular gesture changes, the directional indication changes accordingly. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
As shown in fig. 1, the present embodiment provides an embodiment of a traffic scheduling method of a single-channel tunnel, in which the single-channel tunnel is applied to a level four highway and below, the single-channel tunnel has first traffic flow and second traffic flow (which can be understood as opposite traffic flow) that are opposite and conflict with each other, and traffic signal lamps and warning lamps are respectively installed at two ends of the single-channel tunnel.
Preferably, if the length of the single-channel tunnel is too long, for example, one kilometer or more, traffic lights (traffic lights) and warning lights (normally-on yellow lights or stroboscopic yellow lights) can be installed in the single-channel tunnel at preset intervals.
Specifically, the traffic scheduling method comprises the following steps:
step S1, a plurality of first traffic flow data of a first traffic flow in a preset historical period and a plurality of second traffic flow data of a second traffic flow in the preset historical period are obtained.
Preferably, the preset history period may be set to every hour, and the single channel tunnel with relatively large traffic to and from may be set to every half hour or fifteen minutes.
Preferably, the two ends of the single-channel tunnel are respectively an A end and a B end, so that the first traffic flow is motor vehicles, non-motor vehicles, pedestrians and animals passing from the A end to the B end, and the second traffic flow is motor vehicles, non-motor vehicles, pedestrians and animals passing from the B end to the A end.
And S2, defining at least two flow types, classifying all the first flow data into each flow type, and obtaining a first data classification table.
Preferably, the traffic type can be the traffic data of the motor vehicle, the non-motor vehicle, the pedestrian and the animal, which are obtained by statistics in a single cycle of a preset history cycle.
And S3, classifying all the second traffic data into each traffic type to obtain a second data classification table.
And S4, respectively assigning a weight level to each flow type, wherein each weight level is decreased along with the increment of the highest speed per flow type.
Preferably, the weight levels are set to 1,2,3,4 in order of highest speed of revolution of the motor vehicle, non-motor vehicle, animal, pedestrian (the highest speed of revolution is set here by common sense or experience, the highest speed of revolution may also be set by actual measurement, e.g. 30km/h for motor vehicle, 12km/h for non-motor vehicle, 8km/h for animal, 4km/h for pedestrian).
Step S5, training and learning the first data classification table through a machine learning algorithm to obtain a first prediction data table.
And S6, training and learning the second data classification table through a machine learning algorithm to obtain a second prediction data table.
Preferably, both step S5 and step S6 may employ a bp neural network.
And S7, respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first total weight value and a second total weight value.
Step S8, obtaining the sum of absolute values of the first total weight value and the second total weight value.
And S9, if the sum of the absolute values is smaller than or equal to a preset threshold value, turning on the warning lamp, and if the sum of the absolute values is larger than the preset threshold value, turning on the traffic signal lamp.
For example, taking a single-channel tunnel of a certain place as an example, a preset threshold value is set to be 6, and the first traffic flow (motor vehicle, non-motor vehicle, pedestrian and animal passing from the end A to the end B) of the single-channel tunnel in the past hour is obtained through statistics, as shown in the following table 1:
table 1: first traffic flow over the past hour.
The statistics of the application obtain the second traffic flow (motor vehicle, non-motor vehicle, pedestrian, animal passing from the end B to the end A) of the single-channel tunnel in the past hour as shown in the following table 2:
Table 2: a second traffic flow over the past hour.
It should be noted that the data in table 1 and table 2 can be obtained from the image data captured by the image capturing devices installed at both ends of the single-channel tunnel, and no manual field statistics is required.
The weighted average calculation of table 1 yields the first overall weight values as follows:
the weighted average calculation of table 2 yields a second overall weight value as follows:
the sum of the absolute values of the first total weight value and the second total weight value is 5.924, which is smaller than the preset threshold 6, and the warning lamp is turned on.
It should be noted that, the illustration of the embodiment is only for the purpose of illustrating the principle, the traffic of each single channel tunnel is different, the preset threshold should be adaptively adjusted, and the traffic and the preset threshold should be positively correlated.
Further, step S1, obtaining a plurality of first traffic flow data of a first traffic flow in a preset history period and a plurality of second traffic flow data of a second traffic flow in a preset history period, includes the following steps:
step S11, first image data of a first traffic flow is obtained.
Step S12, the first image data is intercepted according to a time period of a preset history period, and a plurality of first image fragments are obtained.
Step S13, all first moving targets moving towards one direction of the single-channel tunnel in each first image segment are respectively obtained through a target detection algorithm, and each first moving target is marked as first flow data.
Step S14, second image data of a second traffic flow is acquired.
And S15, intercepting the second image data according to a time period of a preset history period to obtain a plurality of second image fragments.
And S16, respectively acquiring all second moving targets moving to the other direction of the single-channel tunnel in each second image segment through a target detection algorithm, and marking each second moving target as second flow data.
Preferably, the target detection algorithm may pass through a target detection algorithm VJ, HOG, DPMDetector; a deep learning Two-stage target detection algorithm RCNN, SPPNet, fastRCNN, fasterRCNN; an algorithm FPN, cascadeRCNN for target detection Trick; deep learning one-stage target detection algorithm Yolo, X, SSD, retinaNet; a deep learning Anchor-free target detection algorithm CornerNet, centerNet, FCOS; based on a transducer target detection algorithm DETR, etc.
Preferably, this embodiment prefers Yolo algorithm.
Specifically, yolo algorithm can be implemented by the following preferred steps:
Preferably, in the step A1, the image data of traffic in the single-channel tunnel is captured by the image capturing members erected at both ends of the single-channel tunnel.
Preferably, in step A2, the image data is divided into a predetermined number of grids on average.
Preferably, the original picture of the image data may be resized to 448×448, and the resized picture may be equally divided into s×s (e.g., 7×7) grids, each of which has a size of 64×64.
Preferably, each grid is used for predictionThe coordinates and width-height of each detection frame, and the confidence of each detection frame, i.e. each grid needs to be predicted/>A value.
Preferably, step A3 predicts a number of bounding boxes for the target object in the image data based on all the grids.
Preferably, if the center of an object is located on a certain grid, the grid is responsible for predicting the bounding box of this object.
And (A4) preferably, respectively acquiring the confidence coefficient of each bounding box, and marking the bounding box with the highest confidence coefficient in all bounding boxes as a first-order bounding box.
And (A5) preferably, calculating the intersection ratio of each other boundary frame and the first-order boundary frame, and selecting the boundary frame with the intersection ratio being greater than or equal to a preset threshold value as the second-order boundary frame.
Preferably, the intersection ratio is the intersection of the optimal detection frame with each bounding box, respectively, divided by the union of the optimal detection frame with each bounding box, respectively, to obtain the ratio.
And (A6) preferably, acquiring a second-order boundary box with highest reliability in all the second-order boundary boxes and taking the second-order boundary box as a third-order boundary box.
It will be appreciated that each grid requires predictionPersonal/>; Wherein/>To detect the offset of the center of the frame relative to the grid,/>To detect the proportion of the frame relative to the resized picture,The confidence of the grid is 1 or 0.
Preferably, the confidence level is understood as the accuracy of whether or not there is a target within the current grid and the detection box.
Illustrating: setting a target in the picture after the size adjustment, and setting the width and the height of the picture after the size adjustment asThen:
dividing the picture into 7×7 grids on average, wherein there is one grid located at the center of the target, and the coordinates of the grid are Let the coordinates of the center of the target be/>Then according to/>The offset is calculated.
Preferably, in the actual detection, if the predicted detection frame and the actual bounding frame overlap perfectly, the value of the overlap ratio is 1. In the practical application process, the value of the first preset threshold may be generally set to 0.5 to determine whether the predicted bounding box is correct, and the more accurate the bounding box is in positive correlation with the cross-correlation ratio.
Preferably, the YOLO algorithm also requires training of the detection frame to improve the accuracy of target detection.
It should be noted that the above offset formula is only for illustrating the principle, and the letter symbols in the offset formula are not in communication with other places in the present embodiment.
It should be noted that, the training model of the detection frame is generally directly implemented through codes, for example:
“class Yolo(object):
def __init__(self, weights_file, verbose=True):
self.verbose = verbose
# detection params
self.S = 7# cell size
self.B = 2# boxes_per_cell
self.classes = [*]
self.C = len(self.classes) # number of classes
# offset for box center (top left point of each cell)
self.x_offset= np.transpose(np.reshape(np.array([np.arange(self.S)]*self.S*self.B),
[self.B, self.S, self.S]), [1, 2, 0])
self.y_offset = np.transpose(self.x_offset, [1, 0, 2])
self.threshold = 0.2# confidence scores threhold
self.iou_threshold = 0.4
#the maximum number of boxes to be selected by non max suppression
self.max_output_size = 10”。
The target category ". The". Sux "is to be identified herein may be set to" motorized vehicle "," Non-motorized vehicle "," person "," Non-person animal "to identify motor vehicles, non-motor vehicles, pedestrians, and animals, respectively.
And training the target detection training model through a pre-acquired target training set, and iteratively adjusting the weight and bias of the training model through a back propagation algorithm so as to reduce the value of a loss function of the target detection training model.
Preferably, the loss function is as follows:
Wherein, For/>/>, Of the gridWhether the detection frames are responsible for the indication function of the target or not is judged to be 1 or 0; /(I)、/>、/>、/>Corresponds to the/>, respectivelyPersonal/>Predicted values.
It is understood that the loss function includes a deviation of coordinate values of the detection frame, a deviation of confidence, a deviation of prediction probability (or a class deviation).
Wherein,Is the midpoint loss of the detection frame in coordinate value deviation,/>Is the loss of the width and the height of the detection frame in the coordinate value deviation,/>In order to be a deviation of the confidence level,To predict deviations in probability (or class deviations).
It should be noted that, since each grid does not necessarily contain an object, if there is no object in the grid, this will result inThe value of (2) is 0, so that the gradient span in the subsequent back propagation algorithm is overlarge, so that the introduction/>To control the loss of predicted position of the detection frame and the introduction/>There is no loss of targets within the control single grid.
It should be noted that the formulas related to the above preferred steps are only for explanation of the principle, and the letter symbols thereof are not communicated with other places in the present embodiment.
Further, in step S2, defining at least two traffic types and classifying all the first traffic data into each traffic type to obtain a first data classification table, which specifically includes the following steps:
step S21, defining a first data set to be classified according to the first traffic data Wherein/>For the first set to be classified/>/>First flow data,/>Is the number of first traffic data.
Step S22, defining a category set according to the traffic typeWherein/>For category set/>/>Type of traffic,/>Is the number of traffic types.
Step S23, calculating first conditional probabilities of each first flow data under each flow type according to the formula (1).
(1)。
Wherein,To at/>First data set to be classified/>, of next traffic typeIs a first conditional probability of (2); /(I)For/>A first edge probability for each traffic type; /(I)To at/>/>, Under individual traffic typesA first conditional probability of the first traffic data.
Step S24, each first flow data is classified into the flow type with the highest first conditional probability, and a first data classification table is formed.
Further, in step S3, all the second traffic data are classified into each traffic type to obtain a second data classification table, which specifically includes the following steps:
Step S31, defining a second data set to be classified according to the second traffic data Wherein/>For the second set to be classified/>The first of (3)Second flow data,/>Is the number of second traffic data.
Step S32, calculating second conditional probabilities of each second flow data under each flow type according to the formula (2).
(2)。
Wherein,To at/>Second data set to be classified/>, under each traffic typeIs a second conditional probability of (2); /(I)To at/>/>, Under individual traffic typesA second conditional probability of the second traffic data.
And step S33, classifying each second flow data into the flow type with the highest conditional probability, and forming a second data classification table.
Preferably, in this embodiment, naive bayes are used for classifying, and classifying each flow data into a flow type with the highest conditional probability, so as to prevent subjective errors in manual classification.
Specifically, naive bayes are defined as follows:
① Let x= { a1, a2, a3, … …, an } be a term to be classified, and each a be a feature of x.
② There is a category set c= { y 1,y2,y3,……,ym }.
③ P (y 1|x),P(y2|x),……,P(ym |x) was calculated.
④ If P (y k|x)=max{P(y1|x),P(y2|x),……,P(ym |x) }, x εy k.
And then calculating each conditional probability in the ③ th step through the following steps:
1. a set of items to be classified of known classification is found, this set being called a training sample set.
2. And (5) counting to obtain the conditional probability estimation of each characteristic attribute under each category. Namely:
P(a1|y1),P(a2|y1),……,P(an|y1)
P(a1|y2),P(a2|y2),……,P(an|y2);
……
P(a1|ym),P(a2|ym),……,P(an|ym);
3. assuming that the various feature attributes are conditional independent, there are, according to the bayesian principle:
P(yi|x)=P(x|yi)P(yi)/p(x)。
Since the denominator is constant for all categories, it is only necessary to maximize the numerator. And because each characteristic attribute is independent of the condition, then:
P(x|yi)P(yi)=P(a1|yi)P(a2|yi)……P(an|yi)P(yi).
The above preferred matters are also schematic illustrations, and the symbol meanings of the preferred matters are not mutually identical with those of other formulas in the embodiment.
Further, in step S5, the first data classification table is trained and learned by a machine learning algorithm to obtain a first prediction data table, which specifically includes the following steps:
step S51, normalization processing is carried out on the first data classification table, and a first normalized data set is obtained.
Preferably, the normalization method of zero-mean normalization (Z-score normalization) is preferred in this embodiment, and this method gives the mean (mean) and standard deviation (standard deviation) of the raw data to normalize the data, and the processed data conforms to the standard normal distribution, that is, the mean is 0 and the standard deviation is 1. For the normalization method, in this embodiment, batch normalization (Batch Normalization) may be used, compared with simple normalization when training is performed on the previous neural network, only normalization is performed on the input layer data, but no normalization is performed on the middle layer, although normalization is performed on the data set of the input node, the data distribution of the input data after matrix multiplication is more likely to be changed greatly, and as the number of network layers of the hidden layer is deepened continuously, the change of the data distribution will be larger and larger, so that the normalization is performed on the middle layer of the neural network by batch normalization, and the training effect is better.
Step S52, the first normalized data set is divided into a first training set and a first verification set according to a preset proportion.
Preferably, the preset ratio is typically 80%: the 20% ratio divides the image data into a training set and a verification set, namely 80% of the data is the training set and 20% of the data is the verification set.
Step S53, defining a topological relation of the neural network model, wherein the topological relation comprises an input layer, an implicit layer and an output layer which are connected in sequence in a signal mode.
Preferably, the topological relation is characterized by the following formula:
Wherein, Is a neural network model; /(I)Is the input layer of the first/>Input nodes, each input node corresponding to a set of training data of the training set,/>Is the input layer of the first/>Input node to hidden layer/>Preset weights of the input nodes; /(I)For connection to the hidden layer >A threshold of the input nodes; /(I)Is a transfer function, and。/>
Preferably, the numerals in brackets of the symbol corner marks in the topology of the present embodiment are the number of layers, e.gThe superscript (2) in (a) is the second layer, i.e. the hidden layer,/>The upper corner marks (1, 2) of (a) are from the first layer to the second layer, namely from the input layer to the hidden layer.
The sign meaning of the transfer function is not communicated with other places.
Step S54, the first training set is output to the input layer, iteration is carried out for preset times through the neural network model, and first root mean square errors of the first verification set and the current training result are obtained based on each iteration.
In step S55, the minimum value of all the first root mean square errors is obtained, and the training result corresponding to the minimum value of all the first root mean square errors is obtained as the first prediction model.
Preferably, the root mean square error is. Wherein/>Is root mean square error,/>For the number of training sets,/>For/>True value of the training set,/>For/>Training results after the training of the training sets are completed.
It should be noted that the root mean square error formula is only used for principle illustration, and the letter symbols and meanings of the root mean square error formula are not mutually communicated with other formulas in the embodiment.
Step S56, obtaining first real-time flow data of the first traffic flow under the real-time condition, and classifying the first real-time flow data into each flow type to obtain a first real-time flow classification table.
Step S57, inputting the first real-time flow classification table into a first prediction model to obtain a first prediction data table.
Further, step S6, training and learning the second data classification table by a machine learning algorithm to obtain a second prediction data table, includes the following steps:
Step S61, normalization processing is carried out on the second data classification table, and a second normalized data set is obtained.
Step S62, dividing the second normalized data set into a second training set and a second verification set according to a preset proportion.
Step S63, outputting the second training set to the input layer, and carrying out iteration for preset times through the neural network model, and respectively obtaining a second root mean square error of the second verification set and the current training result based on each iteration.
Step S64, obtaining the minimum value in all the second root mean square errors, and obtaining the training result corresponding to the minimum value in all the second root mean square errors as a second prediction model.
Step S65, obtaining second real-time flow data of the second traffic flow under the real-time condition and classifying the second real-time flow data into each flow type to obtain a second real-time flow classification table.
And step S66, inputting the second real-time flow classification table into a second prediction model to obtain a second prediction data table.
Preferably, training a model to train a neural network typically requires providing a large amount of data, i.e., a data set; the data sets are generally classified into three categories, namely training set (TRAINING SET) and validation set (validation set) as described above.
Wherein, one epoch (increase in number) is a process equal to one training with all samples in the training set, which means one forward propagation (forward pass) and one backward propagation (back pass); when the number of samples (i.e., training sets) of one epoch is too large, excessive time may be consumed for performing one training, and it is not necessary to use all data of the training set for each training, the whole training set needs to be divided into a plurality of small blocks, that is, a plurality of batches for performing the training; one epoch is made up of one or more latches, which are part of a training set, with only a portion of the data being used for each training process, i.e., one latch, and one iteration being used for training one latch.
Preferably, the neural network training specifically comprises a Perceptron (Perceptron) composed of two layers of neurons, an input layer receiving external input signals and transmitting the external input signals to an output layer, wherein the output layer is M-P neurons, and the output layer is provided withAs a step function, and given a training dataset, weight/>(/>=1, 2,..N) and training threshold/>Can be obtained by learning,/>It can be understood that a fixed input is a fixed value of-1, 0 corresponding to a weight/>
It should be noted that the step function is not interconnected with the symbolic meaning of the other formulas in the embodiment, and the step function is only schematically illustrated and does not participate in the calculation of the other formulas.
Preferably, the number of times of training the neural network in this embodiment may be set to 500 times.
Preferably, the learning rate of 1 st to 250 th epochs may be set to 0.01, the learning rate of 251 st to 325 th epochs may be set to 0.001, and the learning rate of 326 th to 1000 th epochs may be set to 0.0001.
It can be understood that the neural network training of this embodiment mainly includes the following ideas:
① Initializing weight and bias items in a network, and initializing parameter values (the weight of an output unit, the bias items, the weight of a hidden unit and the bias items are all parameters of a model) to obtain the output value of each layer of elements for activating forward propagation, thereby obtaining the value of a loss function.
② And activating forward propagation to obtain the output value of each layer and the expected value of the loss function of each layer.
③ According to the loss function, calculating an error term of the output unit and an error term of the hidden unit, calculating various errors, calculating a gradient of a parameter with respect to the loss function or calculating a partial derivative according to a calculus chain law. Solving partial derivatives for vectors or matrixes in the composite function, wherein the editing derivatives of the internal functions of the composite function are always multiplied left; for scalar bias derivative in the composite function, the derivative of the internal function of the composite function can be multiplied left or right.
④ The weights and bias terms in the neural network are updated.
⑤ And repeating ②~④ until the loss function is smaller than a preset threshold value or the iteration times are used up, and outputting the parameter at the moment to be the current optimal parameter.
Further, in step S7, the first prediction data table and the second prediction data table are weighted and averaged respectively to obtain a first total weight value and a second total weight value, and the step specifically includes the following steps:
Step S71, calculating a first total weight value according to equation (3):
(3)。
Wherein, Is a first overall weight value; /(I)For/>The number of first traffic data in the individual traffic types; for/> And a first weight value corresponding to each flow type.
Step S72, calculating a second overall weight value according to equation (4):
(4)。/>
Wherein, Is a second overall weight value; /(I)For/>The amount of second traffic data in the individual traffic types; for/> And a second weight value corresponding to each flow type.
In the embodiment, a plurality of first traffic flow data of a first traffic flow in a preset historical period and a plurality of second traffic flow data of a second traffic flow in the preset historical period are obtained; defining at least two flow types, classifying all first flow data into each flow type, and obtaining a first data classification table; classifying all second flow data into each flow type to obtain a second data classification table; respectively assigning a weight level to each flow type, wherein each weight level is decreased along with the increment of the highest speed per hour of each flow type; training and learning the first data classification table through a machine learning algorithm to obtain a first prediction data table; training and learning a second data classification table through a machine learning algorithm to obtain a second prediction data table; respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first total weight value and a second total weight value; obtaining the sum of absolute values of the first total weight value and the second total weight value; if the sum of the absolute values is smaller than or equal to a preset threshold value, the warning lamp is started, and if the sum of the absolute values is larger than the preset threshold value, the traffic signal lamp is started. According to the method, the device and the system, the passing conditions of the motor vehicle, the non-motor vehicle, the pedestrian and the animal in the single-channel tunnel are analyzed through historical flow data, the flow is judged through analyzing the sum of flow weight values at two ends of the single-channel tunnel, and a traffic signal lamp (traffic light) is started after the sum of the two weight values exceeds a preset threshold value.
As shown in fig. 2, the present embodiment provides an embodiment of a traffic scheduling apparatus of a single-channel tunnel, and in the present embodiment, the traffic scheduling apparatus is applied to the traffic scheduling method as in the above embodiment.
Specifically, the traffic scheduling device comprises a historical traffic data acquisition module 1, a traffic type definition and classification module 2, a traffic data classification module 3, a weight grade giving module 4, a first prediction data table acquisition module 5, a second prediction data table acquisition module 6, a total weight value calculation module 7, a total weight value absolute value sum acquisition module 8 and a total weight value absolute value sum judgment module 9 which are electrically connected in sequence.
The historical traffic flow data acquisition module 1 is used for acquiring a plurality of first traffic flow data of a first traffic flow in a preset historical period and a plurality of second traffic flow data of a second traffic flow in the preset historical period; the flow type definition and classification module 2 is used for defining at least two flow types and classifying all first flow data into each flow type to obtain a first data classification table; the flow data classification module 3 is used for classifying all second flow data into each flow type to obtain a second data classification table; the weight grade giving module 4 is used for giving a weight grade to each flow type respectively, and each weight grade is decreased along with the increment of the highest speed per flow type; the first prediction data table obtaining module 5 is configured to train and learn the first data classification table through a machine learning algorithm to obtain a first prediction data table; the second prediction data table obtaining module 6 is configured to train and learn a second data classification table through a machine learning algorithm to obtain a second prediction data table; the overall weight value calculation module 7 is used for respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first overall weight value and a second overall weight value; the total weight absolute value obtaining module 8 is configured to obtain a total absolute value of the first total weight value and the second total weight value; the total weight absolute value sum judging module 9 is used for turning on the warning lamp if the total absolute value sum is smaller than or equal to a preset threshold value, and turning on the traffic signal lamp if the total absolute value sum is larger than the preset threshold value.
Further, the historical flow data acquisition module comprises a first historical flow data acquisition sub-module, a second historical flow data acquisition sub-module, a third historical flow data acquisition sub-module, a fourth historical flow data acquisition sub-module, a fifth historical flow data acquisition sub-module and a sixth historical flow data acquisition sub-module which are electrically connected; the sixth historical flow data acquisition sub-module is electrically connected with the flow type definition and classification module.
The first historical traffic flow data acquisition submodule is used for acquiring first image data of a first traffic flow; the second historical flow data acquisition submodule is used for intercepting the first image data according to the time period of a preset historical period to obtain a plurality of first image fragments; the third historical flow data acquisition submodule is used for respectively acquiring all first moving targets moving to one direction of the single-channel tunnel in each first image fragment through a target detection algorithm, and marking each first moving target as first flow data; the fourth historical traffic data acquisition submodule is used for acquiring second image data of a second traffic flow; the fifth historical flow data acquisition submodule is used for intercepting the second image data according to the time period of a preset historical period to obtain a plurality of second image fragments; the sixth historical flow data acquisition submodule is used for respectively acquiring all second moving targets moving to the other direction of the single-channel tunnel in each second image segment through a target detection algorithm, and marking each second moving target as one second flow data.
Further, the flow type definition and classification module comprises a first flow type definition and classification module, a second flow type definition and classification module, a third flow type definition and classification module and a fourth flow type definition and classification module which are electrically connected in sequence; the first flow type definition and classification module is electrically connected with the sixth historical flow data acquisition submodule, and the fourth flow type definition and classification module is electrically connected with the flow data classification module.
Wherein the first traffic type definition and classification module is used for defining a first data set to be classified according to the first traffic dataWherein/>For the first set to be classified/>/>First flow data,/>Is the number of first traffic data.
The second traffic type definition and classification module is used for defining a class set according to the traffic typesWherein/>For category set/>/>Type of traffic,/>Is the number of traffic types.
The third flow type definition and classification module is configured to calculate a first conditional probability for each first flow data under each flow type, respectively, according to equation (1).
(1)。
Wherein,To at/>First data set to be classified/>, of next traffic typeIs a first conditional probability of (2); /(I)For/>A first edge probability for each traffic type; /(I)To at/>/>, Under individual traffic typesA first conditional probability of the first traffic data.
The fourth flow type definition and classification module is used for classifying each first flow data into the flow type with the highest first conditional probability respectively to form a first data classification table.
Further, the flow data classification module comprises a first flow data classification module, a second flow data classification module and a third flow data classification module which are electrically connected in sequence; the first flow data classification module, the second flow data classification module and the fourth flow type definition and classification module are electrically connected, and the third flow data classification module is electrically connected with the weight grade giving module.
Wherein the first traffic data classification module is used for defining a second data set to be classified according to the second traffic dataWherein/>For the second set to be classified/>The first of (3)Second flow data,/>Is the number of second traffic data.
The second traffic data classification module is used for calculating second conditional probabilities of each second traffic data under each traffic type respectively according to the formula (2).
(2)。
Wherein,To at/>Second data set to be classified/>, under each traffic typeIs a second conditional probability of (2); /(I)To at/>/>, Under individual traffic typesA second conditional probability of the second traffic data.
The third flow data classification module is used for classifying each second flow data into the flow type with the highest conditional probability respectively to form a second data classification table.
Further, the first prediction data table acquisition module comprises a first prediction data table acquisition sub-module, a second prediction data table acquisition sub-module, a third prediction data table acquisition sub-module, a fourth prediction data table acquisition sub-module, a fifth prediction data table acquisition sub-module, a sixth prediction data table acquisition sub-module and a seventh prediction data table acquisition sub-module which are electrically connected in sequence; the first prediction data table acquisition sub-module is electrically connected with the weight grade giving module, and the seventh prediction data table acquisition sub-module is electrically connected with the second prediction data table acquisition module.
The first prediction data table acquisition submodule is used for carrying out normalization processing on the first data classification table to obtain a first normalized data set; the second prediction data table acquisition submodule is used for dividing the first normalized data set into a first training set and a first verification set according to a preset proportion; the third prediction data table acquisition submodule is used for defining a topological relation of the neural network model, and the topological relation comprises an input layer, an implicit layer and an output layer which are connected in sequence in a signal manner; the fourth prediction data table obtaining submodule is used for outputting the first training set to the input layer, carrying out iteration for preset times through the neural network model, and respectively obtaining first root mean square errors of the first verification set and the current training result based on each iteration; the fifth prediction data table obtaining submodule is used for obtaining the minimum value in all the first root mean square errors and obtaining a training result corresponding to the minimum value in all the first root mean square errors as a first prediction model; the sixth prediction data table obtaining sub-module is used for obtaining first real-time traffic flow data of the first traffic flow under the real-time condition and classifying the first real-time traffic flow data into each traffic flow type to obtain a first real-time traffic flow classification table; and the seventh prediction data table acquisition submodule is used for inputting the first real-time flow classification table into the first prediction model to obtain a first prediction data table.
Further, the second prediction data table acquisition module comprises an eighth prediction data table acquisition sub-module, a ninth prediction data table acquisition sub-module, a tenth prediction data table acquisition sub-module, an eleventh prediction data table acquisition sub-module, a twelfth prediction data table acquisition sub-module and a thirteenth prediction data table acquisition sub-module which are electrically connected in sequence; the eighth prediction data table acquisition sub-module is electrically connected with the seventh prediction data table acquisition sub-module, and the thirteenth prediction data table acquisition sub-module is electrically connected with the overall weight value calculation module.
The eighth prediction data table acquisition submodule is used for carrying out normalization processing on the second data classification table to obtain a second normalized data set; the ninth prediction data table acquisition sub-module is used for dividing the second normalized data set into a second training set and a second verification set according to a preset proportion; the tenth prediction data table obtaining sub-module is used for outputting the second training set to the input layer, carrying out iteration for preset times through the neural network model, and respectively obtaining a second root mean square error of the second verification set and the training result of the current time based on each iteration; the eleventh prediction data table obtaining submodule is used for obtaining the minimum value in all the second root mean square errors and obtaining a training result corresponding to the minimum value in all the second root mean square errors as a second prediction model; the twelfth prediction data table obtaining sub-module is used for obtaining second real-time flow data of the second traffic flow under the real-time condition and classifying the second real-time flow data into each flow type to obtain a second real-time flow classification table; the thirteenth prediction data table obtaining sub-module is used for inputting the second real-time flow classification table into the second prediction model to obtain a second prediction data table.
Further, the overall weight value calculation module comprises a first overall weight value calculation sub-module and a second overall weight value calculation sub-module which are electrically connected in sequence; the first total weight value calculation sub-module is electrically connected with the thirteenth prediction data table acquisition sub-module, and the second total weight value calculation sub-module is electrically connected with the total weight value absolute value sum acquisition module.
Wherein the first total weight value calculation submodule is configured to calculate a first total weight value according to equation (3):
(3)。
Wherein, Is a first overall weight value; /(I)For/>The number of first traffic data in the individual traffic types; for/> And a first weight value corresponding to each flow type.
The second overall weight value calculation submodule is used for calculating a second overall weight value according to the formula (4):
(4)。
Wherein, Is a second overall weight value; /(I)For/>The amount of second traffic data in the individual traffic types; for/> And a second weight value corresponding to each flow type.
It should be noted that, the present embodiment is a functional module embodiment based on the foregoing method embodiment, and additional contents such as optimization, expansion, and illustration of the present embodiment may be referred to the foregoing method embodiment, which is not repeated herein.
It should be noted that, since the first prediction data table acquisition module is the same as the content executed by the first prediction data table acquisition module, functional merging may be performed, including respective sub-modules.
In the embodiment, a plurality of first traffic flow data of a first traffic flow in a preset historical period and a plurality of second traffic flow data of a second traffic flow in the preset historical period are obtained; defining at least two flow types, classifying all first flow data into each flow type, and obtaining a first data classification table; classifying all second flow data into each flow type to obtain a second data classification table; respectively assigning a weight level to each flow type, wherein each weight level is decreased along with the increment of the highest speed per hour of each flow type; training and learning the first data classification table through a machine learning algorithm to obtain a first prediction data table; training and learning a second data classification table through a machine learning algorithm to obtain a second prediction data table; respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first total weight value and a second total weight value; obtaining the sum of absolute values of the first total weight value and the second total weight value; if the sum of the absolute values is smaller than or equal to a preset threshold value, the warning lamp is started, and if the sum of the absolute values is larger than the preset threshold value, the traffic signal lamp is started. According to the method, the device and the system, the passing conditions of the motor vehicle, the non-motor vehicle, the pedestrian and the animal in the single-channel tunnel are analyzed through historical flow data, the flow is judged through analyzing the sum of flow weight values at two ends of the single-channel tunnel, and a traffic signal lamp (traffic light) is started after the sum of the two weight values exceeds a preset threshold value.
Fig. 3 illustrates an embodiment of the electronic device of the present application, and referring to fig. 3, the electronic device 10 includes a processor 101 and a memory 102 coupled to the processor 101.
The memory 102 stores program instructions for implementing the traffic scheduling method of the single-channel tunnel of any of the above embodiments.
The processor 101 is configured to execute program instructions stored in the memory 102 for traffic scheduling for single-channel tunnels.
The processor 101 may also be referred to as a CPU (Central Processing Unit ). The processor 101 may be an integrated circuit chip with signal processing capabilities. Processor 101 may 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 device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Further, fig. 4 is a schematic structural diagram of a storage medium according to an embodiment of the present application, referring to fig. 4, where the storage medium 11 according to an embodiment of the present application stores a program instruction 111 capable of implementing all the methods described above, where the program instruction 111 may be stored in the storage medium in the form of a software product, and includes several instructions for making a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes, or a terminal device such as a computer, a server, a mobile phone, a tablet, or the like.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other forms.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units. The foregoing is only the embodiments of the present application, and the patent scope of the application is not limited thereto, but is also covered by the patent protection scope of the application, as long as the equivalent structure or equivalent flow changes made by the description and the drawings of the application or the direct or indirect application in other related technical fields are adopted.
The embodiments of the present application have been described in detail above, but they are merely examples, and the present application is not limited to the above-described embodiments. It will be apparent to those skilled in the art that any equivalent modifications or substitutions to this application are within the scope of the application, and therefore, all equivalent changes and modifications, improvements, etc. that do not depart from the spirit and scope of the principles of the application are intended to be covered by this application.

Claims (10)

1. The utility model provides a traffic scheduling method of single channel tunnel, the single channel tunnel is applied to level four highway and below road, the single channel tunnel has first traffic flow and the second traffic flow of opposite direction, mutual conflict, traffic signal lamp and warning light have been installed respectively to the both ends of single channel tunnel, its characterized in that, traffic scheduling method includes:
Acquiring a plurality of first traffic flow data of the first traffic flow in a preset history period and a plurality of second traffic flow data of the second traffic flow in the preset history period;
Defining at least two flow types, classifying all first flow data into each flow type, and obtaining a first data classification table;
classifying all second flow data into each flow type to obtain a second data classification table;
Respectively assigning a weight level to each flow type, wherein each weight level is decreased along with the increment of the highest speed per hour of each flow type;
training and learning the first data classification table through a machine learning algorithm to obtain a first prediction data table;
training and learning the second data classification table through a machine learning algorithm to obtain a second prediction data table;
Respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first total weight value and a second total weight value;
obtaining the sum of absolute values of the first overall weight value and the second overall weight value;
And if the sum of the absolute values is smaller than or equal to a preset threshold value, starting the warning lamp, and if the sum of the absolute values is larger than the preset threshold value, starting the traffic signal lamp.
2. The traffic scheduling method according to claim 1, wherein acquiring a number of first traffic flow data of the first traffic flow in a preset history period and a number of second traffic flow data of the second traffic flow in the preset history period includes:
Acquiring first image data of the first traffic flow;
intercepting the first image data according to the time period of the preset history period to obtain a plurality of first image fragments;
Respectively acquiring all first moving targets moving to one direction of the single-channel tunnel in each first image fragment through a target detection algorithm, and marking each first moving target as first flow data;
acquiring second image data of the second traffic flow;
intercepting the second image data according to the time period of the preset history period to obtain a plurality of second image fragments;
And respectively acquiring all second moving targets moving to the other direction of the single-channel tunnel in each second image segment through the target detection algorithm, and marking each second moving target as second flow data.
3. The traffic scheduling method of claim 1, wherein defining at least two traffic types and classifying all first traffic data into each traffic type to obtain a first data classification table comprises:
defining a first set of data to be classified according to the first traffic data Wherein/>For the first set to be classified/>/>First flow data,/>The number of the first flow data;
defining a set of categories according to the traffic type Wherein/>For the category set/>/>Type of traffic,/>The number of the flow types is the number;
calculating a first conditional probability for each first traffic data under each traffic type, respectively, according to equation (1);
(1);
Wherein, To at/>The first data set to be classified/>, under each traffic typeIs a first conditional probability of (2); /(I)For/>A first edge probability for each traffic type; /(I)To at/>/>, Under individual traffic typesA first conditional probability of the first traffic data;
And classifying each first flow data into the flow type with the highest first conditional probability respectively to form the first data classification table.
4. A traffic scheduling method according to claim 3, wherein classifying all second traffic data into each traffic type to obtain a second data classification table comprises:
Defining a second set of data to be classified from the second traffic data Wherein/>For the second set of classes/>/>Second flow data,/>A number of the second flow data;
Calculating a second conditional probability for each second traffic data for each traffic type, respectively, according to equation (2);
(2);
Wherein, To at/>The second data set to be classified/>, under each traffic typeIs a second conditional probability of (2); /(I)To at/>/>, Under individual traffic typesA second conditional probability of a second traffic data;
and classifying each second traffic data into the traffic type with the highest conditional probability respectively to form the second data classification table.
5. The traffic scheduling method of claim 1, wherein training and learning the first data classification table by a machine learning algorithm to obtain a first predictive data table comprises:
normalizing the first data classification table to obtain a first normalized data set;
Dividing the first normalized data set into a first training set and a first verification set according to a preset proportion;
defining a topological relation of a neural network model, wherein the topological relation comprises an input layer, an implicit layer and an output layer which are sequentially connected through signals;
Outputting the first training set to the input layer, and carrying out iteration for preset times through the neural network model, and respectively obtaining a first root mean square error of the first verification set and the training result of the current time based on each iteration;
acquiring the minimum value of all the first root mean square errors, and acquiring a training result corresponding to the minimum value of all the first root mean square errors as a first prediction model;
Acquiring first real-time flow data of the first traffic flow under a real-time condition, and classifying the first real-time flow data into each flow type to obtain a first real-time flow classification table;
And inputting the first real-time flow classification table into the first prediction model to obtain the first prediction data table.
6. The traffic scheduling method of claim 5, wherein training and learning the second data classification table by a machine learning algorithm to obtain a second predictive data table comprises:
normalizing the second data classification table to obtain a second normalized data set;
Dividing the second normalized data set into a second training set and a second verification set according to the preset proportion;
Outputting the second training set to the input layer, and carrying out iteration for preset times through the neural network model, and respectively obtaining a second root mean square error of the second verification set and the training result of the current time based on each iteration;
Acquiring the minimum value of all the second root mean square errors, and acquiring a training result corresponding to the minimum value of all the second root mean square errors as a second prediction model;
Acquiring second real-time flow data of the second traffic flow under real-time conditions, and classifying the second real-time flow data into each flow type to obtain a second real-time flow classification table;
And inputting the second real-time flow classification table into the second prediction model to obtain the second prediction data table.
7. The traffic scheduling method of claim 4, wherein weighting the first prediction data table and the second prediction data table to obtain a first overall weight value and a second overall weight value, respectively, comprises:
Calculating the first overall weight value according to equation (3):
(3);
Wherein, Is the first global weight value; /(I)For/>The number of first traffic data in the individual traffic types; for/> First weight values corresponding to the flow types;
Calculating the second overall weight value according to equation (4):
(4);
Wherein, Is the second global weight value; /(I)For/>The amount of second traffic data in the individual traffic types; for/> And a second weight value corresponding to each flow type.
8. Traffic scheduling device for a single-lane tunnel, applied to the traffic scheduling method for a single-lane tunnel according to any one of claims 1 to 7, characterized in that it comprises:
the historical traffic flow data acquisition module is used for acquiring a plurality of first traffic flow data of the first traffic flow in a preset historical period and a plurality of second traffic flow data of the second traffic flow in the preset historical period;
the flow type definition and classification module is used for defining at least two flow types and classifying all first flow data into each flow type to obtain a first data classification table;
The flow data classification module is used for classifying all second flow data into each flow type to obtain a second data classification table;
the weight grade giving module is used for giving a weight grade to each flow type respectively, and each weight grade is decreased along with the increment of the highest speed per hour of each flow type;
The first prediction data table acquisition module is used for training and learning the first data classification table through a machine learning algorithm so as to obtain a first prediction data table;
the second prediction data table acquisition module is used for training and learning the second data classification table through a machine learning algorithm so as to obtain a second prediction data table;
The overall weight value calculation module is used for respectively weighted-averaging the first prediction data table and the second prediction data table to obtain a first overall weight value and a second overall weight value;
a sum obtaining module of absolute values of total weight values, which is used for obtaining the sum of absolute values of the first total weight value and the second total weight value;
And the total weight absolute value sum judging module is used for starting the warning lamp if the total weight absolute value sum is smaller than or equal to a preset threshold value, and starting the traffic signal lamp if the total weight absolute value sum is larger than the preset threshold value.
9. An electronic device comprising a processor, and a memory coupled to the processor, the memory storing program instructions executable by the processor; the processor, when executing the program instructions stored by the memory, implements the traffic scheduling method for a single channel tunnel according to any one of claims 1 to 7.
10. A storage medium having stored therein program instructions which, when executed by a processor, implement a traffic scheduling method capable of implementing the single channel tunnel of any one of claims 1 to 7.
CN202410601005.3A 2024-05-15 2024-05-15 Traffic scheduling method, device and equipment for single-channel tunnel and storage medium Pending CN118197060A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410601005.3A CN118197060A (en) 2024-05-15 2024-05-15 Traffic scheduling method, device and equipment for single-channel tunnel and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410601005.3A CN118197060A (en) 2024-05-15 2024-05-15 Traffic scheduling method, device and equipment for single-channel tunnel and storage medium

Publications (1)

Publication Number Publication Date
CN118197060A true CN118197060A (en) 2024-06-14

Family

ID=91400770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410601005.3A Pending CN118197060A (en) 2024-05-15 2024-05-15 Traffic scheduling method, device and equipment for single-channel tunnel and storage medium

Country Status (1)

Country Link
CN (1) CN118197060A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004077377A1 (en) * 2003-02-27 2004-09-10 Shaopeng Yang Road traffic control method and traffic facilities
CN101989381A (en) * 2010-11-15 2011-03-23 福建工程学院 Method for road one-way restriction and traffic state identification based on floating car technology
CN108364490A (en) * 2018-01-17 2018-08-03 佛山杰致信息科技有限公司 Municipal highway transit system vehicle runs regulation and control method
CN109544946A (en) * 2019-01-03 2019-03-29 南京城建隧桥经营管理有限责任公司 Tunnel real-time monitoring and managing system and its implementation based on vehicle flowrate big data
WO2020104423A1 (en) * 2018-11-20 2020-05-28 Volkswagen Aktiengesellschaft Method and apparatus for data fusion of lidar data and image data
CN113470363A (en) * 2021-08-31 2021-10-01 深圳市城市交通规划设计研究中心股份有限公司 Method and device for calculating road traffic capacity
CN114530046A (en) * 2022-01-28 2022-05-24 启迪设计集团股份有限公司 Method and device for judging requirement of setting right turn signal lamp at intersection
CN116229659A (en) * 2023-05-08 2023-06-06 四川省交通勘察设计研究院有限公司 Tunnel traffic control system and traffic control method suitable for low-grade highway
CN116564111A (en) * 2023-07-10 2023-08-08 中国电建集团昆明勘测设计研究院有限公司 Vehicle early warning method, device and equipment for intersection and storage medium
CN116935654A (en) * 2023-09-15 2023-10-24 北京安联通科技有限公司 Smart city data analysis method and system based on data distribution value
CN117351702A (en) * 2023-09-15 2024-01-05 中科国力电子技术有限公司 Intelligent traffic management method based on adjustment of traffic flow

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004077377A1 (en) * 2003-02-27 2004-09-10 Shaopeng Yang Road traffic control method and traffic facilities
CN101989381A (en) * 2010-11-15 2011-03-23 福建工程学院 Method for road one-way restriction and traffic state identification based on floating car technology
CN108364490A (en) * 2018-01-17 2018-08-03 佛山杰致信息科技有限公司 Municipal highway transit system vehicle runs regulation and control method
WO2020104423A1 (en) * 2018-11-20 2020-05-28 Volkswagen Aktiengesellschaft Method and apparatus for data fusion of lidar data and image data
CN109544946A (en) * 2019-01-03 2019-03-29 南京城建隧桥经营管理有限责任公司 Tunnel real-time monitoring and managing system and its implementation based on vehicle flowrate big data
CN113470363A (en) * 2021-08-31 2021-10-01 深圳市城市交通规划设计研究中心股份有限公司 Method and device for calculating road traffic capacity
CN114530046A (en) * 2022-01-28 2022-05-24 启迪设计集团股份有限公司 Method and device for judging requirement of setting right turn signal lamp at intersection
CN116229659A (en) * 2023-05-08 2023-06-06 四川省交通勘察设计研究院有限公司 Tunnel traffic control system and traffic control method suitable for low-grade highway
CN116564111A (en) * 2023-07-10 2023-08-08 中国电建集团昆明勘测设计研究院有限公司 Vehicle early warning method, device and equipment for intersection and storage medium
CN116935654A (en) * 2023-09-15 2023-10-24 北京安联通科技有限公司 Smart city data analysis method and system based on data distribution value
CN117351702A (en) * 2023-09-15 2024-01-05 中科国力电子技术有限公司 Intelligent traffic management method based on adjustment of traffic flow

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
QUNMING Y U: "The Prediction and Analysis of the Road Tunnel Traffic Flow", 《THE PREDICTION AND ANALYSIS OF THE ROAD TUNNEL TRAFFIC FLOW》, 31 December 2007 (2007-12-31) *
周旦;赵红专;许镭;: "单向非机动道路内混合自行车交通状态判别", 现代交通技术, no. 04, 26 August 2020 (2020-08-26) *

Similar Documents

Publication Publication Date Title
US20240132078A1 (en) Driving model training method, driver identification method, apparatus, device and medium
US11842271B2 (en) Multi-scale multi-granularity spatial-temporal traffic volume prediction
CN106971563B (en) Intelligent traffic signal lamp control method and system
CN103605362B (en) Based on motor pattern study and the method for detecting abnormality of track of vehicle multiple features
CN111091712A (en) Traffic flow prediction method based on cyclic attention dual graph convolution network
CN111009153A (en) Training method, device and equipment of trajectory prediction model
CN107985189B (en) Early warning method for lane changing depth of driver in high-speed driving environment
US11816841B2 (en) Method and system for graph-based panoptic segmentation
Ivanovic et al. Injecting planning-awareness into prediction and detection evaluation
Rossi et al. Vehicle trajectory prediction and generation using LSTM models and GANs
EP4145345A1 (en) Data annotation method and device, and fine granularity identification method and device
CN112991750B (en) Local traffic optimization method based on reinforcement learning and generation type countermeasure network
Gao et al. Short-term traffic speed forecasting using a deep learning method based on multitemporal traffic flow volume
CN101739685B (en) Moving object classification method and system thereof
US20220028180A1 (en) Shape-based vehicle classification using laser scan and neural network
Tabibiazar et al. Kernel-based modeling and optimization for density estimation in transportation systems using floating car data
Tabibiazar et al. Kernel-based optimization for traffic density estimation in ITS
Zhang et al. Link duration prediction in vanets via adaboost
CN104700427A (en) Road damage information extracting method based on SAR images
CN118197060A (en) Traffic scheduling method, device and equipment for single-channel tunnel and storage medium
WO2021150166A1 (en) Determining a route between an origin and a destination
Chen et al. Machine learning forecasts of Scandinavian numerical weather prediction wind model residuals with control theory for wind energy
CN114023074B (en) Traffic jam prediction method, device and medium based on multiple signal sources
US20220114458A1 (en) Multimodal automatic mapping of sensing defects to task-specific error measurement
Bélisle et al. Optimized video tracking for automated vehicle turning movement counts

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination