Training method, device and electronic device for traffic prediction model

By introducing the characteristic data of influencing factors into the input layer of the traffic prediction model and performing feature fusion, the problem that existing models cannot effectively utilize the characteristics of influencing factors is solved, and the accuracy and performance of traffic prediction are improved.

CN113762578BActive Publication Date: 2024-10-22JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202011584094.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2024-10-22
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

Existing traffic prediction models cannot accurately reflect the impact of characteristic data of influencing factors on predicted traffic, resulting in poor prediction performance.

Method used

Introduce the characteristic data of influencing factors into the input layer of the traffic prediction model, fuse the historical traffic characteristics with the characteristic data of influencing factors, and generate vector representations through multi-layer feature extraction and nonlinear transformation processing. Finally, based on the error of prediction and label traffic Adjust model parameters.

Benefits of technology

It improves the performance of the traffic prediction model, can more accurately reflect the impact of influencing factors on the predicted traffic, and enhances the accuracy of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113762578B_ABST
    Figure CN113762578B_ABST
Patent Text Reader

Abstract

The present application proposes a training method, device and electronic device for a traffic prediction model, wherein the training method includes: obtaining the historical traffic characteristics of each area, as well as the characteristic data of the factors affecting the regional traffic, and inputting them into the traffic prediction model; in the traffic prediction model, for each area, the historical traffic characteristics and characteristic data of each area are feature fused to obtain the predicted traffic corresponding to each area; according to the predicted traffic and label traffic corresponding to each area, the traffic prediction model is adjusted to obtain the target traffic prediction model. Thus, the method can introduce the influence of the characteristic data of the influencing factors on the predicted traffic of each area starting from the input layer of the model, thereby introducing the characteristic data of the influencing factors in the entire process of the model, and fusing the historical traffic characteristics and characteristic data of each area, which can accurately reflect the influence of the characteristic data on the predicted traffic, which is conducive to improving the performance of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of deep learning technology, and in particular to a training method, device, electronic device and storage medium for a traffic prediction model. Background Art

[0002] At present, traffic prediction technology is widely used in the fields of traffic planning, data statistics, etc. For example, traffic prediction technology can be used to predict the flow of people in multiple areas of a city, and public transportation facilities such as bus stops, subway stations, and public bicycles can be set up in areas with high flow of people. Most of the traffic prediction methods in related technologies use models to predict traffic. However, the traffic prediction models in related technologies cannot accurately reflect the impact of the characteristic data of influencing factors on the predicted traffic, which is not conducive to the performance of the traffic prediction models. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] To this end, the first aspect of the present application proposes a training method for a traffic prediction model, in which the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic are input into the traffic prediction model. The influence of the characteristic data of the influencing factors on the predicted traffic of each area can be introduced starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and merging the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0005] The second embodiment of the present application proposes a training device for a traffic prediction model.

[0006] A third aspect of the present application provides an electronic device.

[0007] The fourth aspect of the present application provides a computer-readable storage medium.

[0008] The first aspect of the present application proposes a method for training a traffic prediction model, including: obtaining historical traffic characteristics of each area, and feature data of factors affecting regional traffic, and inputting them into the traffic prediction model; in the traffic prediction model, for each area, performing feature fusion on the historical traffic characteristics and the feature data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area; adjusting the traffic prediction model according to the predicted traffic and label traffic corresponding to each area to obtain a target traffic prediction model.

[0009] According to the training method of the traffic prediction model of the embodiment of the present application, the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic are input into the traffic prediction model. The influence of the characteristic data of the influencing factors on the predicted traffic of each area can be introduced starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and merging the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0010] In addition, the training method of the traffic prediction model according to the above embodiment of the present application may also have the following additional technical features:

[0011] In one embodiment of the present application, the traffic prediction model includes N feature extraction layers, and the Nth layer outputs the predicted traffic for each area. Then, in the traffic prediction model, for each area, the historical traffic characteristics and the feature data of each area are subjected to feature fusion, including: for each area at the i-th layer, the traffic characteristics of each area at the previous layer and the feature data of the influencing factors at the previous layer are fused to obtain the traffic characteristics of each area at the i-th layer, where N≥i≥1.

[0012] In one embodiment of the present application, the flow characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer are fused to obtain the flow characteristics of each area in the i-th layer, including: obtaining the weight set of the i-th layer output after the last training in the flow prediction model, wherein the weight set includes the weights corresponding to each area and the influencing factors on the i-th layer; based on the weight set, the flow characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer are weightedly fused to obtain the flow characteristics of each area in the i-th layer.

[0013] In one embodiment of the present application, in the traffic prediction model, before performing feature fusion on the historical traffic characteristics and the feature data of each area, it also includes: respectively obtaining vector representations of the historical traffic characteristics and the feature data of the influencing factors of each area.

[0014] In one embodiment of the present application, the vector representation of the characteristic data of the historical traffic characteristics and the influencing factors of each area is obtained respectively, including: based on the nonlinear function in the traffic prediction model and the nonlinear change parameters of the previous layer output after the last training of the traffic prediction model, the historical traffic characteristics and the characteristic data of the influencing factors are nonlinearly converted to generate the vector representation.

[0015] In one embodiment of the present application, the traffic prediction model is adjusted according to the predicted traffic and label traffic corresponding to each area, including: obtaining the error between the predicted traffic and the label traffic corresponding to each area, and obtaining the loss function of the traffic prediction model based on the error; obtaining the gradient information of the model parameters of the predicted traffic model based on the loss function; updating the model parameters of the predicted traffic model based on the gradient information, wherein the model parameters include the weight set of each layer in the N feature extraction layers and the nonlinear change parameters.

[0016] In one embodiment of the present application, before adjusting the traffic prediction model according to the predicted traffic and label traffic corresponding to each area, it also includes: determining the respective label traffic based on the historical traffic corresponding to each area.

[0017] In one embodiment of the present application, the characteristic data of the influencing factor is historical characteristic data of the influencing factor or predicted characteristic data of the influencing factor.

[0018] The second aspect of the present application proposes a training device for a traffic prediction model, including: an acquisition module, used to obtain the historical traffic characteristics of each area, and the characteristic data of the factors affecting the regional traffic, and input them into the traffic prediction model; a prediction module, used to perform feature fusion on the historical traffic characteristics and the characteristic data of each area in the traffic prediction model for each area, so as to obtain the predicted traffic of the traffic prediction model corresponding to each area; an adjustment module, used to adjust the traffic prediction model according to the predicted traffic and label traffic corresponding to each area, so as to obtain the target traffic prediction model.

[0019] The training device of the traffic prediction model of the embodiment of the present application inputs the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic into the traffic prediction model, and can introduce the influence of the characteristic data of the influencing factors on the predicted traffic of each area starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the whole process of the traffic prediction model, and fusing the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0020] In addition, the training device of the traffic prediction model according to the above embodiment of the present application may also have the following additional technical features:

[0021] In one embodiment of the present application, the traffic prediction model includes N feature extraction layers, and the Nth layer outputs the predicted traffic of each area. The prediction module includes: a fusion unit, which is used to fuse the traffic characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer for each area in the i-th layer to obtain the traffic characteristics of each area in the i-th layer, where N≥i≥1.

[0022] In one embodiment of the present application, the fusion unit is specifically used to: obtain the weight set of the i-th layer output after the last training in the traffic prediction model, wherein the weight set includes the weights corresponding to each area on the i-th layer and the influencing factors; based on the weight set, perform weighted fusion on the traffic characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer to obtain the traffic characteristics of each area in the i-th layer.

[0023] In one embodiment of the present application, the prediction module includes: a first acquisition unit, configured to respectively acquire vector representations of the historical traffic characteristics and the characteristic data of the influencing factors of each area.

[0024] In one embodiment of the present application, the first acquisition unit is specifically used to: perform nonlinear conversion processing on the characteristic data of the historical traffic characteristics and the influencing factors based on the nonlinear function in the traffic prediction model and the nonlinear change parameters of the previous layer output after the last training of the traffic prediction model, so as to generate the vector representation.

[0025] In one embodiment of the present application, the adjustment module includes: a second acquisition unit, used to obtain the error between the predicted traffic and the label traffic corresponding to each area, and based on the error, obtain the loss function of the traffic prediction model; a third acquisition unit, used to obtain the gradient information of the model parameters of the predicted traffic model based on the loss function; an update unit, used to update the model parameters of the predicted traffic model based on the gradient information, wherein the model parameters include the weight set of each layer in the N feature extraction layers and the nonlinear change parameters.

[0026] In one embodiment of the present application, the adjustment module is further used to: determine the respective label traffic based on the historical traffic corresponding to each area.

[0027] In one embodiment of the present application, the characteristic data of the influencing factor is historical characteristic data of the influencing factor or predicted characteristic data of the influencing factor.

[0028] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the training method of the traffic prediction model as described in the first aspect of the present application is implemented.

[0029] The electronic device of the embodiment of the present application executes a computer program stored in a memory through a processor, inputs the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic into the traffic prediction model, and can introduce the influence of the characteristic data of the influencing factors on the predicted traffic of each area starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and merging the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the relatively lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0030] The fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the training method of the traffic prediction model as described in the first aspect of the present application is implemented.

[0031] The computer-readable storage medium of the embodiment of the present application stores a computer program and is executed by a processor, and inputs the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic into the traffic prediction model. The influence of the characteristic data of the influencing factors on the predicted traffic of each area can be introduced starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and merging the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the relatively lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0032] Additional aspects and advantages of the present application will be given in part in the following description, and in part will become apparent from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0034] Figure 1 A flow chart of a method for training a traffic prediction model according to an embodiment of the present application;

[0035] Figure 2 A schematic diagram of a flow chart of obtaining the traffic characteristics of each area at the i-th layer in a training method of a traffic prediction model according to an embodiment of the present application;

[0036] Figure 3 A schematic diagram of a flow chart of adjusting a traffic prediction model in a traffic prediction model training method according to an embodiment of the present application;

[0037] Figure 4 A schematic diagram of the structure of a traffic prediction model in a traffic prediction model training method according to an embodiment of the present application;

[0038] Figure 5 A schematic diagram of the structure of a training device for a traffic prediction model according to an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of a training device for a traffic prediction model according to another embodiment of the present application;

[0040] Figure 7 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0041] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0042] The following describes the training method, device, electronic device and storage medium of the traffic prediction model of the embodiments of the present application with reference to the accompanying drawings.

[0043] Figure 1 The figure is a flowchart of a method for training a traffic prediction model according to an embodiment of the present application.

[0044] like Figure 1 As shown, the training method of the traffic prediction model of the embodiment of the present application includes:

[0045] S101, obtaining historical traffic characteristics of each area and characteristic data of factors affecting regional traffic, and inputting them into a traffic prediction model.

[0046] It should be noted that the execution subject of the training method of the traffic prediction model of the embodiment of the present application may be a training device of the traffic prediction model, and the training device of the traffic prediction model of the embodiment of the present application may be configured in any electronic device so that the electronic device can execute the training method of the traffic prediction model of the embodiment of the present application. Among them, the electronic device may be a personal computer (PC for short), a cloud device, a mobile device, etc., and the mobile device may be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a vehicle-mounted device, and other hardware devices with various operating systems, touch screens, and / or display screens.

[0047] In the embodiments of the present application, the area division can be performed according to the actual situation. For example, it can be divided according to the functional areas of the city, such as administrative areas, entertainment areas, shopping areas, residential areas, etc. Alternatively, the area division can also be performed according to the administrative areas at all levels and the traffic route information, wherein the traffic route information includes but is not limited to the main roads of the city, traffic intersections, etc.

[0048] In the embodiments of the present application, there is no limitation on the type of historical traffic characteristics of each area. For example, historical traffic characteristics include but are not limited to pedestrian traffic characteristics, vehicle traffic characteristics, etc.

[0049] It is understandable that different areas may correspond to different historical traffic characteristics. For example, assuming that the divided areas include Company A and Park B, and the historical traffic characteristics are human traffic characteristics, then the human traffic characteristics of Company A during the working hours on weekdays (for example, 8 am to 9 am) are clustered characteristics, and the human traffic characteristics of Company A during the off-duty hours on weekdays (for example, 6 pm to 7 pm) are dispersed characteristics, while Park B does not have clustered characteristics and dispersed characteristics during the working hours and off-duty hours on weekdays. It can be seen that Company A and Park B may correspond to different historical traffic characteristics.

[0050] In the embodiments of the present application, the types of influencing factors affecting regional flow are not limited, and the types of characteristic data of influencing factors are not limited. Optionally, the influencing factors include but are not limited to weather, date, location, transportation facilities, etc. For example, when the influencing factor is weather, the corresponding characteristic data may include temperature, wind direction, wind force, humidity, etc. When the influencing factor is date, the corresponding characteristic data may include working days and holidays. When the influencing factor is transportation facilities, the corresponding characteristic data may include bus lines, subway lines, high-speed lines, etc.

[0051] Optionally, the characteristic data of the influencing factor may be the historical characteristic data of the influencing factor or the predicted characteristic data of the influencing factor. For example, when the influencing factor is weather, the corresponding characteristic data may be the historical characteristic data of weather, such as historical temperature, historical wind direction, historical humidity, etc., or the corresponding characteristic data may also be the predicted characteristic data of weather, such as predicted temperature, predicted wind direction, predicted humidity, etc.

[0052] In the embodiments of the present application, different regions may correspond to different influencing factors and feature data corresponding to different influencing factors. Compared with the related art of using the same feature data of influencing factors for model training between different regions, different feature data of influencing factors may be used for model training for different regions, which helps to improve the accuracy of the model.

[0053] In the embodiment of the present application, the historical traffic characteristics of each area and the characteristic data of the factors affecting the regional traffic can be input into the traffic prediction model. The traffic prediction model can be set according to the actual situation, for example, it can be a deep learning model, the traffic prediction model can be constructed based on the TensorFlow platform, and it can also be an STMP (Spatio-Temporal Multiple Points) prediction model.

[0054] S102, in the traffic prediction model, for each area, feature fusion is performed on the historical traffic features and feature data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area.

[0055] Most of the traffic prediction models in related technologies only introduce the characteristic data of influencing factors in the final stage of the model. The fusion of the characteristic data of influencing factors and historical traffic characteristics is relatively delayed, which makes it impossible to accurately reflect the impact of the characteristic data of influencing factors on the predicted traffic, which is not conducive to the performance of the traffic prediction model.

[0056] In order to solve this problem, in an embodiment of the present application, the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic can be input into the traffic prediction model, and the traffic prediction model can perform feature fusion on the historical traffic characteristics and characteristic data of each area for each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. In other words, the influence of the characteristic data of the influencing factors on the predicted traffic of each area can be introduced starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and fusion of the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area, which can effectively solve the problem of the lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0057] S103, adjusting the traffic prediction model according to the predicted traffic and label traffic corresponding to each area to obtain a target traffic prediction model.

[0058] In an embodiment of the present application, the label traffic corresponding to each area is the actual reference traffic of the predicted traffic. Optionally, the respective label traffic can be determined based on the historical traffic corresponding to each area. For example, the historical traffic corresponding to the most recent N times can be obtained for each area, and the historical traffic with the most occurrences in the most recent N times of historical traffic or the average of the most recent N times of historical traffic can be used as the label traffic corresponding to each area. Alternatively, the most recent 1 historical traffic corresponding to each area can be obtained and used as the label traffic corresponding to each area. Wherein, N is a positive integer and can be set according to actual conditions. For example, N can be 3.

[0059] It is understandable that there may be errors between the predicted traffic and label traffic corresponding to each area. The model parameters of the traffic prediction model can be adjusted according to the above errors until the number of model iterations reaches a preset threshold, or reaches a preset stop condition, or reaches a preset model evaluation index. The model training can be stopped and the model obtained at the end of the last adjustment will be used as the target traffic prediction model.

[0060] In summary, according to the training method of the traffic prediction model of the embodiment of the present application, the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic are input into the traffic prediction model. The influence of the characteristic data of the influencing factors on the predicted traffic of each area can be introduced starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and merging the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0061] Based on any of the above embodiments, obtaining the historical traffic characteristics of each area in step S101 may include determining the respective historical traffic characteristics based on the historical traffic corresponding to each area.

[0062] For example, the historical traffic features corresponding to each area can be extracted according to the prior rules, and the extracted features can be used as the historical traffic features corresponding to each area. For example, the historical traffic features of the most recent day corresponding to each area can be extracted, or the historical traffic features of Monday in the most recent three weeks in each area can be extracted, or the historical traffic features of July in the most recent three years in each area can be extracted.

[0063] Optionally, determining the respective historical traffic characteristics based on the historical traffic corresponding to each area may include extracting neighbor characteristics and periodic characteristics of the historical traffic corresponding to each area at a preset frequency, and using the extracted neighbor characteristics and periodic characteristics as the historical traffic characteristics corresponding to each area.

[0064] Among them, the neighbor feature refers to the historical traffic feature closest to the current moment, and the periodic feature refers to the historical traffic feature corresponding to the same moment in multiple periods. For example, assuming the preset frequency is 1 and the current moment is t, the neighbor feature may include the historical traffic features corresponding to the moments t-1, t-2, t-3, t-4, t-5, t-6, and t-7. The periodic feature with a preset frequency of 7 and a number of time slices of 2 may include the historical traffic features corresponding to the moments t-7 and t-14.

[0065] Based on any of the above embodiments, the traffic prediction model may include N feature extraction layers, and the Nth layer outputs the predicted traffic of each area. It can be understood that the traffic prediction model can realize different levels of traffic feature extraction through N feature extraction layers, and the i-th layer outputs the traffic features of each area at the i-th layer and the feature data of the influencing factors at the i-th layer, where N≥i≥1, N is a positive integer and can be set according to actual conditions.

[0066] Optionally, the N feature extraction layers may adopt a fully connected neural network (FCNN) structure.

[0067] Furthermore, in the traffic prediction model in step S102, for each area, feature fusion is performed on the historical traffic characteristics and feature data of each area, which may include fusing the traffic characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer for each area at the i-th layer to obtain the traffic characteristics of each area at the i-th layer, where N≥i≥1.

[0068] Therefore, the traffic characteristics of each area in the previous layer and the characteristic data of the influencing factors in the previous layer can be fused to obtain the traffic characteristics of each area in the i-th layer.

[0069] Optional, such as Figure 2 As shown, the traffic characteristics of each area in the previous layer and the characteristic data of the influencing factors in the previous layer are fused to obtain the traffic characteristics of each area in the i-th layer, which may include:

[0070] S201, obtaining a weight set of the i-th layer output after the last training in the traffic prediction model, wherein the weight set includes weights corresponding to each area and influencing factor on the i-th layer.

[0071] In an embodiment of the present application, the traffic prediction model can output a weight set of the i-th layer after the last training, and the weight set includes weights corresponding to each area and influencing factor on the i-th layer.

[0072] It is understandable that each region and influencing factor on the i-th layer may correspond to a different weight.

[0073] S202, based on the weight set, weighted fusion is performed on the flow characteristics of each area in the previous layer and the characteristic data of the influencing factors in the previous layer to obtain the flow characteristics of each area in the i-th layer.

[0074] It can be understood that based on the weight set, the traffic characteristics of each area in the previous layer and the characteristic data of the influencing factors in the previous layer are weighted and fused to obtain the traffic characteristics of each area in the i-th layer, which may include obtaining the first product sum of the traffic characteristics of each area in the previous layer and the corresponding weights, and the second product sum of the characteristic data of the influencing factors in the previous layer and the corresponding weights, and taking the sum of the first product sum and the second product sum as the traffic characteristics of each area in the i-th layer.

[0075] For example, if there are three areas, namely area A, area B, and area C, the flow of area A is equal to the sum of the flow of area B and the flow of area C. Then the flow characteristics of area A at the i-th layer can be calculated by the following formula:

[0076]

[0077] in, is the traffic characteristics of area A at layer i, is the traffic characteristics of region A at layer i-1, is the traffic characteristics of region B at layer i-1, is the traffic characteristic of region C at layer i-1, Y i-1 is the characteristic data of the influencing factors at the i-1 layer, k0, k1, k2, and k3 are the weights corresponding to region A, region B, region C, and influencing factors at the i-th layer, respectively.

[0078] Therefore, this method can perform weighted fusion on the traffic characteristics of each region in the previous layer and the characteristic data of the influencing factors in the previous layer according to the weight set composed of the weights corresponding to each region and the influencing factors on the i-th layer, so as to obtain the traffic characteristics of each region in the i-th layer, which can take into account the impact of different regions on the traffic characteristics.

[0079] Based on any of the above embodiments, in the traffic prediction model in step S102, before feature fusion of the historical traffic characteristics and feature data of each area, it also includes obtaining vector representations of the historical traffic characteristics and feature data of influencing factors of each area.

[0080] It can be understood that the characteristic data of the historical traffic characteristics and the influencing factors of each area can be in the form of vectors, and the vector representations of the characteristic data of the historical traffic characteristics and the influencing factors of each area can be obtained respectively.

[0081] Optionally, vector representations of the characteristic data of historical traffic characteristics and influencing factors of each area are obtained respectively, which may include performing nonlinear transformation processing on the characteristic data of historical traffic characteristics and influencing factors based on the nonlinear function in the traffic prediction model and the nonlinear change parameters of the previous layer output after the last training of the traffic prediction model to generate a vector representation.

[0082] In an embodiment of the present application, the traffic prediction model can output the nonlinear change parameters of the i-th layer after the last training, where N≥i≥1.

[0083] Optionally, the nonlinear function may be set according to actual conditions, for example, may be set to σ(x)=max(0,x).

[0084] In the embodiment of the present application, different regions may share the same nonlinear change parameters to reduce model parameter data and reduce the complexity of model optimization.

[0085] Therefore, this method can perform nonlinear transformation processing on the characteristic data of historical traffic characteristics and influencing factors to generate vector representation, thereby improving the nonlinear ability of the model.

