A traffic flow prediction method, device, electronic device, and storage medium

By using adjacency matrices to extract spatial traffic flow features from historical data, the method improves traffic flow prediction accuracy by capturing spatial relationships, addressing the limitations of predefined graph structures in existing methods.

CN113822460BActive Publication Date: 2025-07-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110696394.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-23
Publication Date
2025-07-15
Estimated Expiration
2041-06-23

AI Technical Summary

Technical Problem

In the existing traffic flow prediction methods, the graph convolutional neural network model cannot effectively capture the spatial correlation between traffic areas, resulting in bias in the prediction results.

Method used

By obtaining the historical traffic flow matrix, the adjacent matrix is used to extract the flow flow characteristics between each traffic area, and feature extraction and fusion are performed to improve prediction accuracy.

Benefits of technology

It improves the accuracy of traffic flow prediction results and can more accurately predict future traffic conditions in traffic areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113822460B_ABST
    Figure CN113822460B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a traffic flow prediction method, device, electronic device, and storage medium. According to the area to be predicted and the moment to be predicted, a historical traffic flow matrix can be obtained. The historical traffic flow matrix includes traffic flow transfer information between each traffic area in multiple traffic areas and other traffic areas. Based on the historical traffic flow matrix, the transfer characteristics between the traffic flow of each traffic area and other traffic areas are extracted through an adjacency matrix to obtain a traffic flow transfer feature vector. Feature extraction is performed on the traffic flow transfer feature vector to obtain traffic flow features. Traffic flow prediction is performed based on the traffic flow features to obtain a prediction result. Based on the traffic flow of the target traffic area at the moment to be predicted in the prediction result, the traffic flow corresponding to the area to be predicted at the moment to be predicted is determined. Since the embodiment of the present invention performs traffic flow prediction according to traffic flow transfer information, the accuracy of the traffic flow prediction result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic information processing, and particularly relates to a traffic flow prediction method, device, electronic device, and storage medium. Background Art

[0002] With the rapid development of the current economy and technology, people are paying more and more attention to the development of smart cities, intelligent transportation, etc. Among them, traffic flow is an information that cannot be ignored and plays a very important role in many fields such as traffic management, urban development planning, and urban governance.

[0003] Currently, the main method adopted in predicting traffic flow is to perform traffic flow prediction based on historical traffic flow information through a graph convolutional neural network model. However, adopting this solution requires technicians to pre-define a graph structure according to prior knowledge for graph convolutional operations, and the pre-defined graph cannot contain the information about spatial correlation in traffic flow information and cannot be directly related to the current traffic flow prediction task, which will lead to deviation in the prediction result. Summary of the Invention

[0004] Embodiments of the present invention provide a traffic flow prediction method, device, electronic device, and storage medium, which can accurately extract the traffic flow transfer information between traffic regions contained in the historical traffic flow matrix through the graph convolutional calculation process, and improve the accuracy of the traffic flow prediction result.

[0005] Embodiments of the present invention provide a traffic flow prediction method, including:

[0006] According to the region to be predicted and the moment to be predicted, obtain a historical traffic flow matrix, where the historical traffic flow matrix includes sub-vectors of multiple traffic regions, and each sub-vector includes the traffic flow transfer information between the corresponding traffic region and other traffic regions among the multiple traffic regions, and the multiple traffic regions include the target traffic region where the region to be predicted is located;

[0007] Extract the transfer characteristics between the traffic flow of each traffic region and other traffic regions based on the historical traffic flow matrix through an adjacency matrix to obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features;

[0008] Perform traffic flow prediction based on the traffic flow features to obtain a prediction result;

[0009] Based on the traffic flow of the target traffic region at the moment to be predicted in the prediction result, determine the traffic flow corresponding to the region to be predicted at the moment to be predicted.

[0010] Correspondingly, an embodiment of the present invention further provides a traffic flow prediction device, including:

[0011] A matrix acquisition module, configured to obtain a historical traffic flow matrix according to a to-be-predicted area and a to-be-predicted moment. The historical traffic flow matrix includes sub-vectors of multiple traffic areas, and each sub-vector includes traffic flow transfer information between a corresponding traffic area and other traffic areas among the multiple traffic areas. The multiple traffic areas include a target traffic area where the to-be-predicted area is located;

[0012] A feature extraction module, configured to extract transfer features between the traffic flow of each traffic area and other traffic areas based on the historical traffic flow matrix through an adjacency matrix, obtain a flow transfer feature vector, and perform feature extraction on the flow transfer feature vector to obtain traffic flow features;

[0013] A traffic flow prediction module, configured to perform traffic flow prediction based on the traffic flow features to obtain a prediction result;

[0014] A traffic flow determination module, configured to determine the traffic flow corresponding to the to-be-predicted area at the to-be-predicted moment based on the traffic flow of the target traffic area at the to-be-predicted moment in the prediction result.

[0015] Optionally, the feature extraction module is configured to extract transfer features between the traffic flow of each traffic area and other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit, obtain a flow transfer feature vector, and perform feature extraction on the flow transfer feature vector to obtain traffic flow features. If the current graph convolutional unit is the first graph convolutional unit, the traffic flow features output by the previous graph convolutional unit are empty;

[0016] Taking the next graph convolutional unit of the current graph convolutional unit as the new current graph convolutional unit, and returning to execute the step of extracting transfer features between the traffic flow of each traffic area and other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit, obtaining a flow transfer feature vector, and performing feature extraction on the flow transfer feature vector to obtain traffic flow features until the traffic flow features are output by the last graph convolutional unit.

[0017] Optionally, in the traffic flow prediction device provided by the embodiment of the present invention, the graph convolutional unit includes a first feature extraction unit, a second feature extraction unit, a third feature extraction unit, and a feature fusion unit;

[0018] Correspondingly, the feature extraction module is used to extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the first feature extraction unit in the current graph convolutional unit, obtain the first traffic flow transfer feature vector, and perform first feature extraction processing on the first traffic flow transfer feature vector to obtain the first traffic flow feature;

[0019] Extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the second feature extraction unit in the current graph convolutional unit, obtain the second traffic flow transfer feature vector, and perform second feature extraction processing on the second traffic flow transfer feature vector to obtain the second traffic flow feature;

[0020] Multiply the second traffic flow feature and the traffic flow features output by the previous graph convolutional unit through the third feature extraction unit in the current graph convolutional unit to obtain a first product vector;

[0021] Extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrix and the first product vector through the adjacency matrix of the third feature extraction unit, obtain the third traffic flow transfer feature vector, and perform third feature extraction processing on the third traffic flow transfer feature vector to obtain the third traffic flow feature;

[0022] Through the feature fusion unit, calculate the second product vector of the first traffic flow feature and the traffic flow features output by the previous graph convolutional unit, and the third product vector of the target matrix corresponding to the first traffic flow feature and the third traffic flow feature, calculate the sum of the second product vector and the third product vector, and obtain the traffic flow features output by the current graph convolutional unit, where the target matrix is obtained by subtracting the first traffic flow feature from the identity matrix.

[0023] Optionally, the number of the historical traffic flow matrices is at least two, the traffic areas corresponding to each historical traffic flow matrix are the same, and the traffic monitoring time regions are different;

[0024] The feature extraction module is used to extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on each historical traffic flow matrix through the adjacency matrix, obtain the traffic flow transfer feature vectors corresponding to each historical traffic flow matrix, and perform feature extraction on each traffic flow transfer feature vector to obtain the traffic flow features corresponding to each historical traffic flow matrix.

[0025] Optionally, the traffic flow prediction module is configured to perform feature fusion on traffic flow characteristics corresponding to each of the historical traffic flow matrices to obtain fused traffic flow characteristics;

[0026] Based on the fused traffic flow characteristics, perform traffic flow prediction to obtain a prediction result.

[0027] Optionally, the traffic flow prediction module is configured to perform traffic flow prediction based on the traffic flow characteristics to obtain a prediction result for each traffic area among the multiple traffic areas;

[0028] Correspondingly, the traffic flow determination module is configured to obtain the traffic flow of the target traffic area at the to-be-predicted moment based on the prediction results of each traffic area among the multiple traffic areas, and determine the traffic flow corresponding to the to-be-predicted area at the to-be-predicted moment.

[0029] Optionally, the matrix acquisition module is configured to determine at least two traffic flow monitoring time regions before the to-be-predicted moment according to the to-be-predicted moment for which traffic flow needs to be predicted;

[0030] Divide each traffic flow monitoring time region into multiple time slices based on a preset time interval;

[0031] According to the to-be-predicted area for which traffic flow needs to be predicted, determine the target traffic area where the to-be-predicted area is located and the reference traffic area corresponding to the target traffic area as the monitoring traffic areas;

[0032] For each monitoring traffic area, obtain the traffic flow transfer information between the monitoring traffic area and other monitoring traffic areas in each of the time slices;

[0033] For each traffic flow monitoring time region, based on the traffic flow transfer information between each monitoring traffic area and other monitoring traffic areas in the time slices of the traffic flow monitoring time region, obtain the sub-vectors of each traffic area in the traffic flow monitoring time region;

[0034] Based on the sub-vectors corresponding to each of the traffic flow monitoring time regions, obtain the historical traffic flow matrices corresponding to each of the traffic flow monitoring time regions.

[0035] Optionally, the traffic flow prediction module includes a non-linear mapping module and a traffic flow prediction sub-module;

[0036] The non-linear mapping module is configured to perform non-linear mapping on the traffic flow characteristics to obtain a mapped feature vector;

[0037] The traffic flow prediction sub-module is configured to perform traffic flow prediction according to the mapped feature vector to obtain a prediction result.

[0038] Optionally, the non-linear mapping module is configured to perform a first convolution operation on the traffic flow characteristics to obtain a first convolution vector;

[0039] According to a preset activation function, perform feature mapping on the first convolution vector to obtain a non-linear convolution vector;

[0040] Perform a second convolution operation on the non-linear convolution vector to obtain a mapped feature vector.

[0041] Optionally, before the matrix acquisition module, there is further a model training module, and the model training module includes a sample acquisition module, a sample feature extraction module, a sample prediction module, and a model adjustment module;

[0042] The sample acquisition module is configured to acquire a traffic flow matrix sample, and the traffic flow matrix sample is labeled with the actual traffic flow corresponding to the sample prediction time and the sample traffic area. The traffic flow matrix sample includes sub-vectors of multiple sample traffic areas, and each sub-vector includes the traffic flow transfer information between the corresponding sample traffic area and other sample traffic areas in the multiple sample traffic areas before the sample prediction time;

[0043] The sample feature extraction module is configured to, through the adjacency matrix of the graph convolution unit in the traffic flow prediction model to be trained, extract the transfer characteristics between the traffic flows of each sample traffic area and other sample traffic areas based on the traffic flow matrix sample, obtain a sample flow transfer feature vector, and perform feature extraction on the sample flow transfer feature vector to obtain sample traffic flow characteristics;

[0044] The sample prediction module is configured to, based on the traffic flow prediction unit of the traffic flow prediction model to be trained, perform traffic flow prediction based on the sample traffic flow characteristics to obtain the sample prediction results of each sample traffic area;

[0045] The model adjustment module is configured to adjust the parameters of each unit in the traffic flow prediction model to be trained according to the sample prediction results of each sample traffic area and the corresponding actual traffic flow, and obtain a trained traffic flow prediction model.

[0046] Optionally, in the traffic flow prediction model of the embodiments of the present invention, there are at least two traffic flow prediction units, and each traffic flow prediction unit is configured to predict a traffic flow of a target type;

[0047] Correspondingly, the sample prediction module is configured to respectively perform traffic flow prediction on the sample traffic flow characteristics through each traffic flow prediction unit to obtain the sample prediction results of each sample traffic area under each target type;

[0048] The model adjustment module is used to calculate the type prediction loss corresponding to each target type according to the sample prediction results and the corresponding actual traffic flows of the sample traffic regions under the target type.

[0049] Calculate the sample prediction loss of the traffic flow prediction model to be trained according to the type prediction losses corresponding to the target types.

[0050] Adjust the parameters of each unit in the traffic flow prediction model to be trained according to the sample prediction loss, and obtain the trained traffic flow prediction model.

[0051] Correspondingly, an embodiment of the present invention further provides an electronic device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in any one of the traffic flow prediction methods provided by the embodiments of the present invention.

[0052] In addition, an embodiment of the present invention further provides a storage medium, which stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any one of the traffic flow prediction methods provided by the embodiments of the present invention.

[0053] By adopting the solution of the embodiment of the present invention, a historical traffic flow matrix can be obtained according to the area to be predicted and the moment to be predicted. The historical traffic flow matrix includes sub-vectors of multiple traffic regions. Each sub-vector includes the traffic flow transfer information between the corresponding traffic region and other traffic regions in the multiple traffic regions. The multiple traffic regions include the target traffic region where the area to be predicted is located. Based on the historical traffic flow matrix, the transfer characteristics between the traffic flows of each traffic region and other traffic regions are extracted through an adjacency matrix to obtain a traffic flow transfer feature vector. Feature extraction is performed on the traffic flow transfer feature vector to obtain traffic flow features. Traffic flow prediction is performed based on the traffic flow features to obtain a prediction result. Based on the traffic flow of the target traffic region at the moment to be predicted in the prediction result, the traffic flow corresponding to the area to be predicted at the moment to be predicted is determined. Since the embodiment of the present invention extracts the traffic flow transfer information between traffic regions in the historical traffic flow matrix through an adjacency matrix, and then performs traffic flow prediction according to the traffic flow transfer information with spatial correlation, the accuracy of the traffic flow prediction result is improved. Description of the Drawings

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained without creative efforts based on these drawings.

[0055] Figure 1 It is a schematic diagram of the scenario of the traffic flow prediction method provided by an embodiment of the present invention;

[0056] Figure 2 It is a flowchart of the traffic flow prediction method provided by an embodiment of the present invention;

[0057] Figure 3 It is a schematic diagram of the graph convolutional unit including a first feature extraction unit, a second feature extraction unit, a third feature extraction unit, and a feature fusion unit provided by an embodiment of the present invention;

[0058] Figure 4 It is a schematic diagram of the loop calculation process of the graph convolutional unit provided by an embodiment of the present invention;

[0059] Figure 5 It is a schematic diagram of the traffic flow prediction model including three prediction tasks of predicting OD traffic volume, regional inflow, and regional outflow provided by an embodiment of the present invention;

[0060] Figure 6 It is a schematic diagram of the training process of the traffic flow prediction model provided by an embodiment of the present invention;

[0061] Figure 7 It is another flowchart of the traffic flow prediction method provided by an embodiment of the present invention;

[0062] Figure 8 It is a schematic diagram of the structure of the traffic flow prediction device provided by an embodiment of the present invention;

[0063] Figure 9 It is another schematic diagram of the structure of the traffic flow prediction device provided by an embodiment of the present invention;

[0064] Figure 10 It is a schematic diagram of the structure of the electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0065] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.

[0066] An embodiment of the present invention provides a traffic flow prediction method, device, electronic device, and storage medium. Specifically, an embodiment of the present invention provides a traffic flow prediction method applicable to a traffic flow prediction device, and the traffic flow prediction device can be integrated in an electronic device.

[0067] The electronic device can be a device such as a terminal, including but not limited to mobile terminals and fixed terminals. For example, mobile terminals include but are not limited to smart phones, smart watches, tablet computers, laptop computers, smart vehicles, in-vehicle intelligence, etc. Among them, fixed terminals include but are not limited to desktop computers, smart TVs, etc.

[0068] The electronic device can also be a device such as a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms, but is not limited thereto.

[0069] The traffic flow prediction method according to the embodiments of the present invention can be implemented by a server, or jointly implemented by a terminal and a server.

[0070] Taking the joint implementation of the traffic flow prediction method by a terminal and a server as an example, the method will be described below.

[0071] As Figure 1 shown, the traffic flow prediction system provided by the embodiments of the present invention includes a terminal 10, a server 20, etc.; the terminal 10 is connected to the server 20 through a network, for example, through a wired or wireless network connection, etc. Among them, the terminal 10 can exist as a terminal for a user to send a traffic flow prediction request to the server 20.

[0072] Among them, the terminal 10 can be a terminal for a user to select a moment to be predicted and an area to be predicted, and is used to send user data including the moment to be predicted and the area to be predicted for which the traffic flow needs to be predicted to the server 20.

[0073] The server 20 can be used to obtain a historical traffic flow matrix according to the area to be predicted and the moment to be predicted. The historical traffic flow matrix includes sub-vectors of multiple traffic areas. Each sub-vector includes traffic flow transfer information between the corresponding traffic area and other traffic areas among the multiple traffic areas. The multiple traffic areas include the target traffic area where the area to be predicted is located. Based on the historical traffic flow matrix through an adjacency matrix, the transfer characteristics between the traffic flow of each traffic area and other traffic areas are extracted to obtain a traffic flow transfer feature vector. Feature extraction is performed on the traffic flow transfer feature vector to obtain traffic flow features. Traffic flow prediction is performed based on the traffic flow features to obtain a prediction result. Based on the traffic flow of the target traffic area at the moment to be predicted in the prediction result, the traffic flow corresponding to the area to be predicted at the moment to be predicted is determined.

[0074] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.

[0075] Embodiments of the present invention will be described from the perspective of a traffic flow prediction device, which can be specifically integrated in a server or a terminal.

[0076] As Figure 2 shown, the specific process of the traffic flow prediction method in this embodiment can be as follows:

[0077] 201. According to the area to be predicted and the time to be predicted, obtain a historical traffic flow matrix, where the historical traffic flow matrix includes sub-vectors of multiple traffic areas, and each sub-vector includes traffic flow transfer information between the corresponding traffic area and other traffic areas in the multiple traffic areas. The multiple traffic areas include the target traffic area where the area to be predicted is located.

[0078] As the traffic flow prediction method disclosed in this application, data such as the historical traffic flow matrix and traffic flow matrix samples can be stored on the blockchain.

[0079] Among them, traffic flow, also known as traffic volume or O (origin, the starting point of travel) D (destination, the destination of travel) traffic volume. OD traffic volume refers to the traffic flow between the origin and destination areas, that is, the traffic flow from the origin area to the destination area within a certain period of time. Here, the traffic flow can specifically include pedestrian flow, vehicle flow, mobile device flow, etc. This application does not make any limitations on the specific object corresponding to the OD flow.

[0080] Correspondingly, the historical traffic flow matrix can be a traffic flow matrix generated according to the historical traffic flow matrix within a certain period or several periods of historical time. For example, the historical traffic flow matrix can be a matrix generated according to the traffic flow data of a certain area within the past seven days, or the historical traffic flow matrix can be a matrix generated according to the traffic flow data of a certain or some traffic areas within the past 24 hours and the past 48 - 72 hours, etc.

[0081] Among them, the area to be predicted can directly be the target traffic area, or the area to be predicted can be a part of the target traffic area. Embodiments of the present invention do not make any limitations on this.

[0082] It can be understood that the historical time can be the time before the current moment, or the time before the time to be predicted, etc. For example, during the test, technicians can select a historical moment as the time to be predicted for prediction.

[0083] For example, the traffic flow matrix (historical traffic flow matrix) at a certain moment or within a certain time period can be represented by X ∈ R N×N where X represents the historical traffic flow matrix, N represents the total number of the target traffic area and other traffic areas, and R indicates that the values in X are all real numbers.

[0084] For instance, the historical traffic flow matrix can be a 5*5 matrix, which may include the traffic flow transfer information among 5 traffic areas. For example, the i-th row in the matrix can represent the traffic flow transfer information between the i-th community and the other 4 communities. For example, calculating the data in the i-th row can obtain the out-flow of the i-th community, and calculating the data in the i-th column can obtain the in-flow of the i-th community, and so on. It should be understood that the above examples should not be construed as a limitation on the form of the historical traffic flow matrix in the embodiments of the present invention.

[0085] For another example, the historical traffic flow matrix can also be n n*n sub-vectors. It can be set that the first row in each sub-vector represents the out-flow from the corresponding traffic area to the other n-1 traffic areas, and the first column represents the in-flow from the corresponding traffic area to the other n-1 traffic areas. For example, the data in the first row and the first column can represent the OD traffic volume of the corresponding traffic area, the data in the first row and the second column represents the out-flow from the corresponding traffic area to the traffic area ranked second in the arrangement order, and the data in the second row and the first column represents the in-flow from the corresponding traffic area to the traffic area ranked second in the arrangement order, and so on.

[0086] Among them, the arrangement order of the data in the historical traffic flow matrix or sub-vector can be arranged according to the custom numbering order of the traffic areas, or it can also be arranged according to the distance between the traffic area corresponding to each sub-vector and other traffic areas, and so on.

[0087] Among them, the in-out flow includes the traffic flow flowing out of a certain area and the traffic flow flowing into this area within a certain time period. The traffic flow here can specifically include the pedestrian flow, vehicle flow, mobile device flow, etc. The present application does not make any limitation on the specific object corresponding to the in-out flow.

[0088] In the actual application process, there is a specific correlation between the in-out flow and the OD traffic volume. Specifically, the sum of the OD traffic volumes flowing from a certain starting area to each ending area should be equal to the out-flow of this starting area, and the sum of the OD traffic volumes flowing from each starting area to a certain ending area should be equal to the in-flow of this ending area; the prediction of the in-out flow and the prediction of the OD traffic volume should essentially be an organically integrated whole.

[0089] It can be understood that, in order to save computing resources, if traffic flow data in multiple moments or time periods are selected as the historical traffic flow matrix to jointly participate in traffic flow prediction, at this time, the historical traffic flow matrix can be represented by X ∈ R B ×N×N where B represents the number of groups of traffic flow data.

[0090] Among them, the traffic area can be, but is not limited to, an area enclosed by roads of a certain level. Specifically, it can be a traffic zone in the field of traffic planning and management, and is often used as a basic spatial unit for research and analysis in the fields of traffic management, urban planning, urban governance, etc. Or, the traffic area can also be an area customarily divided by technicians. For example, a square area with a length of 5 kilometers and a width of 5 kilometers can be used as a traffic area. There are various ways to divide the traffic area, and the present invention does not limit this. Technicians can divide it according to actual application requirements.

[0091] In an optional example, the historical traffic flow matrix should correspond to the moment to be predicted and the area to be predicted at the same time. Specifically, the step of "obtaining the historical traffic flow matrix according to the area to be predicted and the moment to be predicted" may include:

[0092] Determine the reference moment corresponding to the moment to be predicted according to the moment to be predicted for which traffic flow needs to be predicted;

[0093] Determine the target traffic area where the area to be predicted is located according to the area to be predicted for which traffic flow needs to be predicted;

[0094] Select the reference traffic area corresponding to the target traffic area based on the preset reference area selection rule;

[0095] Obtain the traffic flow data corresponding to the target traffic area and the reference traffic area at the reference moment as the historical traffic flow matrix.

[0096] Among them, the reference moment can be a moment before the current moment, or a moment before the moment to be predicted, etc. The reference moment can be one or multiple. For example, if the user selects to predict the traffic flow at 16:00 on the afternoon of June 10th on the terminal, the reference moments can be 15:00 on the afternoon of June 10th, 16:00 on the afternoon of June 9th, and 16:00 on the afternoon of June 3rd, etc.

[0097] It can be understood that the historical traffic flow matrix can directly be the traffic flow data of the target traffic area and the reference traffic area at the reference moment. Or, the corresponding reference time can be determined according to the reference moment, and then the historical traffic flow matrix can be the traffic flow data of the target traffic area and the reference traffic area at the reference time. For example, when the reference moments are 15:00 pm on June 10th, 16:00 pm on June 9th, and 16:00 pm on June 3rd, the reference times are 15:00 - 15:30 pm on June 10th, 15:00 - 15:30 pm on June 9th, and 15:00 - 15:30 pm on June 3rd, and so on. The specific rule for determining the reference time can be determined by the technical personnel according to the actual application.

[0098] In the actual application process, the technical personnel can also define a time slice (timeslot), and the time slice is the smallest time interval. For example, the time length of a time slice can be 30 minutes later or 1 hour, and so on. After the traffic flow monitoring time area, the technical personnel can obtain the traffic flow data within n time slices corresponding to the traffic flow monitoring time area by themselves, and generate the historical traffic flow matrix. That is, the step "According to the area to be predicted and the moment to be predicted, obtain the historical traffic flow matrix, and the historical traffic flow matrix includes sub-vectors of multiple traffic areas" can include:

[0099] According to the moment to be predicted for which the traffic flow needs to be predicted, determine at least two traffic flow monitoring time areas before the moment to be predicted;

[0100] Divide each traffic flow monitoring time area into multiple time slices based on a preset time interval;

[0101] According to the area to be predicted for which the traffic flow needs to be predicted, determine the target traffic area where the area to be predicted is located and the reference traffic area corresponding to the target traffic area as the monitoring traffic area;

[0102] For each monitoring traffic area, obtain the traffic flow transfer information between the monitoring traffic area and other monitoring traffic areas in each time slice;

[0103] For each traffic flow monitoring time area, based on the traffic flow transfer information between each monitoring traffic area and other monitoring traffic areas in the time slices of the traffic flow monitoring time area, obtain the sub-vector of each traffic area in the traffic flow monitoring time area;

[0104] Based on the sub-vectors corresponding to each traffic flow monitoring time area, obtain the historical traffic flow matrix corresponding to each traffic flow monitoring time area.

[0105] Among them, different traffic flow monitoring time areas should be non-overlapping time periods. Correspondingly, the times corresponding to the time slices should also be non-overlapping time periods.

[0106] For example, if the time to be predicted is 17:00 tomorrow afternoon, the traffic flow monitoring time range can be from 16:00 to 17:00 this afternoon and from 16:00 to 17:00 yesterday afternoon, and so on.

[0107] Among them, the reference traffic area can be a traffic area with traffic flow transfer to or from the target traffic area, or it can also be a traffic area within a certain distance from the target traffic area, and so on. For example, the traffic area within 50 kilometers from the boundary of the target traffic area can be used as the reference traffic area.

[0108] In the process of predicting traffic flow in the embodiments of the present invention, artificial intelligence (AI) technology is involved. Artificial intelligence technology uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, and is a theory, method, technology, and application system that can perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning, and decision-making.

[0109] Artificial intelligence technology is an interdisciplinary subject with a wide range of fields, including both hardware-level and software-level technologies. The basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The artificial intelligence software technologies mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, autonomous driving technology, and machine learning / deep learning.

[0110] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in multiple fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless, autonomous driving, drones, robots, smart healthcare, smart customer service, etc.

[0111] For example, the traffic flow prediction method provided in the embodiments of the present invention can be applied to fields such as autonomous driving, virtual assistants, or driverless. Among them, autonomous driving technology usually includes technologies such as high-precision maps, environmental perception, behavior decision-making, path planning, and motion control, and has broad application prospects. For example, in the field of autonomous driving or driverless, the traffic flow prediction method provided in the embodiments of the present invention can be combined for path planning of intelligent vehicles. When the traffic flow of a certain section of the current planned path of the intelligent vehicle is greater than a preset threshold, the path is re-planned, and so on.

[0112] 202. Based on the historical traffic flow matrix through the adjacency matrix, extract the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas to obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features.

[0113] Among them, the adjacency matrix can be used to extract the connection relationship between each traffic area and other traffic areas. The connection relationship between each traffic area and other traffic areas can be understood as the connection relationship of whether each traffic area is adjacent to other traffic areas in terms of geographical location, or can also be understood as the traffic flow transfer relationship between each traffic area and other traffic areas.

[0114] Among them, the adjacency matrix can be obtained through the following calculation process:

[0115] softmax(I N +ReLU(E·E T ))

[0116] Among them, E is the adjacency relationship indication parameter, E T is the transpose of E, ReLU is the activation function, I N is the N-dimensional identity matrix, and softmax is the activation function, which can map the matrix to the interval (0, 1).

[0117] It can be understood that the adjacency relationship indication parameter can be represented by E∈R N×d indicating that E represents a randomly initialized embedding vector with a dimension of (N, d), which can be used to indicate the connection relationship between each traffic area and other traffic areas in the historical traffic flow matrix. Among them, d is the number of hidden vectors extracted from each traffic area. The value of d can be set by the developer himself, or d can be randomly set during training, and the best d with the best training effect is determined through the training process. The values in E can also be randomly generated and the best values are gradually determined through the training process.

[0118] Among them, the ReLU function represents the Rectified Linear Unit (ReLU), also known as the rectified linear unit, which is a commonly used activation function in artificial neural networks and usually refers to non-linear functions represented by the ramp function and its variants.

[0119] It can be understood that technicians can also choose other activation functions to perform the role of feature mapping, such as the softplus function, the Leaky ReLU function, and so on.

[0120] In some embodiments, the randomly initialized embedding vector E is learnable during the training process to capture the hidden dependencies between different sample historical traffic data during the training process and obtain the adjacency relationship of graph convolution. E·E T The weights of traffic regions (nodes) with connection relationships can be retained, and the ReLU function can set the weights of unconnected nodes (traffic regions without connection relationships) to zero through the mapping process.

[0121] Correspondingly, the traffic flow steering vector can be represented by softmax(I N +ReLU(E·E T ))X.

[0122] During the training process using the sample historical traffic flow matrix, softmax(I N +ReLU(E·E T )) can adaptively learn the correlation relationships between traffic regions in the sample historical traffic flow matrix according to the traffic flow prediction task, and then generate the most effective adjacency matrix.

[0123] Among them, the calculation method of the softmax function is as follows:

[0124]

[0125] Among them, i or j represents the i-th or j-th element in the matrix.

[0126] In an alternative example, the correlation relationships in space of each traffic region in the historical traffic flow matrix can be extracted through the adjacency matrix first, and then based on this correlation relationship and the data in the historical traffic flow matrix, the flow steering feature vector is calculated. That is, step 202 may include:

[0127] Extract the regional connection relationships of the historical traffic flow matrix through the adjacency matrix to obtain the regional connection relationships corresponding to the historical traffic flow matrix;

[0128] Generate the flow steering feature vector based on the regional connection relationships and the historical traffic flow matrix.

[0129] Specifically, the regional connection relationships can represent the connection relationships of whether each traffic region is adjacent to other traffic regions in terms of geographical location, or can also represent the traffic flow steering relationships between each traffic region and other traffic regions.

[0130] In the actual application process, the accuracy of the prediction result can be improved by means of loop calculation. That is, the step "extracting the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas based on the historical traffic flow matrix through the adjacency matrix to obtain a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow features" may include:

[0131] Based on the adjacency matrix of the current graph convolutional unit, the initial historical traffic flow matrix, and the traffic flow features output by the previous graph convolutional unit, extracting the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas to obtain a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow features. Wherein, if the current graph convolutional unit is the first graph convolutional unit, the traffic flow features output by the previous graph convolutional unit are empty.

[0132] Taking the next graph convolutional unit of the current graph convolutional unit as the new current graph convolutional unit, and returning to execute the step of extracting the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas based on the adjacency matrix of the current graph convolutional unit, the initial historical traffic flow matrix, and the traffic flow features output by the previous graph convolutional unit to obtain a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow features, until the traffic flow features are output by the last graph convolutional unit.

[0133] Wherein, the initial historical traffic flow matrix is the historical traffic flow matrix input during the first loop calculation (the first graph convolutional unit).

[0134] Wherein, the last graph convolutional unit can be the last graph convolutional unit in the connection relationship of the graph convolutional units, or can be the graph convolutional unit determined according to a preset loop end condition. For example, the loop end condition can be to end the loop when the gap between the traffic flow features obtained twice or n times in succession is less than a certain judgment value. Then the last graph convolutional unit is the nth in the loop unit where the gap between adjacent traffic flow features is less than a certain judgment value, and so on. Among them, the gap between traffic flow features can be obtained by calculating the similarity between vectors, etc.

[0135] In some alternative examples, in order to enhance interpretability, the graph convolutional unit may include a first feature extraction unit, a second feature extraction unit, a third feature extraction unit, and a feature fusion unit.

[0136] Correspondingly, the step of "extracting the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrix and the traffic flow characteristics output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit, obtaining a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow characteristics" may include:

[0137] Through the adjacency matrix of the first feature extraction unit in the current graph convolutional unit, based on the initial historical traffic flow matrix and the traffic flow characteristics output by the previous graph convolutional unit, extracting the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas, obtaining a first traffic flow transfer feature vector, and performing a first feature extraction process on the first traffic flow transfer feature vector to obtain a first traffic flow characteristic;

[0138] Through the adjacency matrix of the second feature extraction unit in the current graph convolutional unit, based on the initial historical traffic flow matrix and the traffic flow characteristics output by the previous graph convolutional unit, extracting the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas, obtaining a second traffic flow transfer feature vector, and performing a second feature extraction process on the second traffic flow transfer feature vector to obtain a second traffic flow characteristic;

[0139] Through the third feature extraction unit in the current graph convolutional unit, performing a dot product on the second traffic flow characteristic and the traffic flow characteristics output by the previous graph convolutional unit to obtain a first product vector;

[0140] Through the adjacency matrix of the third feature extraction unit, based on the initial historical traffic flow matrix and the first product vector, extracting the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas, obtaining a third traffic flow transfer feature vector, and performing a third feature extraction process on the third traffic flow transfer feature vector to obtain a third traffic flow characteristic;

[0141] Through the feature fusion unit, calculating a second product vector of the first traffic flow characteristic and the traffic flow characteristics output by the previous graph convolutional unit, and a third product vector of the target matrix corresponding to the first traffic flow characteristic and the third traffic flow characteristic, and calculating the sum of the second product vector and the third product vector to obtain the traffic flow characteristics output by the current graph convolutional unit, where the target matrix is obtained by performing a subtraction operation on the identity matrix and the first traffic flow characteristic.

[0142] Among them, the first feature extraction unit may be Figure 3 z in t or the calculation unit indicated by "the first feature extraction unit", the second feature extraction unit may be Figure 3 r in t or the calculation unit indicated by "the second feature extraction unit", the third feature extraction unit may be Figure 3 in or the computing unit indicated by the "third feature extraction unit", the feature fusion unit may be Figure 3 as in or the computing unit indicated by the "feature fusion unit".

[0143] In some other examples, as Figure 4 shown, the accuracy of the prediction result can also be improved by means of iterative calculation. Among them, the graph convolutional unit that outputs h t is used as the current graph convolutional unit, and h t-1 represents the traffic flow feature output by the previous graph convolutional unit among two connected graph convolutional units. For example, h t-2 is the traffic flow feature output by the previous graph convolutional unit before the graph convolutional unit that outputs h t-1 .

[0144] For example, taking the current graph convolutional unit that outputs h t as an example, the calculation method of each unit can be as follows:

[0145] Among them, the first traffic flow feature output by the first feature extraction unit The second traffic flow feature output by the second feature extraction unit r t determines which information in h t-1 that needs to be obtained from the previous graph convolutional unit should be discarded or retained. The information h t-1 from the previous graph convolutional unit and the information X :t input currently are both passed into the sigmoid function. The output value of r t is between 0 and 1. The closer it is to 0, the more it means it should be discarded, and the closer it is to 1, the more it means it should be retained; the third traffic flow feature output by the third feature extraction unit

[0146] Among them, is the adjacency matrix, [X :t , h t-1 represents the process of fusing the latest traffic flow feature vector with the initial historical traffic flow matrix.

[0147] In this example, σ represents the Sigmoid function, which can be used as the activation function of the neural network to map the variable to the interval (0, 1). Tanh represents the hyperbolic tangent function, which can be used as the activation function of neurons in the neural network in the field of deep learning. By adjusting the features through the tanh function, the feature effect can be continuously expanded during the iterative process

[0148] It can be understood that technicians can also choose other activation functions for calculation to achieve the function of feature extraction or feature adjustment.

[0149] Correspondingly, the finally output traffic flow feature can be obtained from z t The control needs to obtain h from the previous recurrent unit t-1 to determine how much information needs to be discarded from h and how much information of the third traffic flow feature in the current graph convolutional unit needs to be added. Finally, the traffic flow feature output by the feature fusion unit is obtained. Among them, ⊙ represents the Hadamard product, which means multiplying the elements at the corresponding positions.

[0150] It can be understood that fusing vectors through the Hadamard product is only an optional fusion method provided by the embodiments of the present invention. Technicians can also think of using methods such as vector multiplication and vector splicing to achieve the fusion between vectors. The embodiments of the present invention do not limit the specific fusion method.

[0151] In the embodiments of the present invention, a mode of providing a corresponding and unique parameter space for each traffic area for learning is adopted. Under such an idea, the dimension of the learnable parameters is (N, C, F). However, such a parameter space causes a heavy training burden for a traffic network with a large number of nodes. Therefore, the original (N, C, F)-dimensional parameter matrix is decomposed into the product form of a node embedding matrix (adjacency relationship indicating parameter) E and a weight pool matrix (feature transformation parameter) W.

[0152] For example, in the process of feature extraction of the traffic flow transfer feature vector, feature extraction can be performed based on the feature extraction parameter EW, where W is the feature transformation parameter. Specifically, W ∈ R d×C×F , C is the input dimension for feature extraction of the traffic flow transfer feature vector, and F is the output dimension after feature extraction of the traffic flow transfer feature vector. The values in W are preset or can be randomly generated and gradually determined to be the values with the best effect through the training process.

[0153] Correspondingly, EW z 、EW r and can be the first feature extraction parameter, the second feature extraction parameter, and the third feature extraction parameter corresponding to EW, respectively.

[0154] Among them, based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit, the transfer features between the traffic flow of each traffic area and that of other traffic areas can be extracted. It can be to directly splice, perform convolutional calculation, left matrix multiplication, or right matrix multiplication on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit, and then perform feature extraction after such feature fusion calculations. There are many specific feature fusion calculation methods, and the present invention does not limit this.

[0155] In the actual application process, for urban OD traffic volume prediction, a deep learning model or neural network needs to be able to synchronously capture the correlations in both time and space of the data. Traffic flow data often has complex periodic characteristics in time. The embodiments of the present invention can capture the different periodic properties of the historical traffic flow matrix in time by inputting the data of the same traffic area at different time stages.

[0156] Therefore, in the actual application process, the number of historical traffic flow matrices is at least two, the traffic areas corresponding to each historical traffic flow matrix are the same, and the traffic flow monitoring time regions are different;

[0157] Correspondingly, step 202 may include:

[0158] Based on the adjacency matrix, extract the transfer features between the traffic flow of each traffic area and that of other traffic areas from each historical traffic flow matrix, obtain the flow transfer feature vectors corresponding to each historical traffic flow matrix, and perform feature extraction on each flow transfer feature vector to obtain the traffic flow features corresponding to each historical traffic flow matrix.

[0159] Among them, the traffic flow monitoring time region may refer to the time when the traffic flow of each traffic area changes, or the time when the traffic flow data of each traffic area is successfully collected, and so on.

[0160] When obtaining the historical traffic flow matrix, it can be to generate the historical traffic flow matrix according to the traffic flow monitoring time region to obtain the corresponding traffic flow data.

[0161] For example, if a technician sets the traffic flow monitoring time region to obtain the traffic flow data within 5 time slices, the finally obtained traffic flow data can be 4 groups, which are respectively the traffic flow data within the 5 time slices closest to 15:00 on the afternoon of June 10th, 16:00 on the afternoon of June 9th, 16:00 on the afternoon of June 8th, and 16:00 on the afternoon of June 3rd, and so on.

[0162] For another example, in the actual application process, since the historical traffic flow matrix that is closest in natural time has a relatively high correlation with our target, the traffic flow data within the nearest n time slices to the moment to be predicted can be input to capture the temporal proximity; since the traffic flow at the moment to be predicted generally has a certain similarity in cycle with the traffic flow at the same time of the previous day or several days ago, therefore, the nearest n time slices 24 hours and 48 hours before the moment to be predicted can be input to capture the periodicity of the time series; in addition, in order to capture the possible long periodicity and suppress the possible data anomalies, the nearest n time slices 168 hours and 170 hours before the moment to be predicted can be input to capture the long periodicity of the time series.

[0163] 203. Perform traffic flow prediction based on traffic flow characteristics to obtain a prediction result.

[0164] It can be understood that when there are multiple historical traffic flow matrices, the historical traffic flow matrices with different times from the moment to be predicted have different influences on the prediction result. Therefore, the traffic flow characteristics corresponding to different historical traffic flow matrices can be fused by means of weighted summation, etc., so that the traffic flow characteristics can include the importance of different historical traffic flow matrices in different time periods. Step 203 includes:

[0165] Fuse the traffic flow characteristics corresponding to each of the historical traffic flow matrices to obtain the fused traffic flow characteristics;

[0166] Perform traffic flow prediction based on the fused traffic flow characteristics to obtain a prediction result.

[0167] Among them, the feature fusion method can be direct splicing, weighted calculation, etc. For example, the traffic flow characteristic Y can be calculated in the following way, Y = H h ⊙W h +H t ⊙W t +H ω ⊙W ω , where H h , H t and H ω are respectively the traffic flow characteristics corresponding to the historical traffic flow matrices in three different traffic flow monitoring time regions, and W h , W t and W ω are respectively the weight coefficients corresponding to the historical traffic flow matrices in three groups of traffic flow monitoring time regions.

[0168] In the actual application process, in order to obtain a better prediction effect, the traffic flow characteristics can be processed before prediction.

[0169] That is, step 203 may include:

[0170] Perform a non - linear mapping on the traffic flow characteristics to obtain a mapped feature vector;

[0171] Based on the mapped feature vector, perform traffic flow prediction to obtain a prediction result.

[0172] Among them, the specific process of non - linear mapping may include processes such as convolution processing and activation function mapping. Therefore, the step "Perform a non - linear mapping on the traffic flow characteristics to obtain a mapped feature vector" may include:

[0173] Perform a first convolution operation on the traffic flow characteristics to obtain a first convolution vector;

[0174] According to a preset activation function, perform feature mapping on the first convolution vector to obtain a non - linear convolution vector;

[0175] Perform a second convolution operation on the non - linear convolution vector to obtain a mapped feature vector.

[0176] Among them, the first convolution operation and the second convolution operation may perform convolution operations in the same way. For example, both perform convolution operations through the CONV2D network. Or, the first convolution operation and the second convolution operation may also perform convolution operations in different ways. For another example, the first convolution operation is performed through the CONV2D network, and the second convolution operation is performed through the CONV1D network, and so on.

[0177] For example, as Figure 5 shown, the CONV2D network can be used to perform convolution operations on the traffic flow characteristics and the non - linear convolution vector, and the preset activation function can be the ReLU function, and so on.

[0178] Specifically, traffic flow prediction based on the mapped feature vector can be performed using linear or non - linear classification methods such as SVM (linear kernel), Naive Bayes, KNN, decision tree, SVM (non - linear kernel), etc. for classification, and so on.

[0179] 204. Based on the traffic flow of the target traffic area at the to - be - predicted moment in the prediction result, determine the traffic flow corresponding to the to - be - predicted area at the to - be - predicted moment.

[0180] In some alternative examples, since the historical traffic flow matrix includes sub-vectors of multiple traffic regions, correspondingly, the traffic flow features obtained by extracting features based on the sub-vectors in each historical traffic flow matrix will also correspond to each traffic region. Therefore, during the prediction process, the traffic flow of each traffic region can be predicted first, and then the traffic flow corresponding to the region to be predicted can be determined. That is, the step "performing traffic flow prediction based on traffic flow features to obtain a prediction result" may include:

[0181] Performing traffic flow prediction based on traffic flow features to obtain a prediction result for each traffic region in multiple traffic regions;

[0182] Correspondingly, step 204 may include:

[0183] Based on the prediction results of each traffic region in multiple traffic regions, obtaining the traffic flow of the target traffic region at the moment to be predicted, and determining the traffic flow corresponding to the region to be predicted at the moment to be predicted.

[0184] Among them, the prediction result may be in the form of a vector or a matrix. For example, the prediction result may be an n*n-dimensional matrix. Then, the element in the i-th row and i-th column of the matrix may represent the traffic flow transfer information between the i-th cell and the other n-1 cells. For example, calculating the data in the i-th row can obtain the out-flow of the i-th cell, and calculating the data in the i-th column can obtain the in-flow of the i-th cell, and so on.

[0185] In some embodiments, specific rows and columns corresponding to the target traffic region may be set in the matrix. For example, setting the first row calculation can obtain the out-flow of the target traffic region, and setting the first column calculation can obtain the in-flow of the target traffic region, and so on. Correspondingly, other rows and columns can be set to correspond to other traffic regions, and so on.

[0186] Among them, the region to be predicted may directly be the target traffic region, or the region to be predicted may also be a part of the target traffic region, and so on. Specifically, when determining the traffic flow corresponding to the region to be predicted at the moment to be predicted, if the region to be predicted is the target traffic region, the traffic flow of the target traffic region at the moment to be predicted can be directly used as the traffic flow corresponding to the region to be predicted at the moment to be predicted. If the region to be predicted is a sub-region of the target traffic region, the target traffic region can be divided into sub-regions, and the traffic flow of each sub-region in the target traffic region can be calculated, and so on.

[0187] It can be understood that for the accuracy of traffic flow prediction, as Figure 6 shown, before actual application, the traffic flow model can be pre-trained. That is, before step 201, the embodiments of the present invention may further include:

[0188] Obtain a traffic flow matrix sample, where the traffic flow matrix sample is labeled with the sample prediction time and the actual traffic flow corresponding to the sample traffic area. The traffic flow matrix sample includes sub-vectors of multiple sample traffic areas, and each sub-vector includes the traffic flow transfer information between the corresponding sample traffic area and other sample traffic areas in the multiple sample traffic areas before the sample prediction time;

[0189] Based on the adjacency matrix of the graph convolutional unit in the traffic flow prediction model to be trained, extract the transfer characteristics between the traffic flows of each sample traffic area and other sample traffic areas from the traffic flow matrix sample, obtain the sample flow transfer feature vector, and perform feature extraction on the sample flow transfer feature vector to obtain the sample traffic flow feature;

[0190] Based on the traffic flow prediction unit of the traffic flow prediction model to be trained, perform traffic flow prediction based on the sample traffic flow feature to obtain the sample prediction results of each sample traffic area;

[0191] According to the sample prediction results of each sample traffic area and the corresponding actual traffic flow, adjust the parameters of each unit in the traffic flow prediction model to be trained to obtain the trained traffic flow prediction model.

[0192] Among them, each unit in the traffic flow prediction model includes but is not limited to the graph convolutional unit and the traffic flow prediction unit. When multiple groups of historical traffic flow matrices are input, a feature fusion unit can also be added to the traffic flow prediction model, and so on.

[0193] It can be understood that during the training process, the mutual constraints between different training tasks can be utilized to improve the performance of the traffic flow model, that is, there are at least two traffic flow prediction units, and each traffic flow prediction unit is used to predict a traffic flow of a target type;

[0194] Based on the traffic flow prediction unit of the traffic flow prediction model to be trained, perform traffic flow prediction based on the sample traffic flow feature to obtain the sample prediction results of each sample traffic area, including:

[0195] Perform traffic flow prediction on the sample traffic flow feature by each traffic flow prediction unit respectively to obtain the sample prediction results of each sample traffic area under each target type;

[0196] According to the sample prediction results of each sample traffic area and the corresponding actual traffic flow, adjust the parameters of each unit in the traffic flow prediction model to be trained to obtain the trained traffic flow prediction model, including:

[0197] For each target type, calculate the type prediction loss corresponding to the target type according to the sample prediction results of each sample traffic area under the target type and the corresponding actual traffic flow;

[0198] Calculate the sample prediction loss of the traffic prediction model to be trained according to the type prediction losses corresponding to each target type;

[0199] Adjust the parameters of each unit in the traffic prediction model to be trained according to the sample prediction loss to obtain the trained traffic prediction model.

[0200] Among them, the traffic flow of the target type includes, but is not limited to, OD traffic volume, regional inflow volume, regional outflow volume, and so on.

[0201] For example, as Figure 5 shown, traffic prediction units for predicting the traffic flow of three target types, namely OD traffic volume, regional inflow volume, and regional outflow volume, can be set simultaneously. Finally, after determining the loss of the traffic prediction model to be trained according to the prediction results of the three traffic prediction units, the parameters of each unit in the traffic prediction model to be trained are adjusted.

[0202] Correspondingly, the sample prediction loss of the traffic prediction model to be trained during the training process can be calculated in the following way:

[0203] Loss = Loss IN + Loss OUT + Loss OD

[0204] Among them, the loss of the task of predicting the regional inflow volume is The loss of the task of predicting the regional outflow volume is The loss of the task of predicting the OD traffic volume is

[0205] Among them, p i,t represents the predicted inflow volume of the i-th traffic region within the time slice t, represents the actual inflow volume corresponding to the i-th traffic region, q i,t , M t and are defined similarly to the aforementioned p i,t , and the present invention will not elaborate on this. G represents all traffic regions participating in the prediction, and g i represents the i-th traffic region among all traffic regions participating in the prediction. t represents the t-th group of traffic flow matrix samples, and the value of T is the number of all traffic flow matrix samples.

[0206] For example, adjusting the parameters of each unit in the traffic prediction model to be trained according to the sample prediction loss can be to adjust the relevant parameters of E and W in the graph convolution unit, and the weight coefficients W h and Wt and W ω make adjustments, as well as adjust the parameters in the traffic flow prediction unit, and so on.

[0207] In the actual application process, since there may be errors in the prediction results, therefore, the traffic flow of the adjacent or neighboring areas of the area to be predicted can also be predicted, and the prediction results of each traffic area (including the target traffic area) are integrated to determine the traffic flow of the area to be predicted. That is, after step 204, it may further include: determining a reference prediction area corresponding to the area to be predicted according to the area to be predicted;

[0208] According to the moment to be predicted and the reference prediction area, obtain the historical traffic flow matrix corresponding to the reference prediction area, perform the step of extracting the transfer characteristics between the traffic flow of each traffic area and other traffic areas based on the historical traffic flow matrix through the adjacency matrix to obtain the traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain the traffic flow characteristics until the traffic flow corresponding to the reference prediction area at the moment to be predicted is determined;

[0209] Based on the traffic flow corresponding to the reference prediction area and the traffic flow corresponding to the area to be predicted, calculate to determine the target traffic flow corresponding to the area to be predicted at the moment to be predicted.

[0210] Among them, calculating based on the traffic flow corresponding to the reference prediction area and the traffic flow corresponding to the area to be predicted may be to calculate the out-flow from the area to be predicted to each reference prediction area and the in-flow from each reference prediction area to the area to be predicted according to the traffic flow of each reference prediction area, and adjust the traffic flow corresponding to the area to be predicted according to the out-flow and in-flow to obtain the target traffic flow corresponding to the area to be predicted at the moment to be predicted.

[0211] Among them, the reference prediction area may be a traffic area adjacent to the target traffic area, or a traffic area at a certain distance from the target traffic area, and so on.

[0212] For example, after obtaining the traffic flow of the area to be predicted A, two reference prediction areas B and C can be determined. According to the out-flow from B and C to A respectively, and the in-flow received by B and C from A, calculate the reference traffic flow of A. If the reference traffic flow is different from the traffic flow corresponding to the area to be predicted obtained, then adjust the traffic flow corresponding to the area to be predicted to obtain the target traffic flow.

[0213] As can be seen from the above, embodiments of the present invention can obtain a historical traffic flow matrix according to a to-be-predicted area and a to-be-predicted time. The historical traffic flow matrix includes sub-vectors of multiple traffic areas. Each sub-vector includes traffic flow transfer information between a corresponding traffic area and other traffic areas among the multiple traffic areas. The multiple traffic areas include a target traffic area where the to-be-predicted area is located. By using an adjacency matrix, the transfer characteristics between the traffic flow of each traffic area and other traffic areas are extracted from the historical traffic flow matrix to obtain a traffic flow transfer feature vector. Feature extraction is performed on the traffic flow transfer feature vector to obtain traffic flow features. Traffic flow prediction is performed based on the traffic flow features to obtain a prediction result. Based on the traffic flow of the target traffic area at the to-be-predicted time in the prediction result, the traffic flow corresponding to the to-be-predicted area at the to-be-predicted time is determined. Since embodiments of the present invention extract the traffic flow transfer information between traffic areas in the historical traffic flow matrix through an adjacency matrix, and then perform traffic flow prediction based on the traffic flow transfer information with spatial correlation, the accuracy of the traffic flow prediction result is improved.

[0214] According to the method described in the previous embodiments, the following will give further detailed examples.

[0215] In embodiments of the present invention, it will be described in combination with Figure 1 the system.

[0216] As Figure 7 shown, the specific process of the traffic flow prediction method in this embodiment can be as follows:

[0217] 701. The terminal receives the to-be-predicted time and the to-be-predicted area submitted by the user, and sends the information including the to-be-predicted time and the to-be-predicted area to the server.

[0218] For example, the user can select a time as the to-be-predicted time on the page displayed on the terminal, or the user can also select a period of time for prediction.

[0219] The user can also manually input an address on the page displayed on the terminal to determine the to-be-predicted area, or the terminal can use the current location of the terminal as the to-be-predicted area, and so on.

[0220] When the user selects to submit the to-be-predicted time and the to-be-predicted area, the terminal can send the information including the to-be-predicted time and the to-be-predicted area to the server. The information can also include the identification code of the terminal and the user identification, etc. The present invention does not limit this.

[0221] 702. The server receives the information including the to-be-predicted time and the to-be-predicted area sent by the terminal, and obtains at least two groups of historical traffic flow matrices according to the to-be-predicted area and the to-be-predicted time.

[0222] Among them, each historical traffic flow matrix corresponds to the same traffic area, but different traffic monitoring time ranges.

[0223] It can be understood that the information including the moment to be predicted and the area to be predicted can directly extract the moment to be predicted and the area to be predicted, or the server can also parse the information and then obtain the moment to be predicted and the area to be predicted.

[0224] For example, a certain city can be divided into 6 areas, then the historical traffic flow matrix can be a 5*5 matrix. The first row can represent the traffic flow from area 1 to areas 2, 3, 4, 5, and 6. The first column represents the traffic flow from areas 2, 3, 4, 5, and 6 to area 1. Summing the matrix horizontally will obtain the out-flow of area 1, and summing vertically will obtain the in-flow of area 1, and so on.

[0225] 703. The server extracts the transfer characteristics between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrices and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit, obtains the flow transfer feature vectors corresponding to the historical traffic flow matrices, and performs feature extraction on the flow transfer feature vectors to obtain the traffic flow features corresponding to the historical traffic flow matrices.

[0226] Among them, if the current graph convolutional unit is the first graph convolutional unit, the traffic flow features output by the previous graph convolutional unit are empty.

[0227] Among them, the adjacency matrix is used to extract the connection relationship between each traffic area and other traffic areas in the historical traffic flow matrix.

[0228] Specifically, the adjacency matrix can be obtained through the following calculation process:

[0229] softmax(I N +ReLU(E·E T ))

[0230] Among them, E is the adjacency relationship indication parameter, E T is the transpose of E, ReLU is the activation function, I N is the N-dimensional identity matrix, and softmax is the activation function.

[0231] 704. The server takes the next graph convolutional unit of the current graph convolutional unit as the new current graph convolutional unit, and returns to step 703 until the traffic flow features are output by the last graph convolutional unit.

[0232] Among them, each graph convolutional unit can include a first feature extraction unit, a second feature extraction unit, a third feature extraction unit, and a feature fusion unit.

[0233] It can be understood that the last graph convolutional unit can be the last graph convolutional unit in the connection relationship of graph convolutional units, or a graph convolutional unit determined according to a preset loop end condition. For example, the loop end condition can be that the loop ends when the gap between the traffic flow features obtained 2 or n times in succession is less than a certain judgment value. Then, the last graph convolutional unit is the nth one in the loop unit where the gap between adjacent traffic flow features is less than a certain judgment value, and so on.

[0234] Among them, the graph convolutional unit that outputs h t is used as the current graph convolutional unit, and h t-1 represents the traffic flow feature output by the previous graph convolutional unit among two connected graph convolutional units. For example, h t-2 is the traffic flow feature output by the previous graph convolutional unit before the graph convolutional unit that outputs h t-1 .

[0235] For example, taking the current graph convolutional unit that outputs h t as an example, the calculation method of each unit can be as follows:

[0236] Among them, the first traffic flow feature output by the first feature extraction unit The second traffic flow feature output by the second feature extraction unit r t determines which information should be discarded or retained from the h t-1 to be obtained from the previous graph convolutional unit. The information h t-1 from the previous graph convolutional unit and the information X :t of the current input are simultaneously passed into the sigmoid function. The output value of r t is between 0 and 1. The closer it is to 0, the more it means it should be discarded, and the closer it is to 1, the more it means it should be retained; the third traffic flow feature output by the third feature extraction unit

[0237] Among them, is the adjacency matrix, [X :t ,h t-1 represents the process of fusing the latest traffic flow feature vector with the initial historical traffic flow matrix.

[0238] In this example, σ represents the Sigmoid function, which can be used as the activation function of the neural network to map the variable to the interval (0,1). Tanh represents the hyperbolic tangent function, which can be used as the activation function of neurons in the neural network in the field of deep learning. By adjusting the features through the tanh function, the feature effect can be continuously expanded during the loop process.

[0239] It is understandable that technicians can also choose other activation functions for calculation to achieve the function of feature extraction or feature adjustment.

[0240] Correspondingly, the finally output traffic flow feature can be obtained from z t Control how much information needs to be discarded from h obtained from the previous recurrent unit, and how much information of the third traffic flow feature in the current graph convolutional unit needs to be added t-1 Finally, the traffic flow feature output by the feature fusion unit is obtained where ⊙ represents the Hadamard product, indicating the multiplication of elements at corresponding positions. Among them, ⊙ represents the Hadamard product, which means multiplying the elements at the corresponding positions.

[0241] 705. The server performs feature fusion on the traffic flow features corresponding to each historical traffic flow matrix to obtain the fused traffic flow feature.

[0242] Among them, the method of feature fusion can be direct splicing, weighted calculation, etc. For example, the traffic flow feature vector Y can be calculated in the following way: Y = H h ⊙W h +H t ⊙W t +H ω ⊙W ω where H h 、H t and H ω are respectively the traffic flow feature sub-vectors corresponding to three different groups of historical traffic flow sub-data, and W h 、W t and W ω are respectively the weight coefficients corresponding to the three groups of traffic flow feature sub-vectors.

[0243] Through feature fusion, the traffic flow feature vector can represent the importance of different groups of historical traffic flow matrices in different time periods.

[0244] 706. The server performs non-linear mapping on the traffic flow feature to obtain the mapped feature vector, and performs traffic flow prediction based on the mapped feature vector to obtain the prediction result.

[0245] Among them, the specific process of non-linear mapping can include processes such as convolution processing and activation function mapping. Therefore, the step "performing non-linear mapping on the traffic flow feature to obtain the mapped feature vector" can include:

[0246] Performing a first convolution operation on the traffic flow feature to obtain a first convolution vector;

[0247] Perform feature mapping on the first convolutional vector according to a preset activation function to obtain a non-linear convolutional vector;

[0248] Perform a second convolutional operation on the non-linear convolutional vector to obtain a mapped feature vector.

[0249] For example, as Figure 5 shown, the non-linear calculation process can be to perform a convolutional operation on the traffic flow feature vector through a CONV2D network, map it through a preset activation function such as the ReLU function, and then perform a convolutional operation through the CONV2D network again.

[0250] 707. The server determines the traffic flow corresponding to the area to be predicted at the moment to be predicted based on the traffic flow in the target traffic area at the moment to be predicted in the prediction result.

[0251] Among them, the moment to be predicted can be the current moment, or a certain moment in the past or a certain moment in the future. The area to be predicted can directly be the target traffic area, or the area to be predicted can be a part of the target traffic area. The embodiments of the present invention do not make any limitations in this regard.

[0252] For example, when a user makes a car reservation through an online car-hailing service, the arrival time of the vehicle can be set at 8 o'clock the next day. At this time, 8 o'clock the next day can be used as the moment to be predicted, and the route area of the user can be used as the area to be predicted to provide the traffic flow situation of the route area at 8 o'clock the next day for the user.

[0253] In some optional examples, the prediction result can be in the form of a traffic flow matrix. Specific rows and columns corresponding to the target traffic area can be set in the traffic flow matrix. For example, setting the first row calculation can obtain the out-flow of the target traffic area, and setting the first column calculation can obtain the in-flow of the target traffic area, and so on.

[0254] After the server calculates the traffic flow corresponding to the area to be predicted at the moment to be predicted, the data can be sent to the terminal for display.

[0255] As can be seen from the above, the solution of the embodiments of the present invention can extract the traffic flow transfer information between traffic areas in the historical traffic flow matrix, and then perform traffic flow prediction according to the traffic flow transfer information with spatial correlation, improving the accuracy of the traffic flow prediction result.

[0256] To better implement the above method, correspondingly, the embodiments of the present invention also provide a traffic flow prediction device.

[0257] Referring to Figure 8 , the traffic flow prediction device may include:

[0258] The matrix acquisition module 801 can be used to obtain a historical traffic flow matrix according to the area to be predicted and the moment to be predicted. The historical traffic flow matrix may include sub-vectors of multiple traffic areas. Each sub-vector may include traffic flow transfer information between the corresponding traffic area and other traffic areas among the multiple traffic areas. The multiple traffic areas may include the target traffic area where the area to be predicted is located.

[0259] The feature extraction module 802 can be used to extract the transfer features between the traffic flow of each traffic area and other traffic areas based on the historical traffic flow matrix through the adjacency matrix, obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features.

[0260] The traffic flow prediction module 803 can be used to predict the traffic flow based on the traffic flow features to obtain a prediction result.

[0261] The traffic flow determination module 804 can be used to determine the traffic flow corresponding to the area to be predicted at the moment to be predicted based on the traffic flow of the target traffic area at the moment to be predicted in the prediction result.

[0262] Optionally, the feature extraction module 802 can be used to extract the transfer features between the traffic flow of each traffic area and other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit, obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features. If the current graph convolutional unit is the first graph convolutional unit, the traffic flow features output by the previous graph convolutional unit are empty.

[0263] Take the next graph convolutional unit after the current graph convolutional unit as the new current graph convolutional unit, and return to execute the step of extracting the transfer features between the traffic flow of each traffic area and other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit, obtaining a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow features until the traffic flow features are output by the last graph convolutional unit.

[0264] Optionally, in the traffic flow prediction device provided in the embodiment of the present invention, the graph convolutional unit may include a first feature extraction unit, a second feature extraction unit, a third feature extraction unit, and a feature fusion unit.

[0265] Correspondingly, the feature extraction module 802 can be used to extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the first feature extraction unit in the current graph convolutional unit, obtain the first traffic flow transfer feature vector, perform first feature extraction processing on the first traffic flow transfer feature vector to obtain the first traffic flow feature;

[0266] Extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the second feature extraction unit in the current graph convolutional unit, obtain the second traffic flow transfer feature vector, perform second feature extraction processing on the second traffic flow transfer feature vector to obtain the second traffic flow feature;

[0267] Multiply the second traffic flow feature and the traffic flow features output by the previous graph convolutional unit through the third feature extraction unit in the current graph convolutional unit to obtain the first product vector;

[0268] Extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on the initial historical traffic flow matrix and the first product vector through the adjacency matrix of the third feature extraction unit, obtain the third traffic flow transfer feature vector, perform third feature extraction processing on the third traffic flow transfer feature vector to obtain the third traffic flow feature;

[0269] Through the feature fusion unit, calculate the second product vector of the first traffic flow feature and the traffic flow features output by the previous graph convolutional unit, and the third product vector of the target matrix corresponding to the first traffic flow feature and the third traffic flow feature, calculate the sum of the second product vector and the third product vector to obtain the traffic flow features output by the current graph convolutional unit, where the target matrix is obtained by subtracting the first traffic flow feature from the identity matrix.

[0270] Optionally, the number of historical traffic flow matrices is at least two, the traffic areas corresponding to each historical traffic flow matrix are the same, and the traffic monitoring time regions are different;

[0271] The feature extraction module 802 can be used to extract the transfer features between the traffic flow of each traffic area and that of other traffic areas based on each historical traffic flow matrix through the adjacency matrix, obtain the traffic flow transfer feature vectors corresponding to each historical traffic flow matrix, and perform feature extraction on each traffic flow transfer feature vector to obtain the traffic flow features corresponding to each historical traffic flow matrix.

[0272] Optionally, the traffic flow prediction module 803 can be used to perform feature fusion on the traffic flow features corresponding to each historical traffic flow matrix to obtain the fused traffic flow features;

[0273] Based on the traffic flow characteristics after fusion, traffic flow prediction is carried out to obtain the prediction result.

[0274] Optionally, the traffic flow prediction module 803 can be used to perform traffic flow prediction based on traffic flow characteristics to obtain the prediction results for each traffic area among multiple traffic areas;

[0275] Correspondingly, the traffic flow determination module 804 can be used to obtain the traffic flow of the target traffic area at the moment to be predicted based on the prediction results of each traffic area among multiple traffic areas, and determine the traffic flow corresponding to the area to be predicted at the moment to be predicted.

[0276] Optionally, the matrix acquisition module 801 can be used to determine at least two traffic flow monitoring time regions before the moment to be predicted according to the moment to be predicted for which the traffic flow needs to be predicted;

[0277] Each traffic flow monitoring time region is divided into multiple time slices based on a preset time interval;

[0278] According to the area to be predicted for which the traffic flow needs to be predicted, determine the target traffic area where the area to be predicted is located and the reference traffic area corresponding to the target traffic area as the monitoring traffic area;

[0279] For each monitoring traffic area, obtain the traffic flow transfer information between the monitoring traffic area and other monitoring traffic areas in each time slice;

[0280] For each traffic flow monitoring time region, based on the traffic flow transfer information between each monitoring traffic area and other monitoring traffic areas in the time slices of the traffic flow monitoring time region, obtain the sub-vectors of each traffic area in the traffic flow monitoring time region;

[0281] Based on the sub-vectors corresponding to each traffic flow monitoring time region, obtain the historical traffic flow matrix corresponding to each traffic flow monitoring time region.

[0282] Optionally, the traffic flow prediction module 803 may include a non-linear mapping module and a traffic flow prediction sub-module;

[0283] The non-linear mapping module can be used to perform non-linear mapping on traffic flow characteristics to obtain the mapped feature vector;

[0284] The traffic flow prediction sub-module can be used to perform traffic flow prediction according to the mapped feature vector to obtain the prediction result.

[0285] Optionally, the non-linear mapping module can be used to perform a first convolution operation on traffic flow characteristics to obtain the first convolution vector;

[0286] Perform feature mapping on the first convolutional vector according to a preset activation function to obtain a non-linear convolutional vector;

[0287] Perform a second convolutional operation on the non-linear convolutional vector to obtain a mapped feature vector.

[0288] Optionally, as Figure 9 shown, before the matrix acquisition module 801, a model training module 805 may further be included. The model training module may include a sample acquisition module, a sample feature extraction module, a sample prediction module, and a model adjustment module;

[0289] The sample acquisition module can be used to acquire traffic flow matrix samples. The traffic flow matrix samples are labeled with the actual traffic flow corresponding to the sample prediction time and the sample traffic area. The traffic flow matrix samples may include sub-vectors of multiple sample traffic areas, and each sub-vector may include traffic flow transfer information between the corresponding sample traffic area and other sample traffic areas among multiple sample traffic areas before the sample prediction time;

[0290] The sample feature extraction module can be used to extract the transfer features between the traffic flows of each sample traffic area and other sample traffic areas based on the traffic flow matrix samples through the adjacency matrix of the graph convolutional unit in the traffic flow prediction model to be trained, obtain a sample traffic flow transfer feature vector, and perform feature extraction on the sample traffic flow transfer feature vector to obtain sample traffic flow features;

[0291] The sample prediction module can be used to perform traffic flow prediction based on the traffic flow prediction unit of the traffic flow prediction model to be trained and based on the sample traffic flow features, and obtain the sample prediction results of each sample traffic area;

[0292] The model adjustment module can be used to adjust the parameters of each unit in the traffic flow prediction model to be trained according to the sample prediction results of each sample traffic area and the corresponding actual traffic flow, and obtain a trained traffic flow prediction model.

[0293] Optionally, in the traffic flow prediction model of the embodiments of the present invention, there are at least two traffic flow prediction units, and each traffic flow prediction unit can be used to predict the traffic flow of a target type;

[0294] Correspondingly, the sample prediction module can be used to perform traffic flow prediction on the sample traffic flow features respectively through each traffic flow prediction unit, and obtain the sample prediction results of each sample traffic area under each target type;

[0295] The model adjustment module can be used to calculate the type prediction loss corresponding to each target type according to the sample prediction results of each sample traffic area under the target type and the corresponding actual traffic flow for each target type;

[0296] Calculate the sample prediction loss of the traffic prediction model to be trained according to the type prediction loss corresponding to each target type;

[0297] Adjust the parameters of each unit in the traffic prediction model to be trained according to the sample prediction loss, and obtain the trained traffic prediction model.

[0298] As can be seen from the above, through the traffic flow prediction device, the traffic flow transfer information between traffic regions in the historical traffic flow matrix can be extracted, and then the traffic flow can be predicted according to the traffic flow transfer information with spatial correlation, which improves the accuracy of the traffic flow prediction result.

[0299] In addition, an embodiment of the present invention further provides an electronic device, which may be a terminal or a server, etc. As Figure 10 shown, it shows a schematic structural diagram of the electronic device involved in the embodiment of the present invention. Specifically:

[0300] The electronic device may include a radio frequency (RF) circuit 1001, a memory 1002 including one or more computer-readable storage media, an input unit 1003, a display unit 1004, a sensor 1005, an audio circuit 1006, a wireless fidelity (WiFi) module 1007, a processor 1008 including one or more processing cores, and a power supply 1009 and other components. Those skilled in the art can understand that Figure 10 the structural diagram of the electronic device shown in does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or different component arrangements. Among them:

[0301] The RF circuit 1001 can be used for receiving and transmitting information or signals during a call. Specifically, after receiving the downlink information from the base station, it is handed over to one or more processors 1008 for processing. Additionally, data related to the uplink is sent to the base station. Generally, the RF circuit 1001 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. In addition, the RF circuit 1001 can also communicate with the network and other devices via wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0302] The memory 1002 can be used to store software programs and modules. The processor 1008 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, applications required for at least one function (such as a voice playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device (such as audio data, a phone book, etc.). In addition, the memory 1002 can include high-speed random access memory and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. Correspondingly, the memory 1002 can also include a memory controller to provide access to the memory 1002 for the processor 1008 and the input unit 1003.

[0303] The input unit 1003 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Specifically, in a specific embodiment, the input unit 1003 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display screen or a touchpad, can collect touch operations of a user thereon or nearby (such as operations of the user using any suitable object or accessory such as a finger or a stylus on or near the touch-sensitive surface), and drive corresponding connection devices according to a preset program. Optionally, the touch-sensitive surface may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1008, and can receive and execute commands sent by the processor 1008. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch-sensitive surface. In addition to the touch-sensitive surface, the input unit 1003 may further include other input devices. Specifically, the other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0304] The display unit 1004 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. The display unit 1004 may include a display panel. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface can cover the display panel. When the touch-sensitive surface detects a touch operation thereon or nearby, it is transmitted to the processor 1008 to determine the type of touch event. Subsequently, the processor 1008 provides a corresponding visual output on the display panel according to the type of touch event. Although in Figure 10 it, the touch-sensitive surface and the display panel are implemented as two independent components to achieve input and input functions, but in some embodiments, the touch-sensitive surface and the display panel can be integrated to achieve input and output functions.

[0305] The electronic device may further include at least one sensor 1005, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor can turn off the display panel and / or the backlight when the electronic device is moved to the ear. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used in applications for identifying the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors that the electronic device can also be configured with, they will not be elaborated here.

[0306] The audio circuit 1006, the speaker, and the microphone can provide an audio interface between the user and the electronic device. The audio circuit 1006 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1006 and then converted into audio data. After the audio data is output to the processor 1008 for processing, it is sent through the RF circuit 1001 to, for example, another electronic device, or the audio data is output to the memory 1002 for further processing. The audio circuit 1006 may also include an earphone jack to provide communication between the peripheral earphone and the electronic device.

[0307] WiFi belongs to short - range wireless transmission technology. The electronic device can help users send and receive emails, browse the web, and access streaming media through the WiFi module 1007, which provides users with wireless broadband Internet access. Although Figure 10 the WiFi module 1007 is shown, it can be understood that it does not belong to the essential components of the electronic device and can be omitted completely within the scope of not changing the essence of the invention according to needs.

[0308] The processor 1008 is the control center of the electronic device, connecting various parts of the entire mobile phone using various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 1002, and by calling the data stored in the memory 1002, it executes various functions of the electronic device and processes data, thereby performing an overall detection of the mobile phone. Optionally, the processor 1008 may include one or more processing cores; preferably, the processor 1008 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above - mentioned modem processor may not be integrated into the processor 1008 either.

[0309] The electronic device further includes a power supply 1009 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 1008 through a power management system, so as to manage functions such as charging, discharging, and power consumption management through the power management system. The power supply 1009 may further include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0310] Although not shown, the electronic device may further include a camera, a Bluetooth module, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 1008 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 1002 according to the following instructions, and the processor 1008 will run the application programs stored in the memory 1002 to implement various functions as follows:

[0311] According to the area to be predicted and the time to be predicted, obtain a historical traffic flow matrix, where the historical traffic flow matrix includes sub-vectors of multiple traffic areas, and each sub-vector includes traffic flow transfer information between the corresponding traffic area and other traffic areas in the multiple traffic areas. The multiple traffic areas include the target traffic area where the area to be predicted is located;

[0312] Extract the transfer characteristics between the traffic flow of each traffic area and other traffic areas based on the historical traffic flow matrix through an adjacency matrix to obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features;

[0313] Perform traffic flow prediction based on the traffic flow features to obtain a prediction result;

[0314] Based on the traffic flow of the target traffic area at the time to be predicted in the prediction result, determine the traffic flow corresponding to the area to be predicted at the time to be predicted.

[0315] Those of ordinary skill in the art can understand that all or part of the steps in the above-mentioned various methods of the embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0316] For this reason, an embodiment of the present invention provides a storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps in any traffic flow prediction method provided by the embodiment of the present invention. For example, the instructions can execute the following steps:

[0317] According to the area to be predicted and the moment to be predicted, a historical traffic flow matrix is obtained. The historical traffic flow matrix includes sub-vectors of multiple traffic areas, and each sub-vector includes the traffic flow transfer information between the corresponding traffic area and other traffic areas among the multiple traffic areas. The multiple traffic areas include the target traffic area where the area to be predicted is located;

[0318] Based on the historical traffic flow matrix, the transfer characteristics between the traffic flow of each traffic area and other traffic areas are extracted through the adjacency matrix to obtain a traffic flow transfer feature vector, and feature extraction is performed on the traffic flow transfer feature vector to obtain traffic flow features;

[0319] Traffic flow prediction is performed based on the traffic flow features to obtain a prediction result;

[0320] Based on the traffic flow of the target traffic area at the moment to be predicted in the prediction result, the traffic flow corresponding to the area to be predicted at the moment to be predicted is determined.

[0321] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.

[0322] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.

[0323] Since the instructions stored in the storage medium can execute the steps in any of the traffic flow prediction methods provided by the embodiments of the present invention, the beneficial effects achievable by any of the traffic flow prediction methods provided by the embodiments of the present invention can be realized. For details, reference may be made to the previous embodiments, which will not be elaborated here.

[0324] According to one aspect of the present application, a computer program product or a computer program is further provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in the various optional implementation manners in the above embodiments.

[0325] The above has introduced in detail a traffic flow prediction method, device, electronic device and storage medium provided by the embodiments of the present invention. Specific examples are used herein to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A traffic flow prediction method, characterized in that, Including: According to the area to be predicted and the moment to be predicted, obtain a historical traffic flow matrix, where the historical traffic flow matrix includes sub-vectors of multiple traffic areas, each sub-vector includes traffic flow transfer information between the corresponding traffic area and other traffic areas among the multiple traffic areas, and the multiple traffic areas include the target traffic area where the area to be predicted is located; Based on the historical traffic flow matrix through an adjacency matrix, extract the transfer characteristics between the traffic flow of each traffic area and other traffic areas to obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features, where the adjacency matrix is used to extract the connection relationship between each traffic area and other traffic areas; Based on the traffic flow features, perform traffic flow prediction to obtain a prediction result; Based on the traffic flow of the target traffic area at the moment to be predicted in the prediction result, determine the traffic flow corresponding to the area to be predicted at the moment to be predicted.

