Traffic flow prediction method, device, equipment and medium

By acquiring and segmenting road segment trajectories, constructing a road network topology tree, and extracting traffic flow based on tree matrices and features, the problem of traffic flow prediction error and applicability in the existing technology is solved, and the accuracy and accuracy of traffic flow prediction are improved.

CN118522151BActive Publication Date: 2024-10-18CENT SOUTH UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410930033.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-18
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

Existing traffic flow prediction algorithms have errors in extracting spatial correlation and are difficult to apply to one-way cities. Moreover, the occlusion problem of vehicle-mounted positioning equipment leads to flow information errors. In addition, existing algorithms usually use intersections as the research object and fail to identify road segments. The angle takes into account traffic flow changes, resulting in low accuracy.

Method used

By obtaining the connection relationship and vehicle driving trajectory between each two road segments in the target area, segmenting the trajectory into real road segment trajectories, constructing a road network topology tree, and predicting traffic flow based on the tree matrix and traffic flow characteristics, taking into account the connections between road segments relationship and time correlation to eliminate trajectory drift errors.

Benefits of technology

It improves the accuracy and accuracy of traffic flow prediction, can effectively express the future traffic flow of each road section in the target area, and is suitable for complex urban road networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118522151B_ABST
    Figure CN118522151B_ABST
Patent Text Reader

Abstract

The present application relates to the field of intelligent transportation technology, and provides a traffic flow prediction method, device, equipment and medium. The traffic flow prediction method includes: dividing the driving trajectory into multiple road section trajectories according to the multiple road sections corresponding to the driving trajectory, and determining multiple real road section trajectories from all road section trajectories based on the connection relationship between every two road section trajectories; obtaining the traffic flow of each road section in a time period in the target area according to all real road section trajectories; extracting features of the traffic flow of each road section in all time periods to obtain the traffic flow characteristics of each road section; constructing a road network topology tree, and obtaining a tree matrix of each road section based on the road network topology tree; predicting the traffic flow of each road section in multiple time periods in the future based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, and obtaining the traffic flow prediction results of the target area. The traffic flow prediction method of the present application can improve the accuracy of traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent transportation technology, and in particular to a traffic flow prediction method, device, equipment and medium. Background Art

[0002] As cities continue to expand, urban road networks become increasingly complex. At the same time, economic development has led to a continuous increase in the number of private cars. Traffic congestion has become a key issue for urban management departments. With the development of digital technology in recent years, traffic flow prediction technology has become a key technical means to deal with urban traffic congestion. Existing traffic flow prediction algorithms usually use spatiotemporal correlation as the main approach. In particular, in terms of spatial correlation processing, graph structures represented by graph convolutional neural networks (GCN) have been deeply explored in recent years, such as temporal graph convolutional neural networks (T-GCN), hybrid attention spatiotemporal graph convolutional neural networks (AST-GCN, Attribute-Augmented Spatiotemporal Graph Convolutional Network), etc. Its main method is to extract deep spatial relationships in traffic flow by stacking graph convolutions multiple times. While extracting features, it will also cause the accumulation of errors. Therefore, this method has unavoidable errors in extracting spatial correlations. At the same time, graph convolution generally uses undirected graphs, and it is assumed that each connected road section can be bidirectional. This situation is difficult to use in cities with many one-way streets. In the process of extracting traffic information based on vehicle positioning equipment, the problem of positioning point drift often occurs due to the occlusion of houses and trees, resulting in errors in the extracted traffic information. In addition, with the improvement of the degree of urban digitization, how to deal with massive traffic flow data has become a key issue for urban managers to build effective traffic flow predictions. At the same time, existing traffic flow prediction algorithms all use intersection data as research content, and the research usually takes intersections as research objects, and fails to consider the changes in traffic flow from the perspective of road sections. It can be seen that there is a problem of low accuracy in traffic flow prediction. Summary of the invention

[0003] The present application provides a traffic flow prediction method, device, equipment and medium, which can solve the problem of low accuracy of traffic flow prediction.

[0004] In a first aspect, an embodiment of the present application provides a traffic flow prediction method, the traffic flow prediction method comprising:

[0005] Get the connection relationship between every two road segments in the target area, as well as the The driving trajectory of the time period; The end time of each time period is the current time;

[0006] For each driving trajectory, the driving trajectory is divided into a plurality of road segment trajectories according to a plurality of road segments corresponding to the driving trajectory, and a plurality of real road segment trajectories are determined from all the road segment trajectories based on a connection relationship between every two road segment trajectories;

[0007] According to all real road segment trajectories, obtain the trajectory of each road segment in the target area. Traffic flow in a certain time period;

[0008] Extract the traffic flow characteristics of each road section in all time periods to obtain the traffic flow characteristics of each road section;

