CN116913092A - Traffic state prediction method, traffic state prediction device, electronic equipment and storage medium - Google Patents
Traffic state prediction method, traffic state prediction device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116913092A CN116913092A CN202310871439.0A CN202310871439A CN116913092A CN 116913092 A CN116913092 A CN 116913092A CN 202310871439 A CN202310871439 A CN 202310871439A CN 116913092 A CN116913092 A CN 116913092A
- Authority
- CN
- China
- Prior art keywords
- traffic
- time
- traffic state
- sequence
- state
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 80
- 230000014509 gene expression Effects 0.000 claims abstract description 81
- 230000008447 perception Effects 0.000 claims abstract description 63
- 230000006870 function Effects 0.000 claims description 47
- 238000012545 processing Methods 0.000 claims description 17
- 238000006243 chemical reaction Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 12
- 238000010606 normalization Methods 0.000 claims description 10
- 230000000737 periodic effect Effects 0.000 claims description 8
- 238000013473 artificial intelligence Methods 0.000 abstract description 3
- 238000013135 deep learning Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 15
- 238000004891 communication Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 10
- 230000001788 irregular Effects 0.000 description 7
- 238000012549 training Methods 0.000 description 6
- 238000013528 artificial neural network Methods 0.000 description 5
- 238000009825 accumulation Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000001413 cellular effect Effects 0.000 description 2
- 238000013527 convolutional neural network Methods 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
- G08G1/0129—Traffic data processing for creating historical data or processing based on historical data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2474—Sequence data queries, e.g. querying versioned data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/26—Government or public services
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Tourism & Hospitality (AREA)
- Strategic Management (AREA)
- Human Resources & Organizations (AREA)
- Economics (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Development Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Traffic Control Systems (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Probability & Statistics with Applications (AREA)
- Game Theory and Decision Science (AREA)
- Mathematical Physics (AREA)
- Fuzzy Systems (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Quality & Reliability (AREA)
- Operations Research (AREA)
- Analytical Chemistry (AREA)
- Data Mining & Analysis (AREA)
- Educational Administration (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Primary Health Care (AREA)
- Chemical & Material Sciences (AREA)
Abstract
The disclosure provides a traffic state prediction method, a traffic state prediction device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence and deep learning. The method comprises the following steps: acquiring traffic state data of each traffic signal period of a road intersection to be tested in a historical time window; determining a traffic state sequence introducing time intervals according to the traffic state data; acquiring a time perception parameter sequence according to the traffic state sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence; acquiring traffic state expression in a historical time window according to the time perception parameter sequence and the traffic state sequence; according to the traffic state expression, predicting traffic state prediction data of each traffic signal period in a future time window; wherein the historical time window is continuous in time with the future time window.
Description
Technical Field
The disclosure relates to the technical field of data processing, in particular to the technical field of artificial intelligence and deep learning, and especially relates to a traffic state prediction method, a traffic state prediction device, electronic equipment and a storage medium.
Background
An intelligent traffic signal control system (Intelligent Traffic Signal Control System, ITSCS) is one of the necessary infrastructure to facilitate the development of autopilot. Through Vehicle-to-Infrastructure (V2I) communication technology, ITSCS can provide key information such as traffic signal status and surrounding traffic environment for the autopilot car.
Among them, one of the important capabilities of ITSCS is to predict the traffic state of intersections controlled by intelligent traffic signals, and accurately predicting the traffic state of intersections is critical to route planning and navigation decisions with foresight for autonomous vehicles.
Disclosure of Invention
The disclosure provides a traffic state prediction method, a traffic state prediction device, electronic equipment and a storage medium.
According to a first aspect of the present disclosure, there is provided a traffic state prediction method, including:
acquiring traffic state data of each traffic signal period of a road intersection to be tested in a historical time window;
determining a traffic state sequence introducing time intervals according to the traffic state data;
acquiring a time perception parameter sequence according to the traffic state sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence;
acquiring traffic state expression in a historical time window according to the time perception parameter sequence and the traffic state sequence;
According to the traffic state expression, predicting traffic state prediction data of each traffic signal period in a future time window; wherein the historical time window is continuous in time with the future time window.
According to a second aspect of the present disclosure, there is provided a traffic state prediction method including:
acquiring traffic state data of each traffic signal period of a road intersection to be tested in a historical time window;
determining a traffic state sequence introducing time intervals according to the traffic state data;
and inputting the traffic state sequence into a preset traffic state prediction model, and acquiring traffic state prediction data of each traffic signal period in a future time window, wherein the historical time window and the future time window are continuous in time.
According to a third aspect of the present disclosure, there is provided a traffic state prediction apparatus including:
the first acquisition module is used for acquiring traffic state data of each traffic signal period of the road intersection to be detected in the historical time window;
the first determining module is used for determining a traffic state sequence introducing a time interval according to the traffic state data;
the second acquisition module is used for acquiring a time perception parameter sequence according to the traffic state sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence;
The third acquisition module is used for acquiring traffic state expression in a historical time window according to the time perception parameter sequence and the traffic state sequence of the introduced time interval;
the prediction module is used for predicting traffic state prediction data of each traffic signal period in a future time window according to the traffic state expression; wherein the historical time window is continuous in time with the future time window.
According to a fourth aspect of the present disclosure, there is provided a traffic state prediction apparatus including:
the acquisition module is used for acquiring traffic state data of each traffic signal period of the road intersection to be detected in the historical time window;
the determining module is used for determining a traffic state sequence of introducing a time interval according to the traffic state data;
the prediction module is used for inputting the traffic state sequence into a preset traffic state prediction model and acquiring traffic state prediction data of each traffic signal period in a future time window; wherein the historical time window is continuous in time with the future time window.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect and/or to perform the method of the second aspect.
According to a sixth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of the first aspect and/or to perform the method of the second aspect.
According to a seventh aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect and/or performs the method of the second aspect.
According to the technical scheme, the traffic state data of each traffic signal period of the road intersection to be detected in the historical time window is obtained, the traffic state sequence introducing the time interval is determined according to the traffic state data, the time perception parameter sequence is obtained according to the traffic state sequence, the length of the time perception parameter sequence is consistent with the length of the traffic state sequence, the traffic state expression in the historical time window is obtained according to the time perception parameter sequence and the traffic state sequence, and finally the traffic state prediction data of each traffic signal period in the future time window is predicted according to the traffic state expression. The scheme is suitable for the prediction of traffic state data with irregular time intervals and different sequence lengths due to the introduction of the time intervals and the time perception parameter sequences, so that the accuracy of road intersection traffic state prediction can be improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 3 is a schematic diagram according to a third embodiment of the present disclosure;
FIG. 4 is a schematic diagram according to a fourth embodiment of the present disclosure;
FIG. 5 is a schematic diagram according to a fifth embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a traffic state prediction model according to an embodiment of the disclosure;
FIG. 7 is a schematic diagram according to a sixth embodiment of the present disclosure;
FIG. 8 is a schematic diagram according to a seventh embodiment of the present disclosure;
FIG. 9 is a schematic diagram according to an eighth embodiment of the present disclosure;
fig. 10 is a block diagram of an electronic device for implementing a traffic state prediction method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the intelligent traffic signal control system (Intelligent Traffic Signal Control System, ITSCS) is one of the essential infrastructures for promoting the development of automatic driving. Through Vehicle-to-Infrastructure (V2I) communication technology, ITSCS can provide key information such as traffic signal status and surrounding traffic environment for the autopilot car.
Among them, one of the important capabilities of ITSCS is to predict the traffic state of intersections controlled by intelligent traffic signals, and accurately predicting the traffic state of intersections is critical to route planning and navigation decisions with foresight for autonomous vehicles.
Since the traffic signal period of road intersections is varied and the traffic signal period of different road intersections is also different, prediction of traffic conditions requires prediction for irregular time intervals and traffic condition sequences of different lengths. Existing traffic prediction techniques are designed for traffic sequences having fixed time intervals and fixed predicted sequence lengths. Methods in the related art may include two types, one being a cyclic neural network-based method, using a cyclic neural network to model the time dependence of a traffic sequence, and then predicting a future traffic sequence based on an autoregressive manner. The other type is a method based on a convolutional neural network, wherein the convolutional neural network is used for modeling the time dependence of the traffic sequence, and then the future whole traffic sequence is predicted based on a non-sub regression mode.
Based on the above problems, the disclosure provides a traffic state prediction method, a traffic state prediction device, an electronic device and a storage medium.
It should be noted that, in the technical solution of the present disclosure, the acquisition, storage, application, etc. of the related personal information of the user all conform to the rules of the related laws and regulations, and do not violate the popular regulations of the public order. The user personal information involved is acquired, stored and applied in the event of contending for user consent.
Fig. 1 is a flowchart of a traffic state prediction method provided in an embodiment of the present disclosure. It should be noted that the traffic state prediction method according to the embodiment of the present disclosure may be applied to the traffic state prediction apparatus according to the embodiment of the present disclosure, and the traffic state prediction apparatus may be configured in an electronic device. As shown in fig. 1, the traffic state prediction method includes the steps of:
step 101, obtaining traffic state data of each traffic signal period of the road crossing to be detected in a historical time window.
The road intersection to be detected can be a certain intersection on a certain road to be predicted, can be a plurality of intersections on a certain road to be predicted, can be determined according to actual requirements, and is not limited by the disclosure.
In some embodiments of the present disclosure, the historical time window may be a period of historical time including the current time, where the length of the historical time window may be any length of time. In addition, the traffic signal period refers to the period of the signal lamp of the road intersection to be tested, and each traffic signal period in the history time window refers to each cycle period of the signal lamp of the road intersection to be tested in the period of the history time window, for example, the signal lamp changes from a green lamp to a yellow lamp and then changes from the green lamp to a cycle period.
As one possible implementation, the traffic state data for each traffic signal cycle may include the traffic flow and duration of each traffic signal cycle. The duration of each traffic signal period is the duration of each cycle period of the signal lamp. The traffic flow of each traffic signal period refers to the traffic flow of the road junction to be measured in the traffic signal period. As an example, the traffic flow of each traffic signal period may be acquired based on a vehicle image captured by a camera of the road junction under test within a historical time window, such as performing object recognition based on the captured vehicle image to acquire the traffic flow at each moment, so that the traffic flow in each traffic signal period may be acquired. The duration of each traffic signal period can be acquired based on the intelligent traffic signal control system, for example, a period duration request can be sent to the intelligent traffic signal control system, wherein the period duration request comprises a historical time window and a road intersection identifier to be tested, and the duration of each traffic signal period in the historical time window returned by the intelligent traffic signal intelligent system based on the period duration request is acquired.
For example, if the road intersection to be measured is a certain intersection of a certain road and there are 8 traffic signal periods in the history time window, the traffic state data = { X of each traffic signal period in the history time window 1 ,X 2 ,…,X 7 ,X 8 Traffic state data of the ith traffic signal cycle is X i . Wherein the traffic state data includes the traffic flow and the duration of each traffic signal period, i.e., xi =<p i ,f i >Wherein p is i Is the duration of the ith traffic signal period, f i Is the traffic flow for the ith traffic signal cycle.
Step 102, determining a traffic state sequence introducing time intervals according to the traffic state data.
It can be understood that the traffic state data of the traffic signal period of the road intersection to be measured is time-varying, so that the traffic state data of the traffic signal period of the intersection is also different at different time intervals. In addition, the time interval between the time corresponding to the traffic state data of the traffic signal period and the future time window can also express the importance degree of the traffic state data in the historical time window. That is, the time interval is a factor affecting the traffic state, so the time interval may be introduced, and the traffic state sequence in which the time interval is introduced is determined from the traffic state data.
As an embodiment, the time interval may be the time interval between the end of each traffic signal period within the historical time window and the end of the historical time window. For example, when the time when the first traffic signal period ends in the historical time window is time a, and when the time when the historical time window ends is time B, the time interval corresponding to the traffic state data of the first traffic signal period is the interval between time B and time a. Based on the traffic state data, the end time of each traffic signal period in the historical time window can be determined, so the end time of the historical time window and the end time of each traffic signal period can be differenced, and the time interval corresponding to the traffic state data of each traffic signal period can be acquired. And the traffic state data of each traffic signal period and the corresponding time interval are spliced to obtain a traffic state sequence introducing the time interval.
Step 103, obtaining a time perception parameter sequence according to the traffic state sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence.
In some embodiments of the present disclosure, the time-aware parameter may be understood as a correlation between time and traffic state data, and the time-aware parameter sequence corresponds to a conversion based on the traffic state sequence. As an example, each element in the traffic state sequence may be data converted in turn to obtain a time-aware parameter sequence.
As an example, the traffic state sequence may be input to a meta-filter instantiated by a learned neural network, each element in the traffic state sequence being processed separately based on the meta-filter, the output of the meta-filter being composed into a time-aware parameter sequence.
And 104, acquiring the traffic state expression in the historical time window according to the time perception parameter sequence and the traffic state sequence.
In some embodiments of the present disclosure, the traffic state expression within the historical time window refers to the overall traffic state information of each traffic signal cycle of the road junction under test during that time. That is, based on the time perception parameter sequence, the traffic state sequence is subjected to feature extraction, and the traffic state feature information of each traffic signal period in the historical time window is obtained. Because the length of the time-aware parameter sequence is consistent with the length of the traffic state sequence, the traffic state prediction method of the embodiment of the disclosure can be applied to traffic state sequences of any length.
As a possible implementation manner, the traffic state sequence may be convolved based on the time-aware parameter sequence to obtain the traffic state expression in the historical time window. Wherein the parameters for performing the convolution operation are determined based on a sequence of time-aware parameters.
As another possible implementation manner, a corresponding relationship between the time perception parameter and the traffic state weight may be pre-constructed, weight information corresponding to each traffic signal period may be determined based on the time perception parameter sequence, and the traffic state expression in the historical time window may be obtained according to the weight information corresponding to each traffic signal period and the traffic state sequence.
Step 105, predicting traffic state prediction data of each traffic signal period in a future time window according to the traffic state expression; wherein the historical time window is continuous in time with the future time window.
In some embodiments of the present disclosure, the future time window may include a time period next to and after the current time instant, that is, the historical time window and the future time window may be consecutive in time. The duration of the future time window may be a preset duration. In addition, the traffic state prediction data of each traffic signal period in the future time window is consistent with the content contained in the traffic state data of each traffic signal period in the history time window. For example, the traffic state data includes the traffic flow and duration of each traffic signal cycle, and the traffic state prediction data also includes the traffic flow and duration of each traffic signal cycle.
As an example, from the traffic state representation, an implementation of the traffic state prediction data to predict each traffic signal period within a future time window may include: based on the traffic state expression in the historical time period, calculating the traffic state expression evolving into a future time window, and predicting traffic state prediction data of each traffic signal period in the time window according to the traffic state expression in the future time window.
As another example, a plurality of traffic state expression data may be determined in advance based on a large amount of historical traffic state data, and a prediction model may be trained on traffic state label data corresponding to each of the traffic state expression data such that the prediction model learns to derive a mapping relationship between the historical traffic state expression and the traffic state data over a future period of time. By inputting the traffic state representation in the historical time window into the predictive model, traffic state data for each traffic signal cycle in the future time window can be obtained.
According to the traffic state prediction method of the embodiment of the disclosure, traffic state data of each traffic signal period of a road intersection to be detected in a historical time window is obtained, a traffic state sequence introducing a time interval is determined according to the traffic state data, a time perception parameter sequence is obtained according to the traffic state sequence, the length of the time perception parameter sequence is consistent with that of the traffic state sequence, traffic state expression in the historical time window is obtained according to the time perception parameter sequence and the traffic state sequence, and finally traffic state prediction data of each traffic signal period in a future time window is predicted according to the traffic state expression. The scheme is suitable for the prediction of traffic state data with irregular time intervals and different sequence lengths due to the introduction of the time intervals and the time perception parameter sequences, so that the accuracy of road intersection traffic state prediction can be improved.
Next, description will be made regarding an implementation procedure of a traffic state sequence in which an introduction time interval is determined from traffic state data.
Fig. 2 is a flow chart of an implementation process of determining a traffic state sequence for introducing a time interval in an embodiment of the present disclosure. As shown in fig. 2, based on the above embodiment, step 102 in fig. 1, an implementation of determining a traffic state sequence for introducing a time interval according to traffic state data may include the following steps:
step 201, determining a time interval between the end of each traffic signal period and the end of the historical time window.
In some embodiments of the present disclosure, a time stamp at the end of each traffic signal period may be included in the traffic state data of each traffic signal period, so a time interval corresponding to each traffic signal period may be determined according to the time stamp at the end of each traffic signal period and the historical time window end time.
Step 202, determining a corresponding time code according to each time interval.
The time code corresponding to each time interval is equivalent to mapping the absolute time of the time interval to a vector in the high-dimensional space, and the time code corresponding to each time can be determined through a preset time code function.
In some embodiments of the present disclosure, determining a corresponding time-coded implementation from each time interval may include: determining a time coding function corresponding to the road junction to be detected; wherein the time encoding function is a periodic function; based on the time coding function, a time code corresponding to each time interval is determined. The time encoding function may be a pre-established function.
As an example, a personalized time coding function of each intersection may be pre-constructed, where the personalized time coding function is shown in formula (1):
wherein,,a personalized time coding function for the intersection i; and->The dimension of (2) is d; Δt is the time interval;Refers to the s-th element in the time code of the time interval deltat, and s is an integer from 0 to d;Is the kth period parameter in intersection i, and +.>And is obtained by learning.
That is, by the formula (1)The time code can represent not only the perceived time interval, but also the periodic mode of traffic states of different intersections on time. Bringing each time interval into equation (1) can determine the time code corresponding to each time interval.
As another example, in an actual application scenario, there may be a situation that traffic state data is missing, and because the data is sparse, a satisfactory time coding function cannot be learned. A pass time encoding function phi can be preset g (Δt), which is a code function shared by all intersections, the time code function of each intersection being determined by a personalized time code function and a universal time code function. The expression of the time-coded function for each intersection can be shown as the following formula (2):
wherein phi is i (Δt) is a time-coded function of intersection i; lambda (lambda) i Time coding weight for intersection i; phi (phi) g (Δt) is a generic time coding function;the personalized time coding function for the intersection i. Phi (phi) g (Δt) functional expressionThe following formula (3) shows:
wherein phi is g (Δt) is a generic time coding function; and phi is g The dimension of (Δt) is d; Δt is the time interval; phi (phi) g (Δt)[g]Refers to the g element in the time code of the time interval deltat, and g is an integer from 0 to d; omega n Is the nth cycle parameter, and omega n And is obtained by learning.
Step 203, splice the traffic state data with the time code to obtain a traffic state sequence.
According to the traffic state prediction method of the embodiment of the disclosure, the time interval corresponding to each traffic signal period is determined, the time code corresponding to each time interval is determined through a time code function, and the traffic state data and the time code are spliced to obtain a traffic state sequence. The time code can not only represent absolute time intervals, but also represent periodic modes of traffic states of intersections, so that the obtained traffic state sequence not only introduces the characteristics of the time intervals, but also introduces the periodic characteristics, and information carried by the traffic state sequence can be more comprehensive, so that the accuracy of traffic state information prediction is improved.
Yet another embodiment is presented by the present disclosure for obtaining traffic state expressions within a historical time window.
Fig. 3 is a flowchart of another traffic state prediction method according to an embodiment of the present disclosure. As shown in fig. 3, the traffic state prediction method may include the steps of:
step 301, obtaining traffic state data of each traffic signal period of the road intersection to be tested in a historical time window.
Step 302, determining a traffic state sequence introducing time intervals according to the traffic state data.
Step 303, sequentially performing data conversion on each element in the traffic state sequence to obtain a time perception parameter sequence.
In some embodiments of the present disclosure, a data transfer function may be pre-established, the data transfer function being used to represent a mapping of each element in the traffic sequence to the time-aware parameter, and the parameters in the data transfer function may be derived from a large number of data statistics.
And 304, carrying out normalization processing on each element in the time perception parameter sequence to obtain the time perception convolution parameter sequence.
Step 305, based on the time-aware convolution parameter sequence, performing a convolution operation on the traffic state sequence to obtain a traffic state expression.
That is, the data conversion process is to obtain the parameters of the convolution operation, and since the length of the time-aware convolution parameter sequence is consistent with the length of the traffic state sequence, the data conversion process can be applied to the convolution operation of the traffic state sequence of any length. In addition, the time-aware convolution parameters are obtained by converting elements in the traffic state sequence, and because time intervals are introduced into the traffic state sequence, the time-aware convolution parameters are parameters for introducing time interval characteristics, and the traffic state sequence is subjected to convolution operation based on the time-aware convolution parameter sequence, so that the obtained traffic state expression is more in accordance with the characteristics of real data, and the predicted traffic state data of a future time window can be more accurate.
As an example, steps 303-305 may be implemented based on a pre-set time-aware convolutional network, which may include a meta-filter and a time-aware convolutional filter. Inputting the traffic state sequence into a meta filter, sequentially carrying out data conversion on each element in the traffic state sequence by the meta filter, and outputting a time perception parameter sequence; normalizing each parameter in the time perception parameter sequence to obtain a time perception convolution parameter sequence; and taking the time-aware convolution parameter sequence as a parameter of the time-aware convolution filter, inputting the traffic state sequence into the time-aware convolution filter for convolution operation, and obtaining the traffic state expression in the historical time window.
Step 306, predicting traffic state prediction data of each traffic signal period in a future time window according to the traffic state expression; wherein the historical time window is continuous in time with the future time window.
According to the traffic state prediction method of the embodiment of the disclosure, each element in the traffic state sequence is subjected to data conversion in sequence to obtain a time-aware parameter sequence, normalization processing is performed on the time-aware parameter sequence to obtain a time-aware convolution parameter sequence, convolution operation is performed on the traffic state sequence based on the time-aware convolution parameter sequence to obtain traffic state expression in a historical time window, and traffic state prediction data of each traffic signal period in a future time window is predicted based on the traffic state expression. The convolution operation is carried out on the traffic state sequence through the acquired time-aware convolution parameter sequence, so that the dependence of traffic state characteristics and time can be reflected, the acquired traffic state expression information is more real and comprehensive, and the accuracy and efficiency of prediction are improved. Furthermore, since time intervals are introduced, the method can be applied to traffic status data of irregular time intervals.
Next, the prediction of traffic state for the future time window will be described in detail.
FIG. 4 is a flow chart of traffic state prediction data for predicting each traffic signal cycle within a future time window in an embodiment of the present disclosure. In the disclosed embodiments, the traffic state data includes a traffic flow and a duration of each traffic signal cycle. As shown in fig. 4, based on the above embodiment, the implementation procedure of step 105 in fig. 1 may include the following steps:
step 401, acquiring an evolved i+1th traffic hidden state according to the i th traffic hidden state and the i th elapsed time; wherein i is an integer of 0 or more, and when i=0, the i-th traffic hidden state is a traffic state expression.
When i is greater than or equal to 1, the ith traffic hidden state is obtained based on the ith-1 traffic hidden state and the corresponding elapsed time evolution. When i=0, the i-th traffic hidden state is a traffic state expression in the history time window, that is, the traffic state expression in the history time window is an initial traffic hidden state. That is, based on the traffic state expressions within the historical time window, the traffic state expressions within a wider time range are evolved in conjunction with the elapsed time.
In some embodiments of the present disclosure, i represents the number of prediction steps, i.e., the i-th prediction. The prediction method of the embodiment of the disclosure predicts traffic state data in a future time window in a plurality of times, and only predicts traffic state data of a certain number of traffic signal periods in each prediction step. Because the potential traffic state is dynamically evolved over time in practice, the evolution prediction can be performed according to the traffic hidden state and the elapsed time obtained by the previous prediction, the traffic hidden state corresponding to the next prediction can be predicted, and the traffic flow and the duration of each traffic signal period in the corresponding step length in the future time window can be predicted based on the traffic hidden state, the traffic state expression in the history time and the elapsed time.
As an example, a state evolution function may be constructed based on a large amount of historical traffic state data, the state evolution function being used to represent a change in the traffic hidden state over time, so that the i+1 th traffic hidden state may be calculated based on the i th traffic hidden state and the i th elapsed time.
The above embodiment describes a time coding function, where the time code corresponding to the i-th elapsed time may be determined according to a pre-constructed time coding function, and then the i+1-th traffic hidden state after evolution may be obtained according to the i-th traffic hidden state and the time code of the i-th elapsed time.
Step 402, obtaining a predicted value of the traffic flow and a predicted value of the duration of each traffic signal period in an ith predicted step length in a future time window according to the (i+1) th traffic hidden state, the (i) th elapsed time and the traffic state expression.
The prediction step length refers to the number of traffic signal periods in a future time window predicted each time. Such as the prediction step size xi, refers to the traffic flow and duration of each predicted xi traffic signal period. If the historical time window comprises T traffic signal periods, the ith traffic hidden state is obtained through evolution, and the traffic state expression is carried out by taking the T traffic signal periods in the historical time window and the previous i xi traffic signal periods in the future time window as a whole. The i-th elapsed time refers to the total duration of the traffic signal period in i predicted steps that have been predicted.
As an embodiment, a semi-autoregressive predictor may be pre-constructed, which has learned the initial traffic hidden state, the elapsed time code, and the traffic hidden state of the previous prediction step, as a mapping relationship with the traffic flow and the duration of each traffic signal period in the current prediction step. The step can determine a time code corresponding to the ith lapse time according to the ith lapse time, and input the i+1 traffic hidden state, the time code of the ith lapse time and the traffic state expression in a historical time window into a semi-autoregressive predictor to obtain a predicted value of the traffic flow and a predicted value of the duration of each traffic signal period in the i+1 prediction step length.
Step 403, determining the i+1th elapsed time according to the duration of each traffic signal period and the i+1th elapsed time in the i+1th predicted step.
As an example, if each prediction step is 5 traffic signal periods, the duration of the 5 traffic signal periods in the i-th prediction step is respectively:the ith elapsed time t i I+1 th elapsed time
If the i+1th elapsed time is less than the duration of the future time window, setting i to i+1, and returning to the step of continuously executing the i+1th traffic hidden state according to the i-th traffic hidden state and the i-th elapsed time to obtain the evolved i+1th traffic hidden state.
If the i+1th elapsed time is equal to or greater than the duration of the future time window, determining traffic state prediction data according to the predicted traffic flow and duration values of the traffic signal period in all the prediction steps 405.
That is, the present scheme predicts the traffic state of the traffic state cycle in each prediction step in the future time window in an iterative manner until the prediction of the traffic state in the future time window has been completed. Because the traffic signal period of the road intersection to be measured changes with time, the number of traffic signal periods in different future time windows is also different, i.e. the sequence length corresponding to the predicted traffic state prediction data is different. The scheme can be suitable for predicting the lengths of different traffic state sequences by means of a step-by-step prediction mode and by comparing the elapsed time with the duration of a future time window.
According to the traffic state prediction method of the embodiment of the disclosure, the i+1th traffic hidden state of evolution is obtained through the i-th traffic hidden state and the i-th elapsed time, and the traffic flow predicted value and the duration predicted value of each traffic signal period in the i-th predicted step length in a future time window are obtained according to the i+1th traffic hidden state, the i-th elapsed time and the traffic state expression until the obtained i+1th elapsed time is greater than or equal to the duration of the future time window, so that traffic state predicted data of each traffic signal period in the future time window are obtained. According to the scheme, the prediction mode of gradual iteration can be used for efficiently predicting the variable-length sequence, and the problem of error accumulation in the prediction process can be solved.
Steps 103 to 105 in fig. 1 may be implemented by a preset traffic state prediction model, and a process of predicting by the traffic state prediction model will be described next.
Fig. 5 is a flowchart of another traffic state prediction method according to an embodiment of the present disclosure. As shown in fig. 5, the method comprises the steps of:
step 501, obtaining traffic state data of each traffic signal period of the road intersection to be tested in a historical time window.
Step 502, determining a traffic state sequence introducing time intervals according to the traffic state data.
In the disclosed embodiments, the traffic state data includes a traffic flow and a duration of each traffic signal cycle. The implementation manner of the steps 501-502 is identical to that of the corresponding steps in the above embodiments, and will not be described herein.
Step 503, inputting the traffic state sequence into a preset traffic state prediction model, and obtaining traffic state prediction data of each traffic signal period in a future time window; wherein the historical time window is continuous in time with the future time window.
In some embodiments of the present disclosure, the traffic state prediction model may include a time-aware convolutional network and a semi-autoregressive prediction network. The traffic state sequence is input to a time-aware convolution network, the traffic state expression in a historical time window is acquired, the traffic state expression is input to a semi-autoregressive prediction network, and the traffic state prediction data in a future time window is acquired.
As shown in fig. 6, the time-aware convolutional network 610 may include a meta filter 611 and a time-aware convolutional filter 612, where the number of meta filters 611 and time-aware convolutional filters 612 is D, which is the output dimension of the time-aware convolutional network. As shown in fig. 7, the implementation process of inputting a traffic state sequence into a time-aware convolutional network to obtain a traffic state representation within a historical time window may include:
Step 701, inputting a traffic state sequence to D meta-filters, and sequentially performing data conversion on each element in the traffic state sequence by each meta-filter to obtain a time perception parameter sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence.
Step 702, performing normalization processing on each element in the time-aware parameter sequence to obtain a time-aware convolution parameter sequence.
Step 703, inputting the traffic state sequence to D time-aware convolution filters to obtain a traffic state expression; the model parameters of the D time-aware convolution filters are parameters in a time-aware convolution parameter sequence.
For example, with one of the meta-filters F d For illustration, if T traffic signal periods are included in the historical time window, the time is introducedThe perceived traffic state sequence is z= { Z 1 ,Z 2 ,…,Z T }, Wherein n is the nth traffic state period, X in the historical time window n For traffic state data of the nth traffic state period, phi (Δt) is a time encoding function of Δt time interval, t T For the end time of the historical time window, t n Is the end time of the nth traffic state period in the historical time window. If F d Representing a meta-filter that can be instantiated via a learnable neural network, then after Z is input to the meta-filter, the resulting output is { F d (Z 1 ),F d (Z 2 ),…,F d (Z T ) And takes it as a sequence of time-aware parameters. The normalization processing of the time perception parameter sequence is as shown in a formula (4):
wherein Z is n Is the nth element in the traffic state sequence, F d Representing a meta-filter that can be instantiated by a learnable neural network, norm (F d (Z n ) Is the result after normalization of the nth element in the sequence of time-aware parameters.
By normalizing the sequence of time-aware parameters in the time dimension, it is avoided that results with different proportions are produced after performing a convolution operation on the variable length sequence. The result output by the meta-filter is time-aware due to the time interval introduced by the traffic state sequence, so the time-aware convolution filter can be derived based on its output result. And (3) forming a time-aware convolution parameter sequence from the normalized result, wherein the time-aware convolution parameter sequence comprises the following formula (5):
f d =[Norm(F d (z 1 )),…,Norm(F d (z T ))] (5)
wherein f d Is F d The time-aware convolution filter derived by the meta-filter, that is, the parameters in the time-aware convolution parameter sequence are taken as the model parameters of the time-aware convolution filter. And inputting the traffic state sequence into the D time-aware convolution filters to carry out convolution operation on the traffic state sequence, so as to obtain the traffic state expression in the historical time window. Wherein the traffic state expression in the history period is as shown in formula (6) and formula (7):
Wherein,,for the traffic state expression in the historical time period, T is the number of traffic signal periods contained in the historical time period; z is a traffic state sequence introducing time perception; f (f) 1 For element filter F 1 A derived time-aware convolution filter; f (f) 2 For element filter F 2 A derived time-aware convolution filter; f (f) 3 For element filter F 3 A derived time-aware convolution filter; ∈ represents a convolution operation;Is f d N element, Z n Is the nth element in the traffic state sequence Z.
It can be found that, since the length of the time-aware parameter sequence is consistent with the length of the traffic state sequence, the traffic state prediction model constructed by the embodiments of the present disclosure can transform the size of the filter according to the length of the traffic state sequence, so that it can adaptively process the variable length sequence. Furthermore, the meta-filters in the time-aware convolutional network may derive custom parametric filters for sequences with different time intervals or other features. Since the learnable parameters of the meta-filter are independent of the sequence length, the time-aware convolutional network can be modeled directly by a convolutional filter of arbitrary size without adding any filter parameters.
In some embodiments of the present disclosure, the number of traffic signal periods in the future time window may be multiple, and in order to predict the traffic state of each traffic signal period, a semi-autoregressive prediction network may be constructed to implement, by setting a prediction step length, the traffic state data of a certain number of traffic signal periods is predicted each time, so that not only accumulation of errors may be avoided, but also prediction efficiency may be improved.
As shown in fig. 6, the semi-autoregressive prediction network 620 may include a state evolution unit 621, a semi-autoregressive predictor 622, and an elapsed time module 623. Wherein the state evolution unit 621 is configured to evolve a traffic hidden state including a traffic signal period in each future time window based on the lapse of time, and the semi-autoregressive predictor 622 is configured to predict a series of continuous traffic states in each prediction step, and implement the output of the complete sequence through iterative prediction.
As shown in fig. 7, inputting a traffic state expression to a semi-autoregressive prediction network to obtain traffic state prediction data for each traffic signal cycle within a future time window, comprising the steps of:
step 704, inputting the ith traffic hidden state and the ith elapsed time to a state evolution unit to acquire an evolved (i+1) th traffic hidden state; wherein i is an integer of 0 or more, and when i=0, the i-th traffic hidden state is a traffic state expression.
In some embodiments of the present disclosure, the elapsed time input to the state evolution unit may be a time code of the elapsed time, the duration of each traffic signal period within each prediction step predicted by the semi-autoregressive predictor 622 is input to the elapsed time module 623, the elapsed time is calculated by the elapsed time module 623, and the calculated elapsed time is converted into a corresponding time code. The time encoding implementation may be an implementation of the time encoding process in the above embodiment.
The state evolution unit can be shown in the following formula (7):
wherein,,is the i+1th traffic hidden state;An i-th traffic hidden state;Is the i-th elapsed time; SEU is a state evolution unit. When i is 0, the formula ++> The method comprises the steps of obtaining the expression of traffic states in a period of time, which comprises T traffic signal periods in a historical time window and i xi future time windows, through evolution; where ζ is the prediction step size, i.e. the number of traffic signal cycles included in each step of prediction. When i is 0, the i-th elapsed time is the time interval between the start time of the future time window and the end time of the history time window.
Step 705, inputting the i+1th traffic hidden state, the i elapsed time and the traffic state expression to the semi-autoregressive predictor, and obtaining the predicted value of the traffic flow and the predicted value of the duration of each traffic signal period in the i+1th prediction step in the future time window.
In some embodiments of the present disclosure, the elapsed time input to the semi-autoregressive predictor 622 may be a time encoding of the elapsed time. The prediction process of the semi-autoregressive predictor 622 may be as shown in equation (8) and equation (9):
wherein,,the traffic state prediction data for each traffic signal period in the (i+1) th prediction step length comprises traffic state prediction data from the (i+1) th traffic signal period to the (i+1) th traffic signal period in a future time window;A duration predicted value of each traffic signal period in the (i+1) th predicted step length;The predicted value of the traffic flow for each traffic signal cycle in the i+1th predicted step.
Step 706, inputting the duration of each traffic signal period in the i+1th prediction step to the elapsed time module to obtain the i+1th elapsed time.
Where the elapsed time refers to the duration between the future time and the start time of the future time window when the traffic state at the future time has been predicted, it can be calculated from the predicted duration of each traffic signal period. The i+1th elapsed time can be calculated by the following equation (10):
Wherein,,is the i-th elapsed time;An i+1th elapsed time;Refers to the duration of the ith ζ+k traffic signal period in the future time window obtained in the ith+1 step prediction.
Step 707, based on the elapsed time module, if the i+1th elapsed time is less than the duration of the future time window, setting i to i+1, and returning to continue to perform the step of inputting the i-th traffic hidden state and the i-th elapsed time to the state evolution unit to obtain the evolving i+1th traffic hidden state.
Step 708, based on the elapsed time module, stopping loop prediction if the i+1th elapsed time is greater than or equal to the duration of the future time window.
It should be noted that, the traffic state prediction model in the embodiment of the present disclosure may be obtained through training historical traffic state data of each road junction. The loss function during model training can be calculated by the following equations (11), (12), (13) and (14):
wherein,,loss of value for the duration of the traffic signal period;A traffic flow loss value for a traffic signal period;A loss of elapsed time value; n is the number of road intersections corresponding to the training samples, i is the ith road intersection, L i Representing the length of the complete real sequence of road junction i, < > >Is the length of the non-missing sequence value of the road intersection i, < >>Based on history T for road junction i i The duration of the first traffic signal period predicted by the training data of the individual traffic signal periods, +.>History T i A duration truth value of a first traffic signal period after the first traffic signal period;Based on history T for road junction i i Traffic flow of the first traffic signal cycle predicted by the training data of the individual traffic signal cycle, +.>History T i Traffic flow truth for the first traffic signal cycle after the individual traffic signal cycle;Based on history T for road junction i i First cancellation predicted by the periodic training data of the traffic signalElapsed time(s) (I.S.)>History T i A first elapsed time truth value after the traffic signal period;To mask items, if true value->Or->Exist at->Otherwise->
According to the traffic state prediction method disclosed by the embodiment of the disclosure, the traffic state of each traffic signal period in a future time window is predicted through the traffic state prediction model, wherein the time-aware convolution network can be suitable for irregular time intervals and traffic state sequences with variable lengths, the semi-autoregressive prediction network introduces prediction step sizes, and the variable length sequences are predicted through fewer prediction steps, so that the prediction efficiency can be improved, the accumulation of prediction errors can be reduced, and the prediction accuracy is improved.
In order to implement the above-described embodiments, the present disclosure provides a traffic state prediction apparatus.
Fig. 8 is a block diagram of a traffic state predicting device according to an embodiment of the present disclosure. As shown in fig. 8, the apparatus includes:
the first obtaining module 810 is configured to obtain traffic state data of each traffic signal period of the road junction to be tested in the historical time window;
a first determining module 820, configured to determine a traffic state sequence introducing a time interval according to traffic state data;
a second obtaining module 830, configured to obtain a time-aware parameter sequence according to the traffic state sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence;
a third obtaining module 840, configured to obtain a traffic state expression in a historical time window according to the time-aware parameter sequence and the traffic state sequence;
a prediction module 850 for predicting traffic state prediction data for each traffic signal cycle within a future time window based on the traffic state expression; wherein the historical time window is continuous in time with the future time window.
Wherein the traffic state data includes a traffic flow and a duration of each traffic signal cycle.
In some embodiments of the present disclosure, the first determining module 820 includes:
a first determining unit 821 for determining a time interval between when each traffic signal period ends and when the history time window ends:
a second determining unit 822, configured to determine a corresponding time code according to each time interval;
an obtaining unit 823, configured to splice the traffic state data with the time code, so as to obtain a traffic state sequence.
As a possible implementation manner, the second determining unit 822 is specifically configured to:
determining a time coding function corresponding to the road junction to be detected; wherein the time encoding function is a periodic function;
based on the time coding function, a time code corresponding to each time interval is determined.
In some embodiments of the present disclosure, the second obtaining module 830 is specifically configured to:
and sequentially carrying out data conversion on each element in the traffic state sequence to obtain a time perception parameter sequence.
As a possible implementation manner, the third obtaining module 840 is specifically configured to:
carrying out normalization processing on each element in the time perception parameter sequence to obtain a time perception convolution parameter sequence;
and carrying out convolution operation on the traffic state sequence introducing the time interval based on the time perception convolution parameter sequence so as to acquire traffic state expression.
In some embodiments of the present disclosure, the prediction module 850 is specifically configured to:
acquiring an evolved i+1th traffic hidden state according to the i traffic hidden state and the i elapsed time; wherein i is an integer greater than or equal to 0, and when i=0, the i-th traffic hidden state is a traffic state expression;
according to the (i+1) th traffic hidden state and the (i) th elapsed time, acquiring a predicted value and a predicted value of duration of each traffic signal period in the (i+1) th predicted step length in a future time window;
determining the (i+1) th elapsed time according to the duration of each traffic signal period in the (i+1) th predicted step length and the coding of the (i) th elapsed time;
if the i+1-th elapsed time is less than the duration of the future time window, determining i as i+1, and returning to the step of continuing to acquire the evolving i+1-th traffic hidden state according to the i-th traffic hidden state and the i-th elapsed time.
In addition, the prediction module 850 is further configured to:
if the i+1th elapsed time is equal to or greater than the duration of the future time window, determining traffic state prediction data according to the predicted traffic flow value and the predicted duration value of the traffic signal period in all the prediction steps.
According to the traffic state prediction device of the embodiment of the disclosure, traffic state data of each traffic signal period of a road intersection to be detected in a historical time window are obtained, a traffic state sequence introducing a time interval is determined according to the traffic state data, a time perception parameter sequence is obtained according to the traffic state sequence, the length of the time perception parameter sequence is consistent with that of the traffic state sequence, traffic state expression in the historical time window is obtained according to the time perception parameter sequence and the traffic state sequence, and finally traffic state prediction data of each traffic signal period in a future time window is predicted according to the traffic state expression. The scheme is suitable for the prediction of traffic state data with irregular time intervals and different sequence lengths due to the introduction of the time intervals and the time perception parameter sequences, so that the accuracy of road intersection traffic state prediction can be improved.
In order to implement the above-described embodiments, the present disclosure proposes another traffic state prediction device.
Fig. 9 is a block diagram of another traffic state prediction device according to an embodiment of the present disclosure. As shown in fig. 9, the apparatus includes:
an obtaining module 910, configured to obtain traffic state data of each traffic signal period of the road junction to be tested in the historical time window;
a determining module 920, configured to determine a traffic state sequence introducing a time interval according to the traffic state data;
the prediction module 930 is configured to input the traffic state sequence into a preset traffic state prediction model, and obtain traffic state prediction data of each traffic signal period in a future time window. Wherein the historical time window is continuous in time with the future time window.
Wherein the traffic state data includes a traffic flow and a duration of each traffic signal cycle.
In some embodiments of the present disclosure, the traffic state prediction model includes a time-aware convolutional network and a semi-autoregressive prediction network; the prediction module 930 includes:
an expression unit 931 for inputting the traffic state sequence into a time-aware convolutional network to obtain traffic state expression within a historical time window;
A prediction unit 932 for inputting the traffic state expression to the semi-autoregressive prediction network and obtaining traffic state prediction data within a future time window.
As one possible implementation, the time-aware convolutional network includes D meta-filters and D time-aware convolutional filters, D being the output dimension of the time-aware convolutional network; the expression unit 931 is specifically for:
inputting the traffic state sequence into D meta-filters, and sequentially carrying out data conversion on each element in the traffic state sequence by each meta-filter to obtain a time perception parameter sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence;
carrying out normalization processing on each element in the time perception parameter sequence to obtain a time perception convolution parameter sequence;
inputting the traffic state sequence into D time-aware convolution filters to obtain traffic state expression; the model parameters of the D time-aware convolution filters are parameters in a time-aware convolution parameter sequence.
As one possible implementation, the semi-autoregressive prediction network includes a state evolution unit, a semi-autoregressive predictor, and an elapsed time module; the prediction module 932 is specifically configured to:
Inputting the ith traffic hidden state and the ith elapsed time to a state evolution unit to acquire an evolved (i+1) th traffic hidden state; wherein i is an integer greater than or equal to 0, and when i=0, the i-th traffic hidden state is a traffic state expression;
inputting the i+1th traffic hidden state, the i elapsed time and the traffic state expression into a semi-autoregressive predictor, and obtaining a predicted value of the traffic flow and a predicted value of the duration of each traffic signal period in the i+1th predicted step length in a future time window;
inputting the duration of each traffic signal period in the (i+1) th prediction step length to an elapsed time module to acquire the (i+1) th elapsed time;
based on the elapsed time module, if the i+1th elapsed time is less than the duration of the future time window, setting i as i+1, and returning to continue to perform the step of inputting the i-th traffic hidden state and the i-th elapsed time to the state evolution unit to acquire the evolving i+1th traffic hidden state.
In addition, the prediction unit 932 is further configured to:
based on the elapsed time module, if the i+1th elapsed time is greater than or equal to the duration of the future time window, stopping loop prediction.
According to the traffic state prediction device disclosed by the embodiment of the disclosure, the traffic state of each traffic signal period in a future time window is predicted by the traffic state prediction model, wherein the time-aware convolution network can be suitable for irregular time intervals and traffic state sequences with variable lengths, the semi-autoregressive prediction network introduces prediction step sizes, and the variable length sequences are predicted by fewer prediction steps, so that the prediction efficiency can be improved, the accumulation of prediction errors can be reduced, and the prediction accuracy is improved.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
As shown in fig. 10, is a block diagram of an electronic device of a traffic state prediction method according to an embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
Fig. 10 shows a schematic block diagram of an example electronic device 1000 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Various components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and communication unit 1009 such as a network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, such as a traffic state prediction method. For example, in some embodiments, the traffic state prediction method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of the traffic state prediction method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the traffic state prediction method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (26)
1. A traffic state prediction method, comprising:
acquiring traffic state data of each traffic signal period of a road intersection to be tested in a historical time window;
determining a traffic state sequence introducing time intervals according to the traffic state data;
acquiring a time perception parameter sequence according to the traffic state sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence;
Acquiring traffic state expression in the historical time window according to the time perception parameter sequence and the traffic state sequence;
predicting traffic state prediction data of each traffic signal period in a future time window according to the traffic state expression; wherein the historical time window is consecutive in time with the future time window.
2. The method of claim 1, wherein the traffic state data includes a traffic flow and a duration of each of the traffic signal periods.
3. The method of claim 1, wherein the determining a traffic state sequence for introducing a time interval from the traffic state data comprises:
determining a time interval between the end of each of the traffic signal periods and the end of the historical time window;
determining a corresponding time code according to each time interval;
and splicing the traffic state data with the time code to obtain the traffic state sequence.
4. A method according to claim 3, wherein said determining a corresponding time code from each of said time intervals comprises:
determining a time coding function corresponding to the road junction to be detected; wherein the time encoding function is a periodic function;
And determining a time code corresponding to each time interval based on the time code function.
5. The method of claim 1, wherein the obtaining a sequence of time-aware parameters from the sequence of traffic conditions comprises:
and sequentially carrying out data conversion on each element in the traffic state sequence to obtain the time perception parameter sequence.
6. The method of claim 1, wherein the obtaining traffic state expressions within the historical time window from the time-aware parameter sequence and the traffic state sequence comprises:
carrying out normalization processing on each element in the time perception parameter sequence to obtain a time perception convolution parameter sequence;
and carrying out convolution operation on the traffic state sequence based on the time-aware convolution parameter sequence so as to acquire the traffic state expression.
7. The method of claim 2, wherein said predicting traffic state prediction data for each traffic signal cycle within a future time window based on said traffic state expression comprises:
acquiring an evolved i+1th traffic hidden state according to the i traffic hidden state and the i elapsed time; wherein i is an integer greater than or equal to 0, and when i=0, the i-th traffic hidden state is the traffic state expression;
Acquiring a predicted value and a predicted value of duration of each traffic signal period in an (i+1) th predicted step length in the future time window according to the (i+1) th traffic hidden state, the (i) th elapsed time and the traffic state expression;
determining an i+1th elapsed time according to the duration of each traffic signal period in the i+1th predicted step length and the i-th elapsed time;
and if the i+1th elapsed time is smaller than the duration of the future time window, setting i as i+1, and returning to the step of continuously executing the time coding according to the i-th traffic hidden state and the i-th elapsed time to acquire the i+1th traffic hidden state which evolves.
8. The method of claim 7, further comprising:
and if the i+1th elapsed time is equal to or greater than the duration of the future time window, determining the traffic state prediction data according to the traffic flow predicted value and the duration predicted value of the traffic signal period in all the prediction step lengths.
9. A traffic state prediction method, comprising:
acquiring traffic state data of each traffic signal period of a road intersection to be tested in a historical time window;
determining a traffic state sequence introducing time intervals according to the traffic state data;
And inputting the traffic state sequence into a preset traffic state prediction model, and acquiring traffic state prediction data of each traffic signal period in a future time window. Wherein the historical time window is consecutive in time with the future time window.
10. The method of claim 9, wherein the traffic state data includes a traffic flow and a duration of each of the traffic signal periods.
11. The method of claim 10, wherein the traffic state prediction model comprises a time-aware convolutional network and a semi-autoregressive prediction network; the step of inputting the traffic state sequence into a preset traffic state prediction model to obtain traffic state prediction data of each traffic signal period in a future time window, comprising the following steps:
inputting the traffic state sequence into the time-aware convolutional network to acquire traffic state expression in the historical time window;
and inputting the traffic state expression into the semi-autoregressive prediction network to acquire traffic state prediction data in the future time window.
12. The method of claim 11, wherein the time-aware convolutional network comprises D meta-filters and D time-aware convolutional filters, D being an output dimension of the time-aware convolutional network; the step of inputting the traffic state sequence to the time-aware convolution network to obtain the traffic state expression in the history time window comprises the following steps:
Inputting the traffic state sequence to the D meta-filters, and sequentially carrying out data conversion on each element in the traffic state sequence by each meta-filter to obtain a time perception parameter sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence;
carrying out normalization processing on each element in the time perception parameter sequence to obtain a time perception convolution parameter sequence;
inputting the traffic state sequence to the D time-aware convolution filters to obtain the traffic state expression; the model parameters of the D time-aware convolution filters are parameters in the time-aware convolution parameter sequence.
13. The method of claim 11, wherein the semi-autoregressive prediction network comprises a state evolution unit, a semi-autoregressive predictor, and an elapsed time module; the inputting the traffic state expression into the semi-autoregressive prediction network, obtaining traffic state prediction data of each traffic signal period in the future time window, including:
inputting the ith traffic hidden state and the ith elapsed time to the state evolution unit to obtain an evolved (i+1) th traffic hidden state; wherein i is an integer greater than or equal to 0, and when i=0, the i-th traffic hidden state is the traffic state expression;
Inputting the i+1th traffic hidden state, the i elapsed time and the traffic state expression into the semi-autoregressive predictor to obtain a predicted value of the traffic flow and a predicted value of the duration of each traffic signal period in the i+1th predicted step length in the future time window;
inputting the duration of each traffic signal period in the i+1th prediction step length to the elapsed time module to obtain the i+1th elapsed time;
and based on the lapse time module, if the i+1th lapse time is smaller than the duration of the future time window, setting i as i+1, and returning to continuously execute the step of inputting the i-th traffic hidden state and the i-th lapse time into the state evolution unit to acquire the evolved i+1th traffic hidden state.
14. The method of claim 13, further comprising:
based on the elapsed time module, if the i+1th elapsed time is greater than or equal to the duration of the future time window, stopping loop prediction.
15. A traffic state prediction apparatus comprising:
the first acquisition module is used for acquiring traffic state data of each traffic signal period of the road intersection to be detected in the historical time window;
the first determining module is used for determining a traffic state sequence of introducing a time interval according to the traffic state data;
The second acquisition module is used for acquiring a time perception parameter sequence according to the traffic state sequence; the length of the time perception parameter sequence is consistent with the length of the traffic state sequence;
the third acquisition module is used for acquiring the traffic state expression in the historical time window according to the time perception parameter sequence and the traffic state sequence;
the prediction module is used for predicting traffic state prediction data of each traffic signal period in a future time window according to the traffic state expression; wherein the historical time window is consecutive in time with the future time window.
16. The apparatus of claim 15, wherein the traffic state data comprises a traffic flow and a duration of each of the traffic signal periods.
17. The apparatus of claim 15, wherein the first determination module comprises:
a first determining unit configured to determine a time interval between when each of the traffic signal periods ends and when the history time window ends;
a second determining unit, configured to determine a corresponding time code according to each of the time intervals;
and the acquisition unit is used for splicing the traffic state data with the time code to acquire the traffic state sequence.
18. The apparatus of claim 17, wherein the second determining unit is specifically configured to:
determining a time coding function corresponding to the road junction to be detected; wherein the time encoding function is a periodic function;
and determining a time code corresponding to each time interval based on the time code function.
19. The apparatus of claim 15, wherein the second acquisition module is specifically configured to:
and sequentially carrying out data conversion on each element in the traffic state sequence to obtain the time perception parameter sequence.
20. The apparatus of claim 15, wherein the third acquisition module is specifically configured to:
carrying out normalization processing on each element in the time perception parameter sequence to obtain a time perception convolution parameter sequence;
and carrying out convolution operation on the traffic state sequence introducing the time interval based on the time perception convolution parameter sequence so as to acquire the traffic state expression.
21. The apparatus of claim 16, wherein the prediction module is specifically configured to:
acquiring an evolved i+1th traffic hidden state according to the i traffic hidden state and the i elapsed time; wherein i is an integer greater than or equal to 0, and when i=0, the i-th traffic hidden state is the traffic state expression;
Acquiring a predicted value of the traffic flow and a predicted value of the duration of each traffic signal period in the (i+1) th predicted step length in the future time window according to the (i+1) th traffic hidden state and the (i) th elapsed time;
determining an i+1th elapsed time according to the duration of each traffic signal period in the i+1th predicted step length and the coding of the i-th elapsed time;
and if the i+1th elapsed time is smaller than the duration of the future time window, determining i as i+1, and returning to the step of continuously executing the i+1th traffic hidden state according to the i traffic hidden state and the i elapsed time to acquire the evolution i+1th traffic hidden state.
22. The apparatus of claim 21, the prediction module further to:
and if the i+1th elapsed time is equal to or greater than the duration of the future time window, determining the traffic state prediction data according to the traffic flow predicted value and the duration predicted value of the traffic signal period in all the prediction step lengths.
23. A traffic state prediction apparatus comprising:
the acquisition module is used for acquiring traffic state data of each traffic signal period of the road intersection to be detected in the historical time window;
the determining module is used for determining a traffic state sequence of introducing a time interval according to the traffic state data;
The prediction module is used for inputting the traffic state sequence into a preset traffic state prediction model and acquiring traffic state prediction data of each traffic signal period in a future time window; wherein the historical time window is consecutive in time with the future time window.
24. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8 and/or to perform the method of any one of claims 9-14.
25. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-8 and/or to perform the method of any one of claims 9-14.
26. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8 and/or performs the method according to any one of claims 9-14.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310871439.0A CN116913092A (en) | 2023-07-14 | 2023-07-14 | Traffic state prediction method, traffic state prediction device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310871439.0A CN116913092A (en) | 2023-07-14 | 2023-07-14 | Traffic state prediction method, traffic state prediction device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116913092A true CN116913092A (en) | 2023-10-20 |
Family
ID=88362359
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310871439.0A Pending CN116913092A (en) | 2023-07-14 | 2023-07-14 | Traffic state prediction method, traffic state prediction device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116913092A (en) |
-
2023
- 2023-07-14 CN CN202310871439.0A patent/CN116913092A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112579758A (en) | Model training method, device, equipment, storage medium and program product | |
EP3879754A1 (en) | Network traffic prediction method, device, and electronic device | |
CN113705628B (en) | Determination method and device of pre-training model, electronic equipment and storage medium | |
EP4040421B1 (en) | Method and apparatus for predicting traffic data and electronic device | |
CN112652165B (en) | Model training and road condition prediction method, device, equipment, medium and program product | |
CN115082920A (en) | Deep learning model training method, image processing method and device | |
CN112580733A (en) | Method, device and equipment for training classification model and storage medium | |
CN114715145B (en) | Trajectory prediction method, device and equipment and automatic driving vehicle | |
CN114444718B (en) | Training method of machine learning model, signal control method and device | |
CN113851226A (en) | Infectious disease epidemic situation prediction method and device and electronic equipment | |
CN116186534B (en) | Pre-training model updating method and device and electronic equipment | |
CN114897183B (en) | Question data processing method, training method and device of deep learning model | |
CN116913092A (en) | Traffic state prediction method, traffic state prediction device, electronic equipment and storage medium | |
CN116311893A (en) | Traffic jam time prediction method and device, electronic equipment and storage medium | |
CN115099163A (en) | Charge state determining method and device, electronic equipment and storage medium | |
CN116884215B (en) | Traffic state prediction and model generation methods, devices, equipment and media | |
CN116416500B (en) | Image recognition model training method, image recognition device and electronic equipment | |
CN118171047B (en) | Filling method and device of missing data, electronic equipment and storage medium | |
CN115878783B (en) | Text processing method, deep learning model training method and sample generation method | |
US12038989B2 (en) | Methods for community search, method for training community search model, and electronic device | |
CN113361712B (en) | Training method of feature determination model, semantic analysis method, semantic analysis device and electronic equipment | |
CN118378703A (en) | Sample processing method, device, electronic equipment and storage medium | |
CN112861951A (en) | Method for determining image neural network parameters and electronic equipment | |
CN117707899A (en) | Micro-service abnormality detection method, device, equipment and storage medium | |
CN114822721A (en) | Molecular diagram generation method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |