Traffic flow prediction and prediction model training method and device

By acquiring and integrating historical traffic flow, characteristics, trends and residual data of the target lane, the traffic flow prediction problem caused by incomplete data is solved, and accurate prediction of traffic flow in the future is achieved.

CN119851460APending Publication Date: 2025-04-18BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411786855.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In smart traffic scenarios, due to inevitable events such as equipment damage and bad weather during the collection of traffic flow data, the collected traffic flow data is incomplete enough, so that the subsequent traffic flow cannot be accurately predicted.

Method used

By obtaining the historical traffic flow set of the target lane, and using the target feature data set, traffic trend set and traffic residual set for fusion, the target fusion data set is generated, and finally traffic flow prediction is performed based on the data set.

Benefits of technology

Even if there are any missing or serious historical traffic flow data, accurate prediction of traffic flow in the target lane can be achieved at the future moment, reducing the requirements for historical traffic flow data, and enriching the applicable scenarios for traffic flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851460A_ABST
    Figure CN119851460A_ABST
Patent Text Reader

Abstract

The invention provides a traffic flow prediction and prediction model training method, and relates to the technical field of artificial intelligence such as automatic driving, big data, cloud service and intelligent traffic. The traffic flow prediction method comprises the following steps: acquiring a historical traffic flow set corresponding to a target lane; obtaining a target feature data set corresponding to the target lane according to the at least one historical moment; obtaining a target flow trend set and a target flow residual set corresponding to the target lane according to the historical traffic flow set; obtaining a target fusion data set corresponding to the target lane according to the target feature set, the target traffic trend set and the target traffic residual set; and obtaining a target traffic flow prediction result corresponding to the target lane according to the target fusion data set. The prediction model training method comprises the steps of obtaining a training data set; constructing a neural network model comprising a time sequence decomposition module, a fusion module and a multi-feature cooperation module; and training the neural network model by using the training data set to obtain a prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, in particular to the field of artificial intelligence technology such as autonomous driving, big data, cloud services, and smart transportation. Provided are a method, device, electronic device, and readable storage medium for predicting traffic flow and training a prediction model. Background Art

[0002] In recent years, with the rapid development of Internet technology and traffic informatization, the scale of traffic flow data has become larger and larger. In the smart traffic scenario, how to accurately predict the next traffic flow based on previous traffic flow data is of great significance to traffic management.

[0003] However, in actual scenarios, due to some unavoidable events that occur when collecting traffic flow data (such as equipment damage, bad weather, etc.), the collected traffic flow data is incomplete, resulting in the inability to predict traffic flow at subsequent times based on the missing traffic flow data. Summary of the invention

[0004] According to a first aspect of the present disclosure, a method for predicting traffic flow is provided, comprising: obtaining a historical traffic flow set corresponding to a target lane, the historical traffic flow set including historical traffic flow corresponding to at least one historical moment; obtaining a target feature data set corresponding to the target lane based on the at least one historical moment; obtaining a target flow trend set and a target flow residual set corresponding to the target lane based on the historical traffic flow set; obtaining a target fusion data set corresponding to the target lane based on the target feature set, the target flow trend set and the target flow residual set; and obtaining a target traffic flow prediction result corresponding to the target lane based on the target fusion data set.

[0005] According to a second aspect of the present disclosure, a method for training a prediction model is provided, comprising: obtaining a training data set, wherein the training data set comprises a sample historical traffic flow set, a sample feature set and a sample traffic flow prediction result corresponding to different sample lanes; constructing a neural network model comprising a time series decomposition module, a fusion module and a multi-feature collaboration module; inputting the sample traffic flow set and the sample feature set into the neural network model to obtain a model prediction result output by the neural network model; obtaining traffic flow data missing information based on the sample historical traffic flow set; obtaining a loss function value based on the traffic flow data missing information, the sample traffic flow prediction result and the model prediction result; and updating the parameters of the neural network model according to the loss function value to obtain a prediction model.

[0006] According to a third aspect of the present disclosure, a traffic flow prediction device is provided, comprising: a first acquisition unit, used to acquire a historical traffic flow set corresponding to a target lane, the historical traffic flow set including historical traffic flows corresponding to at least one historical moment; a first processing unit, used to obtain a target feature data set corresponding to the target lane according to the at least one historical moment; a second processing unit, used to obtain a target flow trend set and a target flow residual set corresponding to the target lane according to the historical traffic flow set; a third processing unit, used to obtain a target fusion data set corresponding to the target lane according to the target feature set, the target flow trend set and the target flow residual set; a prediction unit, used to obtain a target traffic flow prediction result corresponding to the target lane according to the target fusion data set.

[0007] According to a fourth aspect of the present disclosure, a training device for a prediction model is provided, comprising: a second acquisition unit, used to acquire a training data set, wherein the training data set includes a sample historical traffic flow set, a sample feature set and a sample traffic flow prediction result corresponding to different sample lanes; a construction unit, used to construct a neural network model including a time series decomposition module, a fusion module and a multi-feature collaboration module; a fourth processing unit, used to input the sample traffic flow set and the sample feature set into the neural network model to obtain a model prediction result output by the neural network model; a determination unit, used to obtain traffic flow data missing information based on the sample historical traffic flow set; a calculation unit, used to obtain a loss function value based on the traffic flow data missing information, the sample traffic flow prediction result and the model prediction result; and a training unit, used to update the parameters of the neural network model according to the loss function value to obtain a prediction model.

[0008] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0009] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.

[0010] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method as described above when executed by a processor.

[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0013] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0014] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0015] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;

[0016] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0017] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure;

[0018] Figure 6 It is a block diagram of an electronic device used to implement the traffic flow prediction or prediction model training method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is omitted in the following description.

[0020] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the traffic flow prediction method of this embodiment specifically includes the following steps:

[0021] S101, obtaining a historical traffic flow set corresponding to a target lane, wherein the historical traffic flow set includes a historical traffic flow corresponding to at least one historical moment;

[0022] S102, obtaining a target feature data set corresponding to the target lane according to the at least one historical moment;

[0023] S103, obtaining a target traffic flow trend set and a target traffic flow residual set corresponding to the target lane according to the historical traffic flow set;

[0024] S104, obtaining a target fusion data set corresponding to the target lane according to the target feature set, the target flow trend set and the target flow residual set;

[0025] S105. Obtain a target traffic flow prediction result corresponding to the target lane according to the target fusion data set.

[0026] The traffic flow prediction method of the present embodiment, in addition to using the historical traffic flow set corresponding to the target lane, further uses the target feature set corresponding to the target lane when predicting the traffic flow. Therefore, even when there is a lack of traffic data in the acquired historical traffic flow set, it is possible to achieve the purpose of accurately predicting the traffic flow of the target lane at future times, thereby reducing the high requirements for traffic data in the historical traffic flow set and enriching the applicable scenarios of traffic flow prediction.

[0027] In this embodiment, the target traffic flow prediction result corresponding to the target lane is the traffic flow data prediction result of the target lane at one or several moments in the future, for example, the traffic flow data prediction result at the next moment after the current moment.

[0028] The target lane in this embodiment can be one or more; that is, the traffic flow in one lane can be predicted in this embodiment, or the traffic flow in multiple lanes can be predicted at the same time, and the multiple target lanes can correspond to multiple lanes at the same intersection.

[0029] When executing S101, this embodiment can first determine multiple historical moments according to the current moment, the preset duration and the preset time interval; then obtain the historical traffic flow corresponding to the target lane and each historical moment respectively, so as to obtain the historical traffic flow set corresponding to the target lane according to the at least one historical traffic flow obtained, and the target traffic flow set includes the traffic flow data of the target lane corresponding to different historical moments.

[0030] For example, if the current time is 14:00, if the preset duration is 4 hours, and if the preset time interval is 1 hour, the multiple historical times determined by executing S101 in this embodiment include 14:00, 13:00, 12:00 and 11:00, and then the traffic flow of the target lane at 14:00, 13:00, 12:00 and 11:00 is obtained respectively.

[0031] In actual application scenarios, the historical traffic flow obtained may be concentrated due to factors such as damage to observation equipment and bad weather, and the historical traffic flow corresponding to one or several historical moments may be missing.

[0032] Therefore, the historical traffic flow set obtained by executing S101 in this embodiment may be an incomplete historical traffic flow set, for example, only including the historical traffic flow corresponding to 13:00 and the historical traffic flow corresponding to 11:00, or only including the historical traffic flow corresponding to 13:00, etc.

[0033] After executing S101 to obtain the historical traffic flow set corresponding to the target lane, this embodiment executes S102 to obtain a target feature data set corresponding to the target lane based on at least one historical moment; in this embodiment, the obtained target feature data set is a target spatial feature set and / or a target temporal feature set corresponding to the target lane.

[0034] That is to say, since the historical traffic flow set corresponding to the target lane may be missing historical traffic flow data, the prediction of traffic flow at future times may not be completed or cannot be accurately completed using only the historical traffic flow data in the historical traffic flow set. Therefore, this embodiment additionally introduces a target space feature set and / or a target time feature set corresponding to the target lane, enriching the feature information when performing traffic flow prediction, thereby achieving the purpose of accurate prediction even when historical traffic flow data is missing or severely missing.

[0035] In this embodiment, the target spatial feature set corresponding to the target lane includes spatial features of the target lane corresponding to different historical moments.

[0036] Specifically, when executing S102 and obtaining a target space feature set corresponding to a target lane according to at least one historical moment, the present embodiment may adopt the following implementation method: for each historical moment, obtaining a target graph corresponding to the target lane at the current historical moment, the obtained target graph including a plurality of nodes and edges between the nodes, the nodes in the target graph representing lanes, and the edges between the nodes representing that two lanes are adjacent lanes; performing embedding processing on each node in the obtained target graph to obtain an embedding processing result of each node; obtaining an embedding processing result of the target node corresponding to the target lane as the target space feature corresponding to the current historical moment; obtaining a target space feature set corresponding to the target lane according to at least one historical moment and the target space features respectively corresponding to at least one historical moment.

[0037] That is to say, this embodiment obtains the target spatial features corresponding to different historical moments according to the target maps corresponding to the target lanes at different historical moments. The target spatial features include the spatial information of the target lane and its adjacent lanes, which can improve the accuracy of the obtained target spatial features.

[0038] When executing S102 to obtain the target map corresponding to the target lane at the current historical moment, this embodiment can first obtain the geographic location information of the target lane, and then use the map corresponding to the obtained geographic location information at the current historical moment as the target map.

[0039] In this embodiment, the target time feature set corresponding to the target lane includes time features of the target lane corresponding to different historical moments, and the time features include minute features (0-60), hour features (0-24), week features (1-7), month features (1-12), and holiday features (0 indicates not a holiday, 1 indicates a holiday).

[0040] Specifically, when executing S102 in this embodiment to obtain a target time feature set corresponding to the target lane according to at least one historical moment, the implementation method that can be adopted is: for each historical moment, obtain the target time feature of the target lane corresponding to the current historical moment; based on at least one historical moment and the target time features corresponding to at least one historical moment, obtain the target time feature set corresponding to the target lane.

[0041] That is to say, this embodiment obtains the target time characteristics corresponding to the target lane at different historical moments based on at least one of the minute characteristics, hour characteristics, week characteristics, month characteristics and holiday characteristics corresponding to the target lane at different historical moments, thereby improving the accuracy of the obtained target time characteristics.

[0042] In this embodiment, if the target time features corresponding to different historical moments are obtained, the obtained target time features can also be linearly transformed to ensure that the obtained target time features have the same dimension as the historical traffic flow set, such as the same matrix size.

[0043] Preferably, when this embodiment executes S102, the obtained target feature set includes both a target spatial feature set and a target temporal feature set.

[0044] After executing S102 to obtain a target feature data set corresponding to the target lane, this embodiment executes S103 to obtain a target flow trend set and a target flow residual set corresponding to the target lane based on the historical traffic flow set.

[0045] When executing S103, this embodiment can input the acquired historical traffic flow set into the time series decomposition module in the pre-trained prediction model, and then obtain the target flow trend set and target flow residual set corresponding to the target lane according to the output result of the time series decomposition module.

[0046] Specifically, when executing S103 in this embodiment to obtain a target traffic flow trend set corresponding to a target lane based on a historical traffic flow set, the implementation method that can be adopted is: obtaining initial traffic flow trend data corresponding to different historical moments based on each historical traffic flow in the historical traffic flow set; obtaining an initial traffic flow trend set based on the initial traffic flow trend data corresponding to different historical moments; performing a linear transformation on the obtained initial traffic flow trend set to obtain a target traffic flow trend set.

[0047] In particular, when executing S103, this embodiment can process multiple historical traffic flow data by using a moving average kernel (Moving Average Kernel), so as to obtain initial traffic flow trend data corresponding to different historical moments according to the processing results.

[0048] When executing S103 in this embodiment to obtain a target flow residual set corresponding to a target lane based on a historical traffic flow set, the implementation method that can be adopted is: obtaining an initial flow trend set; obtaining an initial flow residual set based on the historical traffic flow set and the initial flow trend set, for example, subtracting the historical traffic flow corresponding to the same historical moment from the initial flow trend data; performing a linear transformation on the obtained initial flow residual set to obtain a target flow residual set.

[0049] In this embodiment, the purpose of the linear transformation is to aggregate information and ensure that the target traffic trend set and the target traffic residual set have the same dimension as the historical traffic flow set.

[0050] In this embodiment, the traffic flow trend data is used to reflect the periodic information of the traffic flow of the target lane, and the traffic flow residual data is used to reflect the fluctuation information of the traffic flow of the target lane.

[0051] After executing S103 to obtain the target flow trend set and the target flow residual set corresponding to the target lane, this embodiment executes S104 to obtain the target fusion data set corresponding to the target lane based on the target feature set, the target flow trend set and the target flow residual set.

[0052] When executing S104 in this embodiment, the target feature set, the target traffic trend set and the target traffic residual set may be spliced, and the splicing result may be used as the target fusion data set corresponding to the target lane.

[0053] When executing S104, this embodiment can also input the target feature set, the target traffic trend set and the target traffic residual set into the fusion module of the pre-trained prediction model, and then obtain the target fusion data set according to the output result of the fusion module.

[0054] After executing S104 to obtain the target fusion data set corresponding to the target lane, this embodiment executes S105 to obtain the target traffic flow prediction result corresponding to the target lane based on the target fusion data set.

[0055] When executing S105, the present embodiment may input the target fusion data set into a multi-feature collaborative module in a pre-trained prediction model, and obtain a target traffic flow prediction result corresponding to the target lane based on an output result of the multi-feature collaborative module.

[0056] Specifically, when executing S105 and obtaining the target traffic flow prediction result corresponding to the target lane according to the target fusion data set, the implementation method that can be adopted in this embodiment is: obtaining a query vector, a key vector and a value vector according to the target fusion data set; using the query matrix, the key matrix and the value matrix corresponding to each attention head, respectively performing attention calculation according to the obtained query vector, the key vector and the value vector, to obtain the attention calculation result corresponding to each attention head; obtaining the target traffic flow prediction result corresponding to the target lane according to multiple attention calculation results and a preset weight matrix.

[0057] That is to say, this embodiment introduces a multi-head attention mechanism to obtain the target traffic flow prediction result based on the target fusion data set, so as to more accurately judge the relationship between different features in the target fusion data, which can improve the accuracy of the obtained target traffic flow prediction result.

[0058] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2 As shown, the training method of the prediction model of this embodiment specifically includes the following steps:

[0059] S201, obtaining a training data set, wherein the training data set includes a sample historical traffic flow set, a sample feature set, and a sample traffic flow prediction result corresponding to different sample lanes;

[0060] S202, constructing a neural network model including a time series decomposition module, a fusion module and a multi-feature collaboration module;

[0061] S203, inputting the sample traffic flow set and the sample feature set into the neural network model to obtain a model prediction result output by the neural network model;

[0062] S204, obtaining missing information of traffic flow data according to the sample historical traffic flow set;

[0063] S205, obtaining a loss function value according to the traffic flow data missing information, the sample traffic flow prediction result and the model prediction result;

[0064] S206. Update the parameters of the neural network model according to the loss function value to obtain a prediction model.

[0065] The training method of the prediction model of the present embodiment uses the obtained sample historical traffic flow set, sample feature set and sample traffic flow prediction results to train a neural network model including a time series decomposition module, a fusion module and a multi-feature collaboration module, so as to obtain a prediction model, and also combines the traffic flow data missing information obtained according to the sample historical traffic flow set to obtain the loss function value for adjusting the model parameters, so that the obtained prediction model can also predict the traffic flow data when there is a lack of historical traffic flow data in the historical traffic flow set, thereby enhancing the prediction performance of the obtained prediction model.

[0066] The sample historical traffic flow set obtained by executing S201 in this embodiment includes traffic flow data of sample lanes corresponding to different historical moments.

[0067] The sample feature set obtained by executing S201 in this embodiment includes at least one of a sample space feature set and a sample time feature set corresponding to the sample lane.

[0068] Among them, the sample space feature set corresponding to the sample lane includes the sample space features of the sample lane corresponding to different historical moments; the sample time feature set corresponding to the sample lane includes the sample time features of the sample lane corresponding to different historical moments.

[0069] The method for acquiring the sample spatial features in this embodiment is similar to the method for acquiring the target spatial features in the above embodiment, and the method for acquiring the sample temporal features in this embodiment is similar to the method for acquiring the target temporal features in the above embodiment.

[0070] In the neural network model constructed by executing S202 in this embodiment, the time series decomposition module is used to obtain a sample traffic flow trend set and a sample traffic flow residual set of the corresponding sample lane according to the input sample traffic flow set.

[0071] Among them, the processing process of the time series decomposition module in this embodiment is similar to the process of obtaining the target traffic flow trend set and the target traffic flow residual set according to the historical traffic flow set in the above embodiment.

[0072] In the neural network model constructed by executing S202 in this embodiment, the fusion module is used to obtain a sample fusion data set based on the sample feature set and the sample flow trend set and the sample flow residual set output by the time series decomposition module.

[0073] In the neural network model constructed by executing S203 in this embodiment, the multi-feature collaborative module is used to obtain the model prediction result of the corresponding sample lane according to the sample fusion data set output by the fusion module.

[0074] In this embodiment, the multi-feature collaborative module performs multi-head attention calculation on the sample fusion data set based on the multi-head attention mechanism, and then obtains the model prediction result of the corresponding sample lane according to the attention calculation result output by each attention head; the processing process of the multi-feature collaborative module is similar to the process of obtaining the target traffic flow prediction result according to the target fusion data set in the above embodiment.

[0075] This embodiment, when executing S203 to input the sample traffic flow set and the sample feature set into the neural network model to obtain the model prediction result output by the neural network model, may include the following contents: inputting the sample traffic flow set into the time series decomposition module to obtain the sample flow trend set and the sample flow residual set output by the time series decomposition module; inputting the sample feature set, the sample flow trend set and the sample flow residual set into the fusion module to obtain the sample fusion data set output by the fusion module; inputting the obtained sample fusion data set into the multi-feature collaboration module to obtain the model prediction result output by the multi-feature collaboration module.

[0076] The traffic flow data missing information obtained by executing S204 in this embodiment can be a matrix, where the rows in the matrix represent sample lanes and the columns in the matrix represent different historical moments; the element values ​​at different positions in the matrix are 1 or 0, 1 indicates that there is no data missing at the position, and 0 indicates that there is data missing at the position.

[0077] The traffic flow data missing information obtained by executing S204 in this embodiment is used to reflect at which historical moment the traffic flow data of the corresponding sample lane was not obtained.

[0078] In this embodiment, when executing S205, the loss function value is obtained according to the missing information of traffic flow data, the sample traffic flow prediction result and the model prediction result, the following calculation formula can be used:

[0079]

[0080] In the above calculation formula: L represents the loss function value; represents the model prediction result; y represents the sample traffic flow prediction result; M represents the matrix corresponding to the missing information of traffic flow data.

[0081] When executing S206, this embodiment adjusts the parameters of each module in the neural network model according to the obtained loss function value, thereby obtaining a prediction model.

[0082] The prediction model obtained by executing S206 in this embodiment can output the traffic flow prediction result corresponding to the lane according to the input traffic flow set and feature set corresponding to the corresponding lane.

[0083] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure. Figure 3 , a flow chart of the present embodiment when obtaining the target traffic flow prediction result of the corresponding target lane based on the prediction model is shown in: first, the target traffic flow set of the corresponding target lane is input into the time series decomposition module of the prediction model to obtain the target flow trend set and the target flow residual set output by the module; then, the target spatial feature set, target time feature set, target flow trend set and target flow residual set of the corresponding target lane are input into the fusion module of the prediction model to obtain the target fusion data set output by the module; finally, the target fusion data set is input into the multi-feature collaboration module of the prediction model to obtain the target traffic flow prediction result of the corresponding target lane according to the output result of the module.

[0084] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure. Figure 4 As shown, the traffic flow prediction device 400 of this embodiment includes:

[0085] A first acquisition unit 401 is used to acquire a historical traffic flow set corresponding to a target lane, wherein the historical traffic flow set includes a historical traffic flow corresponding to at least one historical moment;

[0086] A first processing unit 402 is configured to obtain a target feature data set corresponding to the target lane according to the at least one historical moment;

[0087] The second processing unit 403 is used to obtain a target traffic flow trend set and a target traffic flow residual set corresponding to the target lane according to the historical traffic flow set;

[0088] The third processing unit 404 is used to obtain a target fusion data set corresponding to the target lane according to the target feature set, the target flow trend set and the target flow residual set;

[0089] The prediction unit 405 is used to obtain a target traffic flow prediction result corresponding to the target lane according to the target fusion data set.

[0090] The first acquisition unit 401 can first determine multiple historical moments according to the current moment, a preset duration, and a preset time interval; and then respectively obtain the historical traffic flow corresponding to the target lane and each historical moment, so as to obtain a historical traffic flow set corresponding to the target lane according to at least one historical traffic flow obtained, and the target traffic flow set includes traffic flow data of the target lane corresponding to different historical moments.

[0091] In actual application scenarios, the historical traffic flow obtained may be concentrated due to factors such as damage to observation equipment and bad weather, and the historical traffic flow corresponding to one or several historical moments may be missing.

[0092] Therefore, the historical traffic flow set acquired by the first acquisition unit 401 may be an incomplete historical traffic flow set.

[0093] In this embodiment, after the first acquisition unit 401 obtains the historical traffic flow set corresponding to the target lane, the first processing unit 402 obtains the target feature data set corresponding to the target lane based on at least one historical moment; in this embodiment, the target feature data set obtained by the first processing unit 402 is the target spatial feature set and / or target temporal feature set corresponding to the target lane.

[0094] In this embodiment, the target spatial feature set corresponding to the target lane includes the spatial features of the target lane at different historical moments.

[0095] Specifically, when the first processing unit 402 obtains the target space feature set corresponding to the target lane based on at least one historical moment, the implementation method that can be adopted is: for each historical moment, obtain the target graph corresponding to the target lane at the current historical moment, the obtained target graph includes multiple nodes and edges between nodes, the nodes in the target graph represent lanes, and the edges between the nodes represent that two lanes are adjacent lanes; embedding processing is performed on each node in the obtained target graph to obtain the embedding processing result of each node; the embedding processing result of the target node corresponding to the target lane is obtained as the target space feature corresponding to the current historical moment; according to at least one historical moment and the target space features corresponding to at least one historical moment, a target space feature set corresponding to the target lane is obtained.

[0096] That is to say, the first processing unit 402 obtains the target spatial features corresponding to different historical moments based on the target maps corresponding to the target lanes at different historical moments. The target spatial features include spatial information of the target lane and its adjacent lanes, which can improve the accuracy of the obtained target spatial features.

[0097] When acquiring the target map corresponding to the target lane at the current historical moment, the first processing unit 402 may first acquire the geographic location information of the target lane, and then use the map corresponding to the acquired geographic location information at the current historical moment as the target map.

[0098] In this embodiment, the target time feature set corresponding to the target lane includes time features of the target lane corresponding to different historical moments, and the time features include minute features (0-60), hour features (0-24), week features (1-7), month features (1-12), and holiday features (0 indicates not a holiday, 1 indicates a holiday).

[0099] Specifically, when the first processing unit 402 obtains the target time feature set corresponding to the target lane based on at least one historical moment, the implementation method that can be adopted is: for each historical moment, obtain the target time feature of the target lane corresponding to the current historical moment; based on at least one historical moment and the target time features corresponding to at least one historical moment, obtain the target time feature set corresponding to the target lane.

[0100] That is to say, the first processing unit 402 obtains the target time characteristics corresponding to the target lane at different historical moments based on at least one of the minute characteristics, hour characteristics, week characteristics, month characteristics and holiday characteristics corresponding to the target lane at different historical moments, thereby improving the accuracy of the obtained target time characteristics.

[0101] In this embodiment, if the target time features corresponding to different historical moments are obtained, the obtained target time features can also be linearly transformed to ensure that the obtained target time features have the same dimension as the historical traffic flow set, such as the same matrix size.

[0102] Preferably, the target feature set obtained by the first processing unit 402 includes both a target spatial feature set and a target temporal feature set.

[0103] In this embodiment, after the first processing unit 402 obtains the target feature data set corresponding to the target lane, the second processing unit 403 obtains the target flow trend set and the target flow residual set corresponding to the target lane based on the historical traffic flow set.

[0104] The second processing unit 403 can input the acquired historical traffic flow set into the time series decomposition module in the pre-trained prediction model, and then obtain the target flow trend set and the target flow residual set corresponding to the target lane according to the output result of the time series decomposition module.

[0105] Specifically, when the second processing unit 403 obtains the target traffic trend set corresponding to the target lane based on the historical traffic flow set, the implementation method that can be adopted is: according to each historical traffic flow in the historical traffic flow set, obtain the initial traffic trend data corresponding to different historical moments; according to the initial traffic trend data corresponding to different historical moments, obtain the initial traffic trend set; perform linear transformation on the obtained initial traffic trend set to obtain the target traffic trend set.

[0106] The second processing unit 403 may process a plurality of historical traffic flow data by using a moving average kernel, thereby obtaining initial flow trend data corresponding to different historical moments according to the processing results.

[0107] When the second processing unit 403 obtains the target flow residual set corresponding to the target lane based on the historical traffic flow set, the implementation method that can be adopted is: obtain the initial flow trend set; obtain the initial flow residual set based on the historical traffic flow set and the initial flow trend set, for example, subtracting the historical traffic flow corresponding to the same historical moment from the initial flow trend data; perform linear transformation on the obtained initial flow residual set to obtain the target flow residual set.

[0108] In this embodiment, the purpose of the linear transformation is to aggregate information and ensure that the target traffic trend set and the target traffic residual set have the same dimension as the historical traffic flow set.

[0109] In this embodiment, the traffic flow trend data is used to reflect the periodic information of the traffic flow of the target lane, and the traffic flow residual data is used to reflect the fluctuation information of the traffic flow of the target lane.

[0110] In this embodiment, after the second processing unit 403 obtains the target flow trend set and the target flow residual set corresponding to the target lane, the third processing unit 404 obtains the target fusion data set corresponding to the target lane based on the target feature set, the target flow trend set and the target flow residual set.

[0111] The third processing unit 404 may splice the target feature set, the target traffic trend set, and the target traffic residual set, and then use the splicing result as the target fusion data set corresponding to the target lane.

[0112] The third processing unit 404 may also input the target feature set, the target traffic trend set and the target traffic residual set into a fusion module in the pre-trained prediction model, and then obtain a target fusion data set according to the output result of the fusion module.

[0113] In this embodiment, after the third processing unit 404 obtains the target fused data set corresponding to the target lane, the prediction unit 405 obtains the target traffic flow prediction result corresponding to the target lane based on the target fused data set.

[0114] The prediction unit 405 may input the target fusion data set into the multi-feature collaborative module in the pre-trained prediction model, and obtain the target traffic flow prediction result corresponding to the target lane according to the output result of the multi-feature collaborative module.

[0115] Specifically, when the prediction unit 405 obtains the target traffic flow prediction result corresponding to the target lane based on the target fusion data set, the implementation method that can be adopted is: according to the target fusion data set, a query vector, a key vector and a value vector are obtained; using the query matrix, key matrix and value matrix corresponding to each attention head, respectively, attention calculation is performed according to the obtained query vector, key vector and value vector, and the attention calculation result corresponding to each attention head is obtained; according to multiple attention calculation results and a preset weight matrix, the target traffic flow prediction result corresponding to the target lane is obtained.

[0116] That is to say, the prediction unit 405 introduces a multi-head attention mechanism to obtain the target traffic flow prediction result based on the target fusion data set, so as to more accurately judge the relationship between different features in the target fusion data, which can improve the accuracy of the obtained target traffic flow prediction result.

[0117] Figure 5 is a schematic diagram according to the fifth embodiment of the present disclosure. Figure 5 As shown, the prediction model training device 500 of this embodiment includes:

[0118] A second acquisition unit 501 is used to acquire a training data set, wherein the training data set includes a sample historical traffic flow set, a sample feature set and a sample traffic flow prediction result corresponding to different sample lanes;

[0119] A construction unit 502 is used to construct a neural network model including a time series decomposition module, a fusion module and a multi-feature collaboration module;

[0120] The fourth processing unit 503 is used to input the sample traffic flow set and the sample feature set into the neural network model to obtain a model prediction result output by the neural network model;

[0121] A determination unit 504, configured to obtain traffic flow data missing information according to the sample historical traffic flow set;

[0122] A fifth processing unit 505 is used to obtain a loss function value according to the traffic flow data missing information, the sample traffic flow prediction result and the model prediction result;

[0123] The training unit 506 is used to update the parameters of the neural network model according to the loss function value to obtain a prediction model.

[0124] The sample historical traffic flow set acquired by the second acquisition unit 501 includes traffic flow data of sample lanes corresponding to different historical moments; the sample historical traffic flow set may be an incomplete traffic flow set.

[0125] The sample feature set acquired by the second acquisition unit 501 includes at least one of a sample space feature set and a sample time feature set corresponding to the sample lane.

[0126] Among them, the sample space feature set corresponding to the sample lane includes the sample space features of the sample lane corresponding to different historical moments; the sample time feature set corresponding to the sample lane includes the sample time features of the sample lane corresponding to different historical moments.

[0127] The method for acquiring the sample spatial features in this embodiment is similar to the method for acquiring the target spatial features in the above embodiment, and the method for acquiring the sample temporal features in this embodiment is similar to the method for acquiring the target temporal features in the above embodiment.

[0128] In the neural network model constructed by the construction unit 502, the time series decomposition module is used to obtain a sample traffic flow trend set and a sample traffic flow residual set of the corresponding sample lane according to the input sample traffic flow set.

[0129] Among them, the processing process of the time series decomposition module in this embodiment is similar to the process of obtaining the target flow trend set and the target flow residual set in the above embodiment.

[0130] In the neural network model constructed by the construction unit 502, the fusion module is used to obtain a sample fusion data set according to the sample feature set and the sample flow trend set and the sample flow residual set output by the time series decomposition module.

[0131] In the neural network model constructed by the construction unit 502, the multi-feature collaboration module is used to obtain the model prediction result of the corresponding sample lane according to the sample fusion data set output by the fusion module.

[0132] In this embodiment, the multi-feature collaborative module performs multi-head attention calculation on the sample fusion data set based on the multi-head attention mechanism, and then obtains the model prediction result of the corresponding sample lane according to the attention calculation result output by each attention head.

[0133] When the fourth processing unit 503 inputs the sample traffic flow set and the sample feature set into the neural network model to obtain the model prediction result output by the neural network model, it may include the following contents: inputting the sample traffic flow set into the time series decomposition module to obtain the sample flow trend set and the sample flow residual set output by the time series decomposition module; inputting the sample feature set, the sample flow trend set and the sample flow residual set into the fusion module to obtain the sample fusion data set output by the fusion module; inputting the obtained sample fusion data set into the multi-feature collaboration module to obtain the model prediction result output by the multi-feature collaboration module.

[0134] The traffic flow data missing information obtained by the determination unit 504 can be a matrix, in which the rows represent sample lanes and the columns represent different historical moments; the element values ​​at different positions in the matrix are 1 or 0, 1 indicates that there is no data missing at the position, and 0 indicates that there is data missing at the position.

[0135] The traffic flow data missing information obtained by the determination unit 504 is used to reflect at which historical moment the traffic flow data of the corresponding sample lane was not obtained.

[0136] The fifth processing unit 505 may use the following calculation formula to obtain the loss function value according to the traffic flow data missing information, the sample traffic flow prediction result and the model prediction result:

[0137]

[0138] In the above calculation formula: L represents the loss function value; represents the model prediction result; y represents the sample traffic flow prediction result; M represents the matrix corresponding to the missing information of traffic flow data.

[0139] The training unit 506 adjusts the parameters of each module in the neural network model according to the obtained loss function value, thereby obtaining a prediction model.

[0140] The prediction model obtained by the training unit 506 can output the traffic flow prediction result corresponding to the lane according to the input traffic flow set and feature set corresponding to the corresponding lane.

[0141] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0142] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0143] like Figure 6, is a block diagram of an electronic device according to a method for extracting entity relationships according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0144] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0145] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0146] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the extraction method of entity relationships. For example, in some embodiments, the extraction method of entity relationships may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608.

[0147] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the entity relationship extraction method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the entity relationship extraction method in any other appropriate manner (e.g., by means of firmware).

[0148] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0149] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable entity relationship extraction device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0150] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0151] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0152] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0153] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.

[0154] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0155] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for predicting traffic flow, comprising: Acquire a historical traffic flow set corresponding to the target lane, wherein the historical traffic flow set includes historical traffic flow corresponding to at least one historical moment; Obtaining a target feature data set corresponding to the target lane according to the at least one historical moment; According to the historical traffic flow set, a target flow trend set and a target flow residual set corresponding to the target lane are obtained; Obtaining a target fusion data set corresponding to the target lane according to the target feature set, the target flow trend set and the target flow residual set; A target traffic flow prediction result corresponding to the target lane is obtained according to the target fusion data set.

2. The method according to claim 1, wherein: The obtaining, according to the at least one historical moment, a target feature data set corresponding to the target lane comprises: For each historical moment, obtaining a target map corresponding to the target lane at the current historical moment; Performing embedding processing on each node in the target graph to obtain embedding processing results of each node; Obtaining an embedding processing result of a target node corresponding to the target lane as a target space feature corresponding to the current historical moment; A target space feature set corresponding to the target lane is obtained according to the at least one historical moment and the target space features respectively corresponding to the at least one historical moment.

3. The method according to claim 1, wherein: The obtaining, according to the at least one historical moment, a target feature data set corresponding to the target lane comprises: For each historical moment, obtaining the target time feature of the target lane corresponding to the current historical moment; A target time feature set corresponding to the target lane is obtained according to the at least one historical moment and the target time features respectively corresponding to the at least one historical moment.

4. The method according to claim 1, wherein: The step of obtaining a target traffic flow trend set corresponding to the target lane according to the historical traffic flow set includes: According to each historical traffic flow in the historical traffic flow set, initial traffic flow trend data corresponding to different historical moments are obtained; Obtaining an initial traffic trend set according to the initial traffic trend data corresponding to different historical moments; The initial flow trend set is linearly transformed to obtain the target flow trend set.

5. The method according to claim 4, wherein: The step of obtaining a target traffic flow residual set corresponding to the target lane according to the historical traffic flow set includes: Obtaining the initial traffic trend set; Obtaining an initial traffic flow residual set according to the historical traffic flow set and the initial traffic flow trend set; The initial flow residual set is linearly transformed to obtain the target flow residual set.

6. The method according to claim 1, wherein: The step of obtaining a target traffic flow prediction result corresponding to the target lane according to the target fusion data set includes: According to the target fusion data set, a query vector, a key vector and a value vector are obtained; Using the query matrix, the key matrix and the value matrix corresponding to each attention head, respectively, performing attention calculation according to the query vector, the key vector and the value vector, to obtain the attention calculation results corresponding to each attention head; According to the multiple attention calculation results and the preset weight matrix, a target traffic flow prediction result corresponding to the target lane is obtained.

7. The method according to claim 1, wherein: The step of obtaining a target traffic flow trend set and a target traffic flow residual set corresponding to the target lane according to the historical traffic flow set includes: Inputting the historical traffic flow set into a time series decomposition module in a pre-trained prediction model; According to the output result of the time series decomposition module, the target flow trend set and the target flow residual set are obtained.

8. The method according to claim 1, wherein: The step of obtaining a target fusion data set corresponding to the target lane according to the target feature set, the target flow trend set and the target flow residual set includes: Inputting the target feature set, the target flow trend set and the target flow residual set into a fusion module in a pre-trained prediction model; According to the output result of the fusion module, the target fusion data set is obtained.

9. The method according to claim 1, wherein: The step of obtaining a target traffic flow prediction result corresponding to the target lane according to the target fusion data set includes: Inputting the target fusion data set into a multi-feature collaborative module in a pre-trained prediction model; The target traffic flow prediction result is obtained according to the output result of the multi-feature collaborative module.

10. A method for training a prediction model, comprising: Acquire a training data set, wherein the training data set includes a sample historical traffic flow set, a sample feature set, and a sample traffic flow prediction result corresponding to different sample lanes; Construct a neural network model including a time series decomposition module, a fusion module, and a multi-feature collaboration module; Inputting the sample traffic flow set and the sample feature set into the neural network model to obtain a model prediction result output by the neural network model; Obtaining missing information of traffic flow data according to the sample historical traffic flow set; Obtaining a loss function value according to the missing information of the traffic flow data, the sample traffic flow prediction result and the model prediction result; The parameters of the neural network model are updated according to the loss function value to obtain a prediction model.

11. The method according to claim 10, wherein: The step of inputting the sample traffic flow set and the sample feature set into the neural network model to obtain a model prediction result output by the neural network model includes: Input the sample traffic flow set into the time series decomposition module to obtain a sample flow trend set and a sample flow residual set output by the time series decomposition module; Inputting the sample feature set, the sample flow trend set and the sample flow residual set into the fusion module to obtain a sample fusion data set output by the fusion module; The sample fusion data set is input into the multi-feature collaborative module to obtain the model prediction result output by the multi-feature collaborative module.