[0009] Construct a road network topology tree, and obtain a tree matrix of each road section based on the road network topology tree; multiple nodes of the road network topology tree correspond to multiple road sections one by one, and the edge between each two nodes represents the connection relationship between the corresponding two road sections;

[0010] Based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, the traffic flow of each road section in multiple time periods in the future is predicted to obtain the traffic flow prediction results of the target area.

[0011] Optionally, based on the connection relationship between every two road segment trajectories, a plurality of real road segment trajectories are determined from all road segment trajectories, including:

[0012] All the road section trajectories are sorted from first to last according to the time point when the vehicle enters each road section trajectory;

[0013] For each section trajectory, perform the following steps:

[0014] Determine whether the previous section track of the section track is connected to the next section track of the section track;

[0015] If the previous section trajectory of the section trajectory is connected to the next section trajectory of the section trajectory, then it is determined whether the time the vehicle travels on the section trajectory is greater than a time threshold;

[0016] If the time that the vehicle travels on the road segment trajectory is greater than the time threshold, the road segment trajectory is regarded as a real road segment trajectory;

[0017] If the time a vehicle spends on a road segment is less than or equal to the time threshold, the road segment trajectory is removed;

[0018] If the previous segment trajectory of the segment trajectory is not connected to the next segment trajectory of the segment trajectory, the segment trajectory is regarded as a real segment trajectory.

[0019] Optionally, based on all real road segment trajectories, obtain the Traffic flow for each time period, including:

[0020] For each road section, the number of real road section trajectories corresponding to the road section in each time period is counted, and the number of real road section trajectories is used as the traffic flow of the road section in the corresponding time period.

[0021] Optionally, feature extraction is performed on the traffic flow of each road section in all time periods to obtain traffic flow features of each road section, including:

[0022] By formula:

[0023]

[0024] Calculate the Traffic flow characteristics of road sections ;

[0025] in, Indicates The dimension of the query vector matrix of road segments is , represents the number of road segments in the target area, , Indicates the number of time periods, represents the transpose operation of the matrix, Indicates The road section in The query vector of traffic flow in a time period, Indicates The road section in The key vector of traffic flow in each time period, Indicates The road section is The value vector of traffic flow in time periods:

[0026]

[0027]

[0028]

[0029] in, represents the query vector matrix, represents the key vector matrix, represents a matrix of value vectors, , and are weight matrices, The query vector representing the traffic flow of the first road section in the first time period, Indicates The query vector of the traffic flow of a road section in the first time period, Indicates that the first section is in The query vector of traffic flow in a time period, Indicates The road section in The query vector of traffic flow in a time period, The key vector representing the traffic flow of the first road segment in the first time period, Indicates The key vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The key vector of traffic flow in each time period, Indicates The road section in The key vector of traffic flow in each time period, The value vector representing the traffic flow of the first road section in the first time period, Indicates The value vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The value vector of traffic flow in each time period, Indicates The road section in The value vector of traffic flow in each time period, Represent the traffic flow matrix:

[0030]

[0031] in, represents the traffic flow of the first road section in the first time period, Indicates The traffic flow of a road section in the first time period, Indicates that the first section is in Traffic flow in a certain time period, Indicates The road section in Traffic flow in a time period.

[0032] Optionally, obtain the tree matrix of each road segment based on the road network topology tree, including:

[0033] For each road segment, perform the following steps:

[0034] Select the node corresponding to the road segment in the road network topology tree as the center All adjacent nodes of the layer; Select the range for the preset;

[0035] Obtain the distance between the road segment and each road segment corresponding to the adjacent node in the second layer, and obtain the distance between two road segments corresponding to each two adjacent nodes having a connection relationship;

[0036] All distances are combined into the same matrix to obtain the tree matrix of the road segment.

[0037] Optionally, based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, the traffic flow of each road section in multiple time periods in the future is predicted to obtain the traffic flow prediction results of the target area, including:

[0038] Based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, the traffic flow spatial characteristics of the target area are obtained;

[0039] Obtain traffic flow prediction results for the target area based on the spatial characteristics of traffic flow.

[0040] Optionally, based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, the traffic flow spatial characteristics of the target area are obtained, including:

[0041] By formula:

[0042]

[0043] Calculate the spatial characteristics of traffic flow in the target area ;

[0044] in, represents the learnable parameters, represents the traffic flow characteristic matrix, The set of tree matrices representing all road segments:

[0045]

[0046]

[0047] in, represents the traffic flow characteristics of the first road segment, Indicates Traffic flow characteristics of each road section, represents the tree matrix of the first road segment, Indicates The tree matrix of road segments;

[0048] Obtain traffic flow prediction results for the target area based on traffic flow spatial characteristics, including:

[0049] By formula:

[0050]

[0051] Calculate traffic flow prediction results for the target area ;