[0086] Based on any of the above embodiments, Figure 3 As shown, in step S103, adjusting the traffic prediction model according to the predicted traffic and label traffic corresponding to each area may include:

[0087] S301, obtaining the error between the predicted traffic and the label traffic corresponding to each area, and based on the error, obtaining the loss function of the traffic prediction model.

[0088] Optionally, a forward propagation algorithm and the above-mentioned error and loss function of a computer traffic prediction model may be used.

[0089] S302: Based on the loss function, obtain the gradient information of the model parameters of the traffic prediction model.

[0090] It can be understood that the number of model parameters is at least one, and the gradient information of each model parameter of the predicted traffic model can be obtained based on the loss function.

[0091] Optionally, at least one model parameter optimizer may be pre-built, and based on the loss function, the gradient information of each model parameter corresponding to each model parameter optimizer may be obtained.

[0092] For example, assuming that two model parameter optimizers are set in advance, namely model parameter optimizer A and model parameter optimizer B, model parameter optimizer A is used to optimize nonlinear change parameters, and model parameter optimizer B is used to optimize model structure parameters, then the gradient information of each model parameter corresponding to model parameter optimizers A and B can be obtained based on the loss function.

[0093] S303, updating the model parameters of the traffic prediction model based on the gradient information, wherein the model parameters include a weight set of each layer in the N feature extraction layers and a nonlinear change parameter.

[0094] In the embodiment of the present application, the model parameters may include a weight set and nonlinear change parameters of each layer in the N feature extraction layers, and may also include model structure parameters, etc., which are not limited here. Among them, the model structure parameters are used to determine the impact of different features on traffic prediction.

[0095] Therefore, this method can obtain the error between the predicted traffic and the label traffic corresponding to each area, obtain the loss function of the traffic prediction model based on the error, obtain the gradient information of the model parameters of the predicted traffic model based on the loss function, and update the model parameters of the predicted traffic model based on the gradient information.

[0096] like Figure 4 As shown, the traffic prediction model includes a representation learning layer and feature extraction layers 1 to 3. The historical traffic characteristics of each region and the feature data of the factors affecting the regional traffic can be input into the representation learning layer, and the vector representation of the historical traffic characteristics and the feature data of the influencing factors of each region are obtained through the representation learning layer. The historical traffic characteristics and feature data of each region are fused for each region through each feature extraction layer to obtain the traffic characteristics of each region in each feature extraction layer, and the feature extraction layer 3 outputs the predicted traffic of each region.

[0097] With the above Figures 1 to 4 Corresponding to the training method of the flow prediction model provided in the embodiment, the present disclosure also provides a training device for the flow prediction model. Figures 1 to 4 The training method of the traffic prediction model provided in the embodiment corresponds to the embodiment, so the implementation method of the traffic prediction model training method is also applicable to the training device of the traffic prediction model provided in the embodiment of the present disclosure, and will not be described in detail in the embodiment of the present disclosure.

[0098] Figure 5 It is a structural schematic diagram of a training device for a traffic prediction model according to an embodiment of the present application.

[0099] like Figure 5 As shown, the training device 100 of the traffic prediction model in the embodiment of the present application may include: an acquisition module 110, a prediction module 120 and an adjustment module 130.

[0100] The acquisition module 110 is used to acquire the historical traffic characteristics of each area and the characteristic data of the factors affecting the regional traffic, and input them into the traffic prediction model;

[0101] The prediction module 120 is used to perform feature fusion on the historical traffic features and the feature data of each area in the traffic prediction model to obtain the predicted traffic of the traffic prediction model corresponding to each area;

[0102] The adjustment module 130 is used to adjust the traffic prediction model according to the predicted traffic and label traffic corresponding to each area to obtain a target traffic prediction model.

[0103] In one embodiment of the present application, the traffic prediction model includes N feature extraction layers, and the Nth layer outputs the predicted traffic of each area. Figure 6 As shown, the prediction module 120 includes: a fusion unit 1201, which is used to fuse the traffic characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer for each area in the i-th layer, so as to obtain the traffic characteristics of each area in the i-th layer, wherein N≥i≥1.

[0104] In one embodiment of the present application, the fusion unit 1201 is specifically used to: obtain the weight set of the i-th layer output after the last training in the traffic prediction model, wherein the weight set includes the weights corresponding to each area on the i-th layer and the influencing factors; based on the weight set, the traffic characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer are weightedly fused to obtain the traffic characteristics of each area in the i-th layer.