2. The traffic flow prediction method according to claim 1, wherein The step of extracting the transfer characteristics between the traffic flow of each traffic area and other traffic areas based on the historical traffic flow matrix through an adjacency matrix to obtain a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow features includes: Based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit, extract the transfer characteristics between the traffic flow of each traffic area and other traffic areas to obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features, where if the current graph convolutional unit is the first graph convolutional unit, the traffic flow features output by the previous graph convolutional unit are empty; Take the next graph convolutional unit of the current graph convolutional unit as the new current graph convolutional unit, and return to execute the step of extracting the transfer characteristics between the traffic flow of each traffic area and other traffic areas based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the current graph convolutional unit to obtain a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow features, until the traffic flow features are output by the last graph convolutional unit.

3. The traffic flow prediction method according to claim 2, wherein The graph convolutional unit includes a first feature extraction unit, a second feature extraction unit, a third feature extraction unit, and a feature fusion unit; The step of extracting the transfer characteristics between the traffic flow of each traffic area and other traffic areas based on the historical traffic flow matrix through an adjacency matrix to obtain a traffic flow transfer feature vector, and performing feature extraction on the traffic flow transfer feature vector to obtain traffic flow features includes: Based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the first feature extraction unit in the current graph convolutional unit, extract the transfer features between the traffic flow of each traffic area and that of other traffic areas to obtain the first traffic flow transfer feature vector, and perform first feature extraction processing on the first traffic flow transfer feature vector to obtain the first traffic flow feature; Based on the initial historical traffic flow matrix and the traffic flow features output by the previous graph convolutional unit through the adjacency matrix of the second feature extraction unit in the current graph convolutional unit, extract the transfer features between the traffic flow of each traffic area and that of other traffic areas to obtain the second traffic flow transfer feature vector, and perform second feature extraction processing on the second traffic flow transfer feature vector to obtain the second traffic flow feature; Through the third feature extraction unit in the current graph convolutional unit, perform a dot product on the second traffic flow feature and the traffic flow features output by the previous graph convolutional unit to obtain the first product vector; Based on the initial historical traffic flow matrix and the first product vector through the adjacency matrix of the third feature extraction unit, extract the transfer features between the traffic flow of each traffic area and that of other traffic areas to obtain the third traffic flow transfer feature vector, and perform third feature extraction processing on the third traffic flow transfer feature vector to obtain the third traffic flow feature; Through the feature fusion unit, calculate the second product vector of the first traffic flow feature and the traffic flow features output by the previous graph convolutional unit, and the third product vector of the target matrix corresponding to the first traffic flow feature and the third traffic flow feature, and calculate the sum of the second product vector and the third product vector to obtain the traffic flow features output by the current graph convolutional unit, where the target matrix is obtained by subtracting the first traffic flow feature from the identity matrix.

4. The traffic flow prediction method according to claim 1, wherein The number of the historical traffic flow matrices is at least two, the traffic areas corresponding to each historical traffic flow matrix are the same, and the traffic monitoring time regions are different; The method of extracting the transfer features between the traffic flow of each traffic area and that of other traffic areas based on the historical traffic flow matrix through the adjacency matrix to obtain the traffic flow transfer feature vector and performing feature extraction on the traffic flow transfer feature vector to obtain the traffic flow feature includes: Based on each historical traffic flow matrix through the adjacency matrix, extract the transfer features between the traffic flow of each traffic area and that of other traffic areas to obtain the traffic flow transfer feature vectors corresponding to each historical traffic flow matrix, and perform feature extraction on each traffic flow transfer feature vector to obtain the traffic flow features corresponding to each historical traffic flow matrix.

5. The traffic flow prediction method according to claim 4, characterized in that, The method of performing traffic flow prediction based on the traffic flow features to obtain the prediction result includes: Perform feature fusion on the traffic flow features corresponding to each historical traffic flow matrix to obtain the fused traffic flow features; Based on the fused traffic flow features, perform traffic flow prediction to obtain the prediction result.

6. The traffic flow prediction method according to claim 1, characterized in that The method of performing traffic flow prediction based on the traffic flow features to obtain the prediction result includes: Perform traffic flow prediction based on the traffic flow characteristics to obtain the prediction results for each traffic area among the multiple traffic areas; Determining the traffic flow corresponding to the to-be-predicted area at the to-be-predicted moment based on the traffic flow of the target traffic area at the to-be-predicted moment in the prediction results includes: Based on the prediction results of each traffic area among the multiple traffic areas, obtain the traffic flow of the target traffic area at the to-be-predicted moment, and determine the traffic flow corresponding to the to-be-predicted area at the to-be-predicted moment.

7. The traffic flow prediction method according to claim 4, wherein Before obtaining the historical traffic flow matrix according to the to-be-predicted area and the to-be-predicted moment, the historical traffic flow matrix includes sub-vectors of multiple traffic areas, including: According to the to-be-predicted moment for which the traffic flow needs to be predicted, determine at least two traffic flow monitoring time periods before the to-be-predicted moment; Divide each traffic flow monitoring time period into multiple time slices based on a preset time interval; According to the to-be-predicted area for which the traffic flow needs to be predicted, determine the target traffic area where the to-be-predicted area is located and the reference traffic area corresponding to the target traffic area as the monitored traffic areas; For each monitored traffic area, obtain the traffic flow transfer information between the monitored traffic area and other monitored traffic areas in each of the time slices; For each traffic flow monitoring time period, based on the traffic flow transfer information between each monitored traffic area and other monitored traffic areas in the time slices of the traffic flow monitoring time period, obtain the sub-vectors of each traffic area in the traffic flow monitoring time period; Based on the sub-vectors corresponding to each traffic flow monitoring time period, obtain the historical traffic flow matrix corresponding to each traffic flow monitoring time period.

8. The traffic flow prediction method according to any one of claims 1-4, characterized in that Performing traffic flow prediction based on the traffic flow characteristics to obtain prediction results includes: Perform a non-linear mapping on the traffic flow characteristics to obtain a mapped feature vector; Perform traffic flow prediction according to the mapped feature vector to obtain prediction results.