[0052] in, represents the weight, Indicates bias, Indicates that the first section is in The predicted traffic flow for each time period, Indicates The road section in The predicted traffic flow for each time period, Indicates that the first section is in The predicted traffic flow for each time period, Indicates The road section in The predicted traffic flow for a period of time.

[0053] In a second aspect, an embodiment of the present application provides a traffic flow prediction device, comprising:

[0054] The first acquisition module acquires the connection relationship between every two road sections in the target area, and the The driving trajectory of the time period; The end time of each time period is the current time;

[0055] A determination module, for each driving trajectory, divides the driving trajectory into a plurality of road segment trajectories according to a plurality of road segments corresponding to the driving trajectory, and determines a plurality of real road segment trajectories from all the road segment trajectories based on a connection relationship between every two road segment trajectories;

[0056] The second acquisition module obtains the trajectory of each road section in the target area according to all real road section trajectories. Traffic flow in a certain time period;

[0057] The feature extraction module extracts the features of the traffic flow of each road section in all time periods to obtain the traffic flow features of each road section;

[0058] A construction module is used to construct a road network topology tree, and obtain a tree matrix of each road section based on the road network topology tree; multiple nodes of the road network topology tree correspond to multiple road sections one by one, and the edge between each two nodes represents the connection relationship between the corresponding two road sections;

[0059] The prediction module predicts the traffic flow of each road section in multiple time periods in the future based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, and obtains the traffic flow prediction results of the target area.

[0060] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned traffic flow prediction method when executing the above-mentioned computer program.

[0061] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned traffic flow prediction method is implemented.

[0062] The above solution of the present application has the following beneficial effects:

[0063] In the embodiment of the present application, the connection relationship between every two road sections in the target area and the number of vehicles in the target area are obtained. The driving trajectory of each time period is then divided into multiple road segment trajectories according to the multiple road segments corresponding to the driving trajectory, and multiple real road segment trajectories are determined from all the road segment trajectories based on the connection relationship between every two road segment trajectories. Then, the real road segment trajectories of each road segment in the target area are obtained according to all the real road segment trajectories. The traffic flow of each section in each time period is extracted, and then the traffic flow of each section in all time periods is extracted to obtain the traffic flow characteristics of each section. Then the road network topology tree is constructed, and the tree matrix of each section is obtained based on the road network topology tree. Finally, the traffic flow prediction result of the target area is obtained based on the tree matrix of all sections and the traffic flow characteristics of all sections. Among them, based on the connection relationship between each two section trajectories, multiple real section trajectories are determined from all section trajectories, and the rationality of the connection relationship between the two section trajectories is considered, so that the determined real section trajectory is authentic, and the section trajectory with trajectory drift is effectively eliminated, thereby improving the accuracy of the traffic flow obtained based on the real section trajectory with authenticity, and the accuracy of the traffic flow prediction result obtained based on the high-precision traffic flow is high. At the same time, the traffic flow prediction result can express the traffic flow of each section in the target area in the future time period, further improving the accuracy of the traffic flow prediction.

[0064] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0066] Figure 1 A flow chart of a traffic flow prediction method provided in one embodiment of the present application;

[0067] Figure 2 A schematic diagram of the structure of a traffic flow prediction device provided in one embodiment of the present application;

[0068] Figure 3 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0069] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0070] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0071] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0072] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0073] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0074] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0075] In view of the low accuracy of existing traffic flow prediction, the embodiment of the present application provides a traffic flow prediction method, which obtains the connection relationship between every two road sections in the target area and the traffic flow of multiple vehicles. The driving trajectory of each time period is then divided into multiple road segment trajectories according to the multiple road segments corresponding to the driving trajectory, and multiple real road segment trajectories are determined from all the road segment trajectories based on the connection relationship between every two road segment trajectories. Then, the real road segment trajectories of each road segment in the target area are obtained according to all the real road segment trajectories. The traffic flow of each section in each time period is extracted, and then the traffic flow of each section in all time periods is extracted to obtain the traffic flow characteristics of each section. Then the road network topology tree is constructed, and the tree matrix of each section is obtained based on the road network topology tree. Finally, the traffic flow prediction result of the target area is obtained based on the tree matrix of all sections and the traffic flow characteristics of all sections. Among them, based on the connection relationship between each two section trajectories, multiple real section trajectories are determined from all section trajectories, and the rationality of the connection relationship between the two section trajectories is considered, so that the determined real section trajectory is authentic, and the section trajectory with trajectory drift is effectively eliminated, thereby improving the accuracy of the traffic flow obtained based on the real section trajectory with authenticity, and the accuracy of the traffic flow prediction result obtained based on the high-precision traffic flow is high. At the same time, the traffic flow prediction result can express the traffic flow of each section in the target area in the future time period, further improving the accuracy of the traffic flow prediction.

[0076] Next, the traffic flow prediction method provided by this application is illustrated.

[0077] like Figure 1 As shown, the traffic flow prediction method provided by this application includes the following steps:

[0078] Step 11, obtain the connection relationship between every two road sections in the target area, and the Driving trajectory for a period of time.

[0079] No. The end time point of each time period is the current moment, and the target area is the area where traffic flow prediction is required, such as a city or a county.

[0080] In some embodiments of the present application, the connection relationship between each two road sections in the target area can be obtained by using computer software such as Google Maps, and the location of multiple vehicles in the target area can be obtained by using positioning systems or software such as the Global Positioning System (GPS). Driving trajectory for a period of time.

[0081] For example, the above A time period can be divided into hours. For example, if the current time is 9 o'clock, the length of the time period is one hour. , then the first time period is from 6 to 7 o'clock, the second time period is from 7 to 8 o'clock, and the third time period is from 8 to 9 o'clock.

[0082] Step 12, for each driving trajectory, according to the multiple road sections corresponding to the driving trajectory, the driving trajectory is divided into multiple road section trajectories, and based on the connection relationship between every two road section trajectories, multiple real road section trajectories are determined from all the road section trajectories.

[0083] The above-mentioned multiple road sections correspond one to one with multiple road section trajectories. The road section trajectory is a driving trajectory on the corresponding road section. For example, in the driving trajectory of the vehicle, the first 100 meters are driving on road section A, and then enter road section B and drive 300 meters. The driving trajectory of the first 100 meters is the road section trajectory corresponding to road section A, and the driving trajectory of the last 300 meters is the road section corresponding to road section B.

[0084] It should be noted that due to interference from buildings such as houses and trees, the vehicle-mounted GPS trajectory is prone to drift and other problems, especially at intersections or road intersections. The trajectory originally traveling on section A may be located on section B, resulting in certain errors.

[0085] In some embodiments of the present application, the driving trajectory can be divided into multiple road segment trajectories using computer software such as MATLAB. The above step of determining multiple real road segment trajectories from all road segment trajectories based on the connection relationship between every two road segment trajectories is specifically as follows:

[0086] In the first step, all the road section trajectories are sorted from first to last according to the time point when the vehicle enters each road section trajectory.

[0087] For example, the vehicle enters section A at 6:05, section B at 6:08, and section C at 6:09. The tracks are then sorted according to the track corresponding to section A, the track corresponding to section B, and the track corresponding to section C.

[0088] In the second step, for each section trajectory, perform the following steps:

[0089] Determine whether the previous segment track of the segment track is connected to the next segment track of the segment track.

[0090] If the previous section trajectory of the section trajectory is connected to the next section trajectory of the section trajectory, it is determined whether the driving time of the vehicle on the section trajectory is greater than a time threshold.

[0091] If the time that the vehicle travels on the road segment trajectory is greater than the time threshold, the road segment trajectory is taken as a real road segment trajectory.

[0092] If the time that the vehicle travels on the road section trajectory is less than or equal to the time threshold, the road section trajectory is removed.

[0093] If the previous segment trajectory of the segment trajectory is not connected to the next segment trajectory of the segment trajectory, the segment trajectory is regarded as a real segment trajectory.

[0094] It should be noted that the first and last segment trajectories are not processed in the above steps and are directly used as real segment trajectories.

[0095] For example, according to the actual situation and the time point when the vehicle enters the road section, the theoretical connection relationship of the section trajectories corresponding to section A, section B, and section C should be: the section trajectory corresponding to section A is connected to the section trajectory corresponding to section B, and the section trajectory corresponding to section B is connected to the section trajectory corresponding to section C. However, the section trajectory corresponding to section A is actually connected to the section trajectory corresponding to section C, which is inconsistent with the theory and does not conform to the general vehicle driving situation. It is believed that the section trajectory corresponding to section B is caused by positioning drift, and the vehicle has not actually driven to section B. In order to avoid special situations, such as special behaviors such as the vehicle turning around on section B, which causes the section trajectory corresponding to section A to be connected to the section trajectory corresponding to section C, the time the vehicle travels on the section trajectory corresponding to section B is judged. If it is greater than the time threshold of 10 seconds, it means that the section trajectory corresponding to section B is real data and is a real section trajectory. If it is less than or equal to the time threshold, it means that the section trajectory corresponding to section B is indeed abnormal data caused by positioning drift and is eliminated.

[0096] It is worth mentioning that based on the connection relationship between every two road section trajectories, multiple real road section trajectories are determined from all road section trajectories. The rationality of the connection relationship between two road section trajectories is taken into consideration, so that the determined real road section trajectories are authentic, and the road section trajectories with trajectory drift are effectively eliminated, thereby improving the accuracy of traffic flow obtained based on the authentic real road section trajectories.

[0097] In addition, when analyzing the road segment trajectories, the connection relationship of the road segment trajectories over time is considered, the directionality of traffic flow is integrated and the influence of one-way roads is considered, which is suitable for cities with complex road conditions.