[0105] In one embodiment of the present application, Figure 6 As shown, the prediction module 120 includes: a first acquisition unit 1202, which is used to respectively obtain the vector representation of the characteristic data of the historical traffic characteristics and the influencing factors of each area.

[0106] In one embodiment of the present application, the first acquisition unit 1202 is specifically used to: perform nonlinear transformation processing on the characteristic data of the historical traffic characteristics and the influencing factors based on the nonlinear function in the traffic prediction model and the nonlinear change parameters of the previous layer output after the last training of the traffic prediction model, so as to generate the vector representation.

[0107] In one embodiment of the present application, Figure 6 As shown, the adjustment module 130 includes: a second acquisition unit 1301, used to obtain the error between the predicted traffic and the label traffic corresponding to each area, and based on the error, obtain the loss function of the traffic prediction model; a third acquisition unit 1302, used to obtain the gradient information of the model parameters of the predicted traffic model based on the loss function; an updating unit 1303, used to update the model parameters of the predicted traffic model based on the gradient information, wherein the model parameters include the weight set of each layer in the N feature extraction layers and the nonlinear change parameters.

[0108] In one embodiment of the present application, the adjustment module 130 is further configured to determine the respective label traffic based on the historical traffic corresponding to each area.

[0109] In one embodiment of the present application, the characteristic data of the influencing factor is historical characteristic data of the influencing factor or predicted characteristic data of the influencing factor.

[0110] The training device of the traffic prediction model of the embodiment of the present application inputs the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic into the traffic prediction model, and can introduce the influence of the characteristic data of the influencing factors on the predicted traffic of each area starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the whole process of the traffic prediction model, and fusing the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0111] In order to implement the above embodiment, Figure 7 As shown, the present application also proposes an electronic device 200, comprising: a memory 210, a processor 220, and a computer program stored in the memory 210 and executable on the processor 220. When the processor 220 executes the program, it implements the training method of the traffic prediction model proposed in the aforementioned embodiment of the present application.

[0112] The electronic device of the embodiment of the present application executes a computer program stored in a memory through a processor, inputs the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic into the traffic prediction model, and can introduce the influence of the characteristic data of the influencing factors on the predicted traffic of each area starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and merging the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the relatively lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0113] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the training method of the traffic prediction model proposed in the above embodiments of the present application is implemented.

[0114] The computer-readable storage medium of the embodiment of the present application stores a computer program and is executed by a processor, and inputs the historical traffic characteristics of each area and the characteristic data of the influencing factors affecting the regional traffic into the traffic prediction model. The influence of the characteristic data of the influencing factors on the predicted traffic of each area can be introduced starting from the input layer of the traffic prediction model, thereby introducing the characteristic data of the influencing factors in the entire process of the traffic prediction model, and merging the historical traffic characteristics and characteristic data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area. This can effectively solve the problem of the relatively lagging fusion of the characteristic data of the influencing factors and the historical traffic characteristics in the related technology, can accurately reflect the influence of the characteristic data of the influencing factors on the predicted traffic, and is conducive to improving the performance of the traffic prediction model.

[0115] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0116] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0117] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0118] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0119] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0120] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0121] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0122] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for training a traffic prediction model, characterized in that: include: Obtaining historical traffic characteristics of each area and characteristic data of factors affecting regional traffic, and inputting them into the traffic prediction model, wherein different areas correspond to different influencing factors and characteristic data corresponding to different influencing factors; In the traffic prediction model, for each area, the historical traffic features and the feature data of each area are subjected to feature fusion to obtain the predicted traffic of the traffic prediction model corresponding to each area; According to the predicted traffic and label traffic corresponding to each area, the traffic prediction model is adjusted to obtain a target traffic prediction model; The traffic prediction model includes N feature extraction layers, and the Nth layer outputs the predicted traffic of each area. Then, in the traffic prediction model, for each area, the historical traffic features and the feature data of each area are subjected to feature fusion, including: Obtaining a weight set of the i-th layer output after the last training in the traffic prediction model, wherein the weight set includes weights corresponding to each area on the i-th layer and the influencing factors; For each region at the i-th layer, based on the weight set, the flow characteristics of each region at the previous layer and the characteristic data of the influencing factors at the previous layer are weightedly fused to obtain the flow characteristics of each region at the i-th layer.

2. The method for training a traffic prediction model according to claim 1, characterized in that: In the traffic prediction model, for each area, before the historical traffic features and the feature data of each area are fused, the method further includes: The vector representation of the characteristic data of the historical traffic characteristics and the influencing factors of each area is obtained respectively.