9. The traffic flow prediction method according to claim 8, wherein The performing a non-linear mapping on the traffic flow characteristics to obtain a mapped feature vector includes: Perform a first convolution operation on the traffic flow characteristics to obtain a first convolution vector; According to a preset activation function, perform feature mapping on the first convolution vector to obtain a non-linear convolution vector; Perform a second convolution operation on the non-linear convolution vector to obtain a mapped feature vector.

10. The traffic flow prediction method according to claim 1, wherein Before obtaining the historical traffic flow matrix according to the to-be-predicted area and the to-be-predicted moment, the traffic flow prediction method further includes: Obtain a traffic flow matrix sample, which is labeled with the sample prediction moment and the actual traffic flow corresponding to the sample traffic area. The traffic flow matrix sample includes sub-vectors of multiple sample traffic areas, and each sub-vector includes the traffic flow transfer information between the corresponding sample traffic area and other sample traffic areas among the multiple sample traffic areas before the sample prediction moment; Based on the adjacency matrix of the graph convolutional unit in the traffic prediction model to be trained, extract the transfer characteristics between the traffic flows of each sample traffic area and other sample traffic areas from the traffic flow matrix sample, obtain the sample traffic flow transfer feature vector, and perform feature extraction on the sample traffic flow transfer feature vector to obtain the sample traffic flow features; Based on the traffic flow prediction unit of the traffic prediction model to be trained, perform traffic flow prediction based on the sample traffic flow features to obtain the sample prediction results of each sample traffic area; According to the sample prediction results of each sample traffic area and the corresponding actual traffic flow, adjust the parameters of each unit in the traffic prediction model to be trained to obtain the trained traffic prediction model.

11. The traffic flow prediction method according to claim 10, characterized in that, There are at least two traffic flow prediction units, and each traffic flow prediction unit is used to predict the traffic flow of a target type; The traffic flow prediction unit based on the traffic prediction model to be trained performs traffic flow prediction based on the sample traffic flow features to obtain the sample prediction results of each sample traffic area, including: Perform traffic flow prediction on the sample traffic flow features by each traffic flow prediction unit respectively to obtain the sample prediction results of each sample traffic area under each target type; The step of adjusting the parameters of each unit in the traffic prediction model to be trained according to the sample prediction results of each sample traffic area and the corresponding actual traffic flow to obtain the trained traffic prediction model includes: For each target type, calculate the type prediction loss corresponding to the target type according to the sample prediction results of each sample traffic area under the target type and the corresponding actual traffic flow; Calculate the sample prediction loss of the traffic prediction model to be trained according to the type prediction losses corresponding to each target type; Adjust the parameters of each unit in the traffic prediction model to be trained according to the sample prediction loss to obtain the trained traffic prediction model.

12. A traffic flow prediction device, characterized in that, Including: A matrix acquisition module, configured to obtain a historical traffic flow matrix according to the area to be predicted and the moment to be predicted. The historical traffic flow matrix includes sub-vectors of multiple traffic areas, and each sub-vector includes the traffic flow transfer information between the corresponding traffic area and other traffic areas among the multiple traffic areas. The multiple traffic areas include the target traffic area where the area to be predicted is located; A feature extraction module, configured to extract the transfer characteristics between the traffic flows of each traffic area and other traffic areas from the historical traffic flow matrix based on the adjacency matrix to obtain a traffic flow transfer feature vector, and perform feature extraction on the traffic flow transfer feature vector to obtain traffic flow features. The adjacency matrix is used to extract the connection relationship between each traffic area and other traffic areas; A traffic flow prediction module, configured to perform traffic flow prediction based on the traffic flow features to obtain a prediction result; A traffic flow determination module, configured to determine the traffic flow corresponding to the area to be predicted at the moment to be predicted based on the traffic flow of the target traffic area in the prediction result at the moment to be predicted.

13. The traffic flow prediction device according to claim 12, characterized in that, The feature extraction module is used to extract the transfer features between the traffic flows of each traffic area and other traffic areas based on the adjacency matrix of the current graph convolutional unit, the initial historical traffic flow matrix, and the traffic flow features output by the previous graph convolutional unit, obtain a flow transfer feature vector, and perform feature extraction on the flow transfer feature vector to obtain traffic flow features. Wherein, if the current graph convolutional unit is the first graph convolutional unit, the traffic flow features output by the previous graph convolutional unit are empty; Take the subsequent graph convolutional unit of the current graph convolutional unit as the new current graph convolutional unit, and return to execute the step of extracting the transfer features between the traffic flows of each traffic area and other traffic areas based on the adjacency matrix of the current graph convolutional unit, the initial historical traffic flow matrix, and the traffic flow features output by the previous graph convolutional unit, obtain a flow transfer feature vector, and perform feature extraction on the flow transfer feature vector to obtain traffic flow features, until the traffic flow features are output by the last graph convolutional unit.

14. The traffic flow prediction device according to claim 13, characterized in that The graph convolutional unit includes a first feature extraction unit, a second feature extraction unit, a third feature extraction unit, and a feature fusion unit; Correspondingly, the feature extraction module is used to extract the transfer features between the traffic flows of each traffic area and other traffic areas based on the adjacency matrix of the first feature extraction unit in the current graph convolutional unit, the initial historical traffic flow matrix, and the traffic flow features output by the previous graph convolutional unit, obtain a first flow transfer feature vector, and perform a first feature extraction process on the first flow transfer feature vector to obtain first traffic flow features; Extract the transfer features between the traffic flows of each traffic area and other traffic areas based on the adjacency matrix of the second feature extraction unit in the current graph convolutional unit, the initial historical traffic flow matrix, and the traffic flow features output by the previous graph convolutional unit, obtain a second flow transfer feature vector, and perform a second feature extraction process on the second flow transfer feature vector to obtain second traffic flow features; Multiply the second traffic flow features and the traffic flow features output by the previous graph convolutional unit through the third feature extraction unit in the current graph convolutional unit to obtain a first product vector; Extract the transfer features between the traffic flows of each traffic area and other traffic areas based on the adjacency matrix of the third feature extraction unit, the initial historical traffic flow matrix, and the first product vector, obtain a third flow transfer feature vector, and perform a third feature extraction process on the third flow transfer feature vector to obtain third traffic flow features; Through the feature fusion unit, calculate a second product vector of the first traffic flow feature and the traffic flow feature output by the previous graph convolution unit, and a third product vector of the target matrix corresponding to the first traffic flow feature and the third traffic flow feature, and calculate the sum of the second product vector and the third product vector to obtain the traffic flow feature output by the current graph convolution unit, where the target matrix is obtained by subtracting the first traffic flow feature from the identity matrix.

15. The traffic flow prediction device according to claim 12, characterized in that, The number of the historical traffic flow matrices is at least two, the traffic areas corresponding to each historical traffic flow matrix are the same, and the traffic monitoring time areas are different; The feature extraction module is configured to extract the transfer features between the traffic flow of each traffic area and other traffic areas based on the adjacency matrix from each of the historical traffic flow matrices, obtain the traffic flow transfer feature vectors corresponding to each of the historical traffic flow matrices, and perform feature extraction on each of the traffic flow transfer feature vectors to obtain the traffic flow features corresponding to each of the historical traffic flow matrices.

16. The traffic flow prediction device according to claim 15, characterized in that, The traffic flow prediction module is configured to perform feature fusion on the traffic flow features corresponding to each of the historical traffic flow matrices to obtain the fused traffic flow features; Based on the fused traffic flow features, perform traffic flow prediction to obtain a prediction result.

17. The traffic flow prediction device according to claim 12, wherein The traffic flow prediction module is configured to perform traffic flow prediction based on the traffic flow features to obtain the prediction results of each traffic area in the multiple traffic areas; Correspondingly, the traffic flow determination module is configured to obtain the traffic flow of the target traffic area at the to-be-predicted moment based on the prediction results of each traffic area in the multiple traffic areas, and determine the traffic flow corresponding to the to-be-predicted area at the to-be-predicted moment.

18. The traffic flow prediction device according to claim 15, characterized in that, The matrix acquisition module is configured to determine at least two traffic monitoring time areas before the to-be-predicted moment according to the to-be-predicted moment for which the traffic flow needs to be predicted; Divide each traffic monitoring time area into multiple time slices based on a preset time interval; According to the to-be-predicted area for which the traffic flow needs to be predicted, determine the target traffic area where the to-be-predicted area is located and the reference traffic area corresponding to the target traffic area as the monitoring traffic areas; For each monitoring traffic area, obtain the traffic flow transfer information between the monitoring traffic area and other monitoring traffic areas in each of the time slices; For each traffic monitoring time area, based on the traffic flow transfer information between each monitoring traffic area and other monitoring traffic areas in the time slices of the traffic monitoring time area, obtain the sub-vectors of each traffic area in the traffic monitoring time area; Based on the sub-vectors corresponding to each of the traffic monitoring time areas, obtain the historical traffic flow matrices corresponding to each of the traffic monitoring time areas.

19. The traffic flow prediction device according to any one of claims 12-15, characterized in that, The traffic flow prediction module includes a non-linear mapping module and a traffic flow prediction sub-module; The non-linear mapping module is configured to perform non-linear mapping on the traffic flow features to obtain the mapped feature vectors; The traffic flow prediction sub-module is configured to perform traffic flow prediction according to the mapped feature vectors to obtain a prediction result.

20. The traffic flow prediction device according to claim 19, characterized in that, The non-linear mapping module is used to perform a first convolution operation on the traffic flow characteristics to obtain a first convolution vector; According to a preset activation function, perform feature mapping on the first convolution vector to obtain a non-linear convolution vector; Perform a second convolution operation on the non-linear convolution vector to obtain a mapped feature vector.

21. The traffic flow prediction device according to claim 12, wherein It further includes a model training module, and the model training module includes a sample acquisition module, a sample feature extraction module, a sample prediction module, and a model adjustment module; The sample acquisition module is used to acquire a traffic flow matrix sample, and the traffic flow matrix sample is labeled with the actual traffic flow corresponding to the sample prediction time and the sample traffic area. The traffic flow matrix sample includes sub-vectors of multiple sample traffic areas, and each sub-vector includes the traffic flow transfer information between the corresponding sample traffic area and other sample traffic areas in the multiple sample traffic areas before the sample prediction time; The sample feature extraction module is used to, through the adjacency matrix of the graph convolution unit in the traffic flow prediction model to be trained, extract the transfer characteristics between the traffic flows of each sample traffic area and other sample traffic areas based on the traffic flow matrix sample, obtain a sample flow transfer feature vector, and perform feature extraction on the sample flow transfer feature vector to obtain sample traffic flow characteristics; The sample prediction module is used to, based on the traffic flow prediction unit of the traffic flow prediction model to be trained, perform traffic flow prediction based on the sample traffic flow characteristics to obtain the sample prediction results of each sample traffic area; The model adjustment module is used to adjust the parameters of each unit in the traffic flow prediction model to be trained according to the sample prediction results of each sample traffic area and the corresponding actual traffic flow to obtain a trained traffic flow prediction model.

22. The traffic flow prediction device according to claim 21, characterized in that, There are at least two traffic flow prediction units, and each traffic flow prediction unit is used to predict a traffic flow of a target type; Correspondingly, the sample prediction module is used to perform traffic flow prediction on the sample traffic flow characteristics respectively through each traffic flow prediction unit to obtain the sample prediction results of each sample traffic area under each target type; The model adjustment module is used to, for each target type, calculate the type prediction loss corresponding to the target type according to the sample prediction results of each sample traffic area under the target type and the corresponding actual traffic flow; Calculate the sample prediction loss of the traffic flow prediction model to be trained according to the type prediction losses corresponding to each target type; Adjust the parameters of each unit in the traffic flow prediction model to be trained according to the sample prediction loss to obtain a trained traffic flow prediction model.

23. An electronic device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the traffic flow prediction method according to any one of claims 1 to 11.

24. A storage medium, characterized in that, The storage medium stores multiple instructions, and the instructions are suitable for being loaded by the processor to execute the steps in the traffic flow prediction method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Traffic flow prediction method and device, equipment and storage medium

    CN110910659A

  • Traffic data prediction method and device and vehicle control method

    CN111079975A