[0098] Step 13: Obtain the number of each road section in the target area according to all real road section trajectories. Traffic flow in a time period.

[0099] Specifically, for each road section, the number of real road section trajectories corresponding to the road section in each time period is counted, and the number of real road section trajectories is used as the traffic flow of the road section in the corresponding time period.

[0100] For example, for road section A, among the real road section trajectories of all vehicles in the second time period, there are 31 real road section trajectories corresponding to road section A, which means that in the second time period, the number of vehicles traveling on road section A is 31, that is, the traffic flow is 31.

[0101] It is worth mentioning that the accuracy of traffic flow obtained based on the authentic real road section trajectory is improved, which can reflect the real traffic conditions and reduce errors.

[0102] Step 14, extracting features of the traffic flow of each road section in all time periods to obtain traffic flow features of each road section.

[0103] Specifically, through the formula:

[0104]

[0105] Calculate the Traffic flow characteristics of road sections ;

[0106] in, Indicates The dimension of the query vector matrix of road segments is , represents the number of road segments in the target area, , Indicates the number of time periods, represents the transpose operation of the matrix, Indicates The road section is The query vector of traffic flow in a time period, Indicates The road section is The key vector of traffic flow in each time period, Indicates The road section is The value vector of traffic flow in time periods:

[0107]

[0108]

[0109]

[0110] in, represents the query vector matrix, represents the key vector matrix, represents a matrix of value vectors, , and are weight matrices, The query vector representing the traffic flow of the first road section in the first time period, Indicates The query vector of the traffic flow of a road section in the first time period, Indicates that the first section is in The query vector of traffic flow in a time period, Indicates The road section is The query vector of traffic flow in a time period, The key vector representing the traffic flow of the first road segment in the first time period, Indicates The key vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The key vector of traffic flow in each time period, Indicates The road section is The key vector of traffic flow in each time period, The value vector representing the traffic flow of the first road section in the first time period, Indicates The value vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The value vector of traffic flow in each time period, Indicates The road section is The value vector of traffic flow in each time period, Represent the traffic flow matrix:

[0111]

[0112] in, represents the traffic flow of the first road section in the first time period, Indicates The traffic flow of a road section in the first time period, Indicates that the first section is in Traffic flow in a certain time period, Indicates The road section is Traffic flow in a time period.

[0113] For example, the above calculation formula can be run using computer software such as MATLAB to obtain the traffic flow characteristics of each road section.

[0114] It should be noted that the above-mentioned query vector, key vector, and value vector are all calculation results in the temporal attention mechanism, that is, this step is to obtain the traffic flow characteristics of each road section based on the temporal attention mechanism. The temporal attention mechanism is used to process the temporal correlation of traffic flow and can analyze and extract the temporal characteristics of traffic flow in multiple time periods.

[0115] It is worth mentioning that the traffic flow characteristics obtained based on the precise traffic flow are highly accurate and can accurately reflect the traffic flow conditions of the road section over time.

[0116] Step 15: construct a road network topology tree, and obtain a tree matrix for each road section based on the road network topology tree.

[0117] The multiple nodes of the road network topology tree correspond one-to-one to the multiple road sections, and the edge between each two nodes represents the connection relationship between the corresponding two road sections.

[0118] In some embodiments of the present application, the above step of obtaining the tree matrix of each road section based on the road network topology tree is specifically as follows:

[0119] For each road segment, perform the following steps:

[0120] The first step is to select the node corresponding to the road segment in the road network topology tree. All adjacent nodes of the layer. Select a range for the preset.

[0121] For example, , taking the node corresponding to section A as the center, this node is the first layer, the nodes adjacent to this node in the second layer are the nodes corresponding to sections B and C, and the node adjacent to the node corresponding to section B in the third layer is the node corresponding to section D. The nodes corresponding to sections B, C, and D are all regarded as adjacent nodes.

[0122] The second step is to obtain the distance between the road segment and the road segment corresponding to each adjacent node in the second layer, and obtain the distance between two road segments corresponding to each two adjacent nodes having a connection relationship.

[0123] It should be noted that the distance between the above two sections is the distance between the first end of one section and the first end of the other section.

[0124] The third step is to integrate all distances into the same matrix to obtain the tree matrix of the road segment.

[0125] For example, the tree matrix of road segment A is for:

[0126]

[0127] in, Represents the distance between section A and section B. represents the distance between section A and section C. Indicates the distance between segment B and segment D.

[0128] It should be noted that, starting from the second-layer node, if there is no other node adjacent to the node of the current layer, it is recorded as 0 in the tree matrix. In order to reduce the complexity, the tree matrix of each road segment needs to be compressed, such as through the formula:

[0129]

[0130] The tree matrix for road segment A Compress and get the compressed tree matrix .

[0131] in, Represents the learnable parameters of the convolution kernel used for the convolution operation.