12. A traffic flow prediction device, comprising: A first acquisition unit is used to acquire a historical traffic flow set corresponding to a target lane, wherein the historical traffic flow set includes a historical traffic flow corresponding to at least one historical moment; A first processing unit, configured to obtain a target feature data set corresponding to the target lane according to the at least one historical moment; A second processing unit is used to obtain a target flow trend set and a target flow residual set corresponding to the target lane according to the historical traffic flow set; A third processing unit, configured to obtain a target fusion data set corresponding to the target lane according to the target feature set, the target flow trend set and the target flow residual set; The prediction unit is used to obtain a target traffic flow prediction result corresponding to the target lane according to the target fusion data set.

13. The device according to claim 12, wherein: When the first processing unit obtains the target feature data set corresponding to the target lane according to the at least one historical moment, specifically performs: For each historical moment, obtaining a target map corresponding to the target lane at the current historical moment; Performing embedding processing on each node in the target graph to obtain embedding processing results of each node; Obtaining an embedding processing result of a target node corresponding to the target lane as a target space feature corresponding to the current historical moment; A target space feature set corresponding to the target lane is obtained according to the at least one historical moment and the target space features respectively corresponding to the at least one historical moment.

14. The device according to claim 12, wherein: When the first processing unit obtains the target feature data set corresponding to the target lane according to the at least one historical moment, specifically performs: For each historical moment, obtaining the target time feature of the target lane corresponding to the current historical moment; A target time feature set corresponding to the target lane is obtained according to the at least one historical moment and the target time features respectively corresponding to the at least one historical moment.

15. The device according to claim 12, wherein: When the second prediction unit obtains the target traffic flow trend set corresponding to the target lane according to the historical traffic flow set, the second prediction unit specifically performs: According to each historical traffic flow in the historical traffic flow set, initial traffic flow trend data corresponding to different historical moments are obtained; Obtaining an initial traffic trend set according to the initial traffic trend data corresponding to different historical moments; The initial flow trend set is linearly transformed to obtain the target flow trend set.

16. The device according to claim 15, wherein: When the second processing unit obtains the target traffic flow residual set corresponding to the target lane according to the historical traffic flow set, the second processing unit specifically performs: Obtaining the initial traffic trend set; Obtaining an initial traffic flow residual set according to the historical traffic flow set and the initial traffic flow trend set; The initial flow residual set is linearly transformed to obtain the target flow residual set.

17. The device according to claim 12, wherein: When the prediction unit obtains the target traffic flow prediction result corresponding to the target lane according to the target fusion data set, the prediction unit specifically performs: According to the target fusion data set, a query vector, a key vector and a value vector are obtained; Using the query matrix, the key matrix and the value matrix corresponding to each attention head, respectively, performing attention calculation according to the query vector, the key vector and the value vector, to obtain the attention calculation results corresponding to each attention head; According to the multiple attention calculation results and the preset weight matrix, a target traffic flow prediction result corresponding to the target lane is obtained.

18. The device according to claim 12, wherein: When the second processing unit obtains the target traffic flow trend set and the target traffic flow residual set corresponding to the target lane according to the historical traffic flow set, the second processing unit specifically performs: Inputting the historical traffic flow set into a time series decomposition module in a pre-trained prediction model; According to the output result of the time series decomposition module, the target flow trend set and the target flow residual set are obtained.

19. The device according to claim 12, wherein: When the third processing unit obtains the target fusion data set corresponding to the target lane according to the target feature set, the target flow trend set and the target flow residual set, the third processing unit specifically performs: Inputting the target feature set, the target flow trend set and the target flow residual set into a fusion module in a pre-trained prediction model; According to the output result of the fusion module, the target fusion data set is obtained.

20. The device according to claim 12, wherein: When the prediction unit obtains the target traffic flow prediction result corresponding to the target lane according to the target fusion data set, the prediction unit specifically performs: Inputting the target fusion data set into a multi-feature collaborative module in a pre-trained prediction model; The target traffic flow prediction result is obtained according to the output result of the multi-feature collaborative module.

21. A prediction model training device, comprising: A second acquisition unit is used to acquire a training data set, wherein the training data set includes a sample historical traffic flow set, a sample feature set and a sample traffic flow prediction result corresponding to different sample lanes; A construction unit, used to construct a neural network model including a time series decomposition module, a fusion module and a multi-feature collaboration module; A fourth processing unit, used for inputting the sample traffic flow set and the sample feature set into the neural network model to obtain a model prediction result output by the neural network model; A determination unit, configured to obtain missing information of traffic flow data according to the sample historical traffic flow set; A fifth processing unit, configured to obtain a loss function value according to the traffic flow data missing information, the sample traffic flow prediction result and the model prediction result; A training unit is used to update the parameters of the neural network model according to the loss function value to obtain a prediction model.

22. The device according to claim 21, wherein When the fourth processing unit inputs the sample traffic flow set and the sample feature set into the neural network model to obtain the model prediction result output by the neural network model, the fourth processing unit specifically performs: Input the sample traffic flow set into the time series decomposition module to obtain a sample flow trend set and a sample flow residual set output by the time series decomposition module; Inputting the sample feature set, the sample flow trend set and the sample flow residual set into the fusion module to obtain a sample fusion data set output by the fusion module; The sample fusion data set is input into the multi-feature collaborative module to obtain the model prediction result output by the multi-feature collaborative module.

23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.

24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 11.

25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Dynamic setting method and device of check points and storage medium

    CN120087413A

  • A method, device and storage medium for dynamically setting checkpoints

    CN120087413B