3. The training method of the traffic prediction model according to claim 2, characterized in that: The step of respectively obtaining the vector representation of the characteristic data of the historical traffic characteristics and the influencing factors of each area includes: Based on the nonlinear function in the traffic prediction model and the nonlinear change parameters of the previous layer output after the last training of the traffic prediction model, the feature data of the historical traffic characteristics and the influencing factors are nonlinearly transformed to generate the vector representation.

4. The method for training a traffic prediction model according to claim 3, characterized in that: The adjusting the traffic prediction model according to the predicted traffic and label traffic corresponding to each area includes: Obtain an error between the predicted traffic and the label traffic corresponding to each area, and based on the error, obtain a loss function of the traffic prediction model; Based on the loss function, obtaining gradient information of model parameters of the traffic prediction model; The model parameters of the traffic prediction model are updated based on the gradient information, wherein the model parameters include a weight set of each layer in the N feature extraction layers and the nonlinear change parameters.

5. The method for training a traffic prediction model according to claim 1, characterized in that: Before adjusting the traffic prediction model according to the predicted traffic and label traffic corresponding to each area, the method further includes: The respective label traffic is determined based on the historical traffic corresponding to each area.

6. The method for training a traffic prediction model according to claim 1, characterized in that: The characteristic data of the influencing factor is the historical characteristic data of the influencing factor or the predicted characteristic data of the influencing factor.

7. A training device for a traffic prediction model, characterized in that: include: An acquisition module, used to acquire the historical traffic characteristics of each area and the characteristic data of the factors affecting the regional traffic, and input them into the traffic prediction model, wherein different areas correspond to different influencing factors and the characteristic data corresponding to different influencing factors; A prediction module, used for, in the traffic prediction model, for each area, performing feature fusion on the historical traffic features and the feature data of each area to obtain the predicted traffic of the traffic prediction model corresponding to each area; An adjustment module, used for adjusting the traffic prediction model according to the predicted traffic and label traffic corresponding to each area to obtain a target traffic prediction model; The traffic prediction model includes N feature extraction layers, and the Nth layer outputs the predicted traffic of each area. The prediction module includes: A fusion unit is used to obtain the weight set of the i-th layer output after the last training in the traffic prediction model, wherein the weight set includes the weights corresponding to each area on the i-th layer and the influencing factors; for each area on the i-th layer, based on the weight set, the traffic characteristics of each area in the previous layer and the feature data of the influencing factors in the previous layer are weighted fused to obtain the traffic characteristics of each area on the i-th layer.

8. The training device for the traffic prediction model according to claim 7, characterized in that: The prediction module comprises: The first acquisition unit is used to respectively acquire the vector representation of the characteristic data of the historical traffic characteristics and the influencing factors of each area.

9. The training device for the traffic prediction model according to claim 8, characterized in that: The first acquisition unit is specifically used to: Based on the nonlinear function in the traffic prediction model and the nonlinear change parameters of the previous layer output after the last training of the traffic prediction model, the feature data of the historical traffic characteristics and the influencing factors are nonlinearly transformed to generate the vector representation.

10. The training device for the traffic prediction model according to claim 9, characterized in that: The adjustment module comprises: A second acquisition unit, configured to acquire an error between the predicted traffic and the label traffic corresponding to each area, and acquire a loss function of the traffic prediction model based on the error; A third acquisition unit, configured to acquire gradient information of a model parameter of the traffic prediction model based on the loss function; An updating unit is used to update the model parameters of the predicted traffic model based on the gradient information, wherein the model parameters include a weight set of each layer in the N feature extraction layers and the nonlinear change parameters.

11. The training device for the traffic prediction model according to claim 7, characterized in that: The adjustment module is further used for: The respective label traffic is determined based on the historical traffic corresponding to each area.

12. The training device for the traffic prediction model according to claim 7, characterized in that: The characteristic data of the influencing factor is the historical characteristic data of the influencing factor or the predicted characteristic data of the influencing factor.

13. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the training method of the traffic prediction model as described in any one of claims 1 to 6 is implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a training method for a traffic prediction model as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Traffic flow prediction method, prediction model generation method and device

    CN105788249A

  • Short-term bus passenger flow forecasting method based on in-depth learning and passenger behavior model

    CN109034449A

  • A forecasting method of airport traffic flow based on weather data mining

    CN109409587A

  • Method and device for predicting regional traffic flow

    CN109559512A

  • Prediction method and device, electronic equipment and computer readable storage medium

    CN109800483A