[0132] It is worth mentioning that the road network topology tree can describe the connection relationship of the road sections in the target area, including the spatial information of the target area. The tree matrix of each road section obtained based on the road network topology tree can describe the connection information between the road section and other road sections, providing spatial information for subsequent calculations.

[0133] Step 16, based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, the traffic flow of each road section in multiple time periods in the future is predicted to obtain the traffic flow prediction result of the target area.

[0134] In some embodiments of the present application, the traffic flow of each road section in multiple time periods in the future is predicted based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, and the traffic flow prediction result of the target area is obtained as follows:

[0135] In the first step, based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, the spatial characteristics of traffic flow in the target area are obtained.

[0136] Specifically, through the formula:

[0137]

[0138] Calculate the spatial characteristics of traffic flow in the target area .

[0139] in, represents the learnable parameters, represents the traffic flow characteristic matrix, The set of tree matrices representing all road segments:

[0140]

[0141]

[0142] in, represents the traffic flow characteristics of the first road segment, Indicates Traffic flow characteristics of each road section, represents the tree matrix of the first road segment, Indicates The tree matrix of the road segments.

[0143] The second step is to obtain the traffic flow prediction results of the target area based on the spatial characteristics of traffic flow.

[0144] Specifically, through the formula:

[0145]

[0146] Calculate traffic flow prediction results for the target area .

[0147] in, represents the weight, Indicates bias, Indicates that the first section is in The predicted traffic flow for each time period, Indicates The road section in The predicted traffic flow for each time period, Indicates that the first section is in The predicted traffic flow for each time period, Indicates The road section in The predicted traffic flow for a period of time.

[0148] For example, the above formula can be run using computer software such as MATLAB to obtain traffic flow prediction results for the target area.

[0149] In some embodiments of the present application, fog computing can be used to take each vehicle as a fog computing node to obtain the vehicle's The driving trajectory of each time period is divided into multiple road segment trajectories according to the multiple road segments corresponding to the driving trajectory, and multiple real road segment trajectories are determined from all road segment trajectories based on the connection relationship between every two road segment trajectories. Then the fog computing node uploads all the real road segment trajectories to the nearest data collection station, and the data of all data collection stations are uploaded to the data collection center, and then the traffic flow prediction results are obtained based on the real road segment trajectories in the data collection center.

[0150] It should be noted that the above learnable parameters , weight , bias All of them are in the graph convolution mechanism, that is, this step is to obtain the traffic flow prediction results based on the graph convolution mechanism.

[0151] It is worth mentioning that the traffic flow prediction results are obtained based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, while considering both time and space information, which improves the accuracy of the traffic flow prediction results.

[0152] The traffic flow prediction device provided in this application is exemplarily described below.

[0153] like Figure 2 As shown, the embodiment of the present application provides a traffic flow prediction device, and the traffic flow prediction device 200 includes:

[0154] The first acquisition module 201 acquires the connection relationship between every two road sections in the target area, and the The driving trajectory of the time period; The end time of each time period is the current time;

[0155] The determination module 202 divides each driving trajectory into a plurality of road segment trajectories according to a plurality of road segments corresponding to the driving trajectory, and determines a plurality of real road segment trajectories from all the road segment trajectories based on a connection relationship between every two road segment trajectories;

[0156] The second acquisition module 203 acquires the trajectory of each road section in the target area according to all real road section trajectories. Traffic flow in a certain time period;

[0157] The feature extraction module 204 extracts features of the traffic flow of each road section in all time periods to obtain traffic flow features of each road section;

[0158] A construction module 205 is used to construct a road network topology tree, and obtain a tree matrix of each road section based on the road network topology tree; multiple nodes of the road network topology tree correspond to multiple road sections one by one, and the edge between each two nodes represents the connection relationship between the corresponding two road sections;

[0159] The prediction module 206 predicts the traffic flow of each road section in multiple time periods in the future based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, and obtains the traffic flow prediction result of the target area.

[0160] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0161] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0162] like Figure 3 As shown, an embodiment of the present application provides a terminal device. The terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 3Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the steps of any of the above-mentioned method embodiments when executing the computer program D102.

[0163] Specifically, when the processor D100 executes the computer program D102, the connection relationship between each two road sections in the target area and the number of vehicles in the target area are obtained. The driving trajectory of each time period is then divided into multiple road segment trajectories according to the multiple road segments corresponding to the driving trajectory, and multiple real road segment trajectories are determined from all the road segment trajectories based on the connection relationship between every two road segment trajectories. Then, the real road segment trajectories of each road segment in the target area are obtained according to all the real road segment trajectories. The traffic flow of each section in each time period is extracted, and then the traffic flow of each section in all time periods is extracted to obtain the traffic flow characteristics of each section. Then the road network topology tree is constructed, and the tree matrix of each section is obtained based on the road network topology tree. Finally, the traffic flow prediction result of the target area is obtained based on the tree matrix of all sections and the traffic flow characteristics of all sections. Among them, based on the connection relationship between each two section trajectories, multiple real section trajectories are determined from all section trajectories, and the rationality of the connection relationship between the two section trajectories is considered, so that the determined real section trajectory is authentic, and the section trajectory with trajectory drift is effectively eliminated, thereby improving the accuracy of the traffic flow obtained based on the real section trajectory with authenticity, and the accuracy of the traffic flow prediction result obtained based on the high-precision traffic flow is high. At the same time, the traffic flow prediction result can express the traffic flow of each section in the target area in the future time period, further improving the accuracy of the traffic flow prediction.

[0164] The processor D100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0165] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC, SmartMedia Card), a secure digital (SD, Secure Digital) card, a flash card (Flash Card), etc. equipped on the terminal device D10. Further, the memory D101 may also include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory D101 may also be used to temporarily store data that has been output or is to be output.

[0166] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0167] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0168] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the traffic flow prediction method device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0169] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0170] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0171] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A traffic flow prediction method, characterized in that: include: Get the connection relationship between every two road segments in the target area, as well as the The driving trajectory of the time period; The end time of each time period is the current time; For each of the driving trajectories, according to the multiple road sections corresponding to the driving trajectory, the driving trajectory is divided into multiple road section trajectories, and based on the connection relationship between every two road section trajectories, multiple real road section trajectories are determined from all the road section trajectories; According to all real road section trajectories, obtain the trajectory of each road section in the target area. Traffic flow in a certain time period; Extracting features of the traffic flow of each road section in all time periods to obtain traffic flow features of each road section; Constructing a road network topology tree, and obtaining a tree matrix of each road section based on the road network topology tree; The multiple nodes of the road network topology tree correspond to the multiple road sections one by one, and the edge between each two nodes represents the connection relationship between the corresponding two road sections; Based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, the traffic flow of each road section in multiple time periods in the future is predicted to obtain the traffic flow prediction result of the target area; The feature extraction of the traffic flow of each road section in all time periods to obtain the traffic flow features of each road section includes: By formula: Calculate the Traffic flow characteristics of road sections ; in, Indicates the The dimension of the query vector matrix of road segments is , represents the number of road segments in the target area, , Indicates the number of time periods, represents the transpose operation of the matrix, Indicates the The road section is The query vector of traffic flow in a time period, Indicates the The road section in The key vector of traffic flow in each time period, Indicates the The road section is The value vector of traffic flow in time periods: in, represents the query vector matrix, represents the key vector matrix, represents a matrix of value vectors, , and are weight matrices, The query vector representing the traffic flow of the first road section in the first time period, Indicates The query vector of the traffic flow of a road section in the first time period, Indicates that the first section is in The query vector of traffic flow in a time period, Indicates the The road section is The query vector of traffic flow in a time period, A key vector representing the traffic flow of the first road section in the first time period, Indicates the The key vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The key vector of traffic flow in each time period, Indicates the The road section is The key vector of traffic flow in each time period, A value vector representing the traffic flow of the first road section in the first time period, Indicates the The value vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The value vector of traffic flow in each time period, Indicates the The road section is The value vector of traffic flow in each time period, Represent the traffic flow matrix: in, represents the traffic flow of the first road section in the first time period, Indicates the The traffic flow of a road section in the first time period, Indicates that the first section is in Traffic flow in a certain time period, Indicates the The road section is Traffic flow in a time period.

2. The traffic flow prediction method according to claim 1, characterized in that: The method of determining a plurality of real road segment trajectories from all road segment trajectories based on the connection relationship between every two road segment trajectories includes: All the road section trajectories are sorted from first to last according to the time point when the vehicle enters each road section trajectory; For each of the road segment trajectories, perform the following steps: Determine whether a previous section track of the section track is connected to a next section track of the section track; If the previous section track of the section track is connected to the next section track of the section track, determining whether the time the vehicle travels on the section track is greater than a time threshold; If the time for which the vehicle travels on the road segment trajectory is greater than the time threshold, the road segment trajectory is regarded as a real road segment trajectory; If the time that the vehicle travels on the road section trajectory is less than or equal to the time threshold, the road section trajectory is removed; If the previous segment trajectory of the segment trajectory is not connected to the next segment trajectory of the segment trajectory, the segment trajectory is taken as a real segment trajectory.

3. The traffic flow prediction method according to claim 1, characterized in that: The method of obtaining the trajectory of each road section in the target area according to all real road section trajectories is described as follows: Traffic flow for each time period, including: For each of the road sections, the number of real road section trajectories corresponding to the road section in each time period is counted, and the number of real road section trajectories is used as the traffic flow of the road section in the corresponding time period.

4. The traffic flow prediction method according to claim 1, characterized in that: The step of obtaining a tree matrix for each road section based on the road network topology tree includes: For each of the road sections, perform the following steps: Select the node corresponding to the road section in the road network topology tree as the center All adjacent nodes of the layer; Select the range for the preset; Obtain the distance between the road segment and each road segment corresponding to the adjacent node in the second layer, and obtain the distance between two road segments corresponding to each two adjacent nodes having a connection relationship; All distances are combined into the same matrix to obtain the tree matrix of the road segment.

5. The traffic flow prediction method according to claim 1, characterized in that: The traffic flow of each road section in multiple time periods in the future is predicted based on the tree matrix of all road sections and the traffic flow characteristics of all road sections to obtain the traffic flow prediction result of the target area, including: Based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, obtaining the traffic flow spatial characteristics of the target area; The traffic flow prediction result of the target area is obtained based on the traffic flow spatial characteristics.

6. The traffic flow prediction method according to claim 5, characterized in that: The step of obtaining the traffic flow spatial characteristics of the target area based on the tree matrix of all road sections and the traffic flow characteristics of all road sections includes: By formula: Calculate the traffic flow spatial characteristics of the target area ; in, represents the learnable parameters, represents the traffic flow characteristic matrix, The set of tree matrices representing all road segments: in, represents the traffic flow characteristics of the first road segment, Indicates Traffic flow characteristics of each road section, represents the tree matrix of the first road segment, Indicates the The tree matrix of road segments; The obtaining of the traffic flow prediction result of the target area based on the traffic flow spatial characteristics includes: By formula: Calculate the traffic flow prediction results of the target area ; in, represents the weight, represents the bias, Indicates that the first section is in The predicted traffic flow for each time period, Indicates the The road section is The predicted traffic flow for each time period, Indicates that the first section is in The predicted traffic flow for each time period, Indicates the The road section is The predicted traffic flow for a period of time.

7. A traffic flow prediction device, characterized in that: include: The first acquisition module acquires the connection relationship between every two road sections in the target area, and the The driving trajectory of the time period; The end time of each time period is the current time; a determination module, for each of the driving trajectories, dividing the driving trajectory into a plurality of road segment trajectories according to a plurality of road segments corresponding to the driving trajectory, and determining a plurality of real road segment trajectories from all the road segment trajectories based on a connection relationship between every two road segment trajectories; The second acquisition module acquires the trajectory of each road section in the target area according to all real road section trajectories. Traffic flow in a certain time period; A feature extraction module extracts features of the traffic flow of each road section in all time periods to obtain traffic flow features of each road section; A construction module is used to construct a road network topology tree, and obtain a tree matrix of each road section based on the road network topology tree; The multiple nodes of the road network topology tree correspond to the multiple road sections one by one, and the edge between each two nodes represents the connection relationship between the corresponding two road sections; A prediction module predicts the traffic flow of each road section in multiple time periods in the future based on the tree matrix of all road sections and the traffic flow characteristics of all road sections, and obtains the traffic flow prediction result of the target area; Wherein, the feature extraction module is specifically used for: By formula: Calculate the Traffic flow characteristics of road sections ; in, Indicates the The dimension of the query vector matrix of road segments is , represents the number of road segments in the target area, , Indicates the number of time periods, represents the transpose operation of the matrix, Indicates the The road section is The query vector of traffic flow in a time period, Indicates the The road section is The key vector of traffic flow in each time period, Indicates the The road section is The value vector of traffic flow in time periods: in, represents the query vector matrix, represents the key vector matrix, represents a matrix of value vectors, , and are weight matrices, The query vector representing the traffic flow of the first road section in the first time period, Indicates The query vector of the traffic flow of a road section in the first time period, Indicates that the first section is in The query vector of traffic flow in a time period, Indicates the The road section in The query vector of traffic flow in a time period, A key vector representing the traffic flow of the first road section in the first time period, Indicates the The key vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The key vector of traffic flow in each time period, Indicates the The road section in The key vector of traffic flow in each time period, A value vector representing the traffic flow of the first road section in the first time period, Indicates the The value vector of the traffic flow of the road section in the first time period, Indicates that the first section is in The value vector of traffic flow in each time period, Indicates the The road section in The value vector of traffic flow in each time period, Represent the traffic flow matrix: in, represents the traffic flow of the first road section in the first time period, Indicates the The traffic flow of a road section in the first time period, Indicates that the first section is in Traffic flow in a certain time period, Indicates the The road section in Traffic flow in a time period.

8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the traffic flow prediction method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the traffic flow prediction method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Traffic prediction method based on attention temporal graph convolutional network

    CN109754605A

  • Traffic fusion analytical prediction method and system and electronic device

    CN110276947A

  • GPS track data road section flow matching method based on network coding

    CN115662124A

  • Vehicle traffic flow prediction method with missing data

    US20210407284A1

  • Traffic flow forecasting method based on deep graph gaussian processes

    US20230058520A1