Traffic state prediction method and device
By using historical and current traffic data and data of adjacent road sections as different data sources, training samples are generated and traffic models are trained, and the problem of degradation in traffic prediction results caused by data disturbance is solved, achieving higher prediction accuracy and robustness.
Patent Information
- Application Number
- CN201910228858.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-25
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2039-03-25
AI Technical Summary
When processing traffic data in the prior art, data disturbances lead to a decrease in model prediction effect and fail to obtain robust results.
By using the historical traffic data of the training section, the first time traffic data and the first time traffic data of the adjacent section as different data sources, the characteristics are extracted to generate training sample data, and the traffic is obtained based on the weight of the data source and the weight of the sample, the traffic is obtained through training based on the weight of the data source and the weight of the sample. Model.
It effectively reduces the impact of data perturbations, improves the accuracy of traffic forecasts, and ensures the robustness of the model.
Smart Images

Figure CN111738474B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a traffic state prediction method and device. Background Art
[0002] In recent years, with the development of big data and machine learning technology, all walks of life have begun to apply machine learning technology to model and solve problems in their corresponding scenarios. However, due to the instability of the underlying data source or noise disturbance, a common problem is inevitable: in the modeling and learning stage, the data source and samples are optimized, which is a learning under a more "ideal" condition. However, after the model is actually launched, various data disturbance problems occur due to various reasons, resulting in poor results after the model is launched, which leads to a series of subsequent problems. As a specific example, in the case of traffic congestion, we can refer to the traffic data of different traffic sections at the same time to build a model, and then predict whether a certain section will be congested in the future. However, after the model is launched, there may be a situation where there is no historical data accumulation or data is missing for a certain section.
[0003] At present, the commonly used methods to solve the data perturbation problem are mainly: (1) Eliminate samples affected by data perturbation during model prediction, that is, eliminate samples with missing features; (2) Fill missing values for samples affected by data perturbation during model prediction, that is, use preset filling values to fill the sample feature values, such as the mean, median, zero value, etc. of the feature value; (3) Select tree models that are relatively insensitive to missing data in the modeling stage, such as random forest, xgboost algorithm (extreme gradient boosting, extreme gradient boosting algorithm), etc. This type of model generally handles the missing values in the features separately to obtain the optimal results.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: (1) For the method of eliminating samples affected by data disturbance problems during model prediction, although the accuracy of prediction can be guaranteed, when the data disturbance is large, the model's scoring coverage of samples will be greatly reduced, resulting in unstable model coverage. For example, when a model uses data from three data sources, when a data source is missing as a whole, the sample coverage of the data source is 0; (2) Filling missing values is a method of sacrificing prediction accuracy to reduce sample loss and improve sample coverage. In the case of actual data disturbance, such an approach often results in a large number of samples being concentrated, and the model is difficult to play its due effect, that is, the actual online model effect is greatly reduced compared to that during training; (3) Training a tree model that is insensitive to missing data has limitations in model selection, and when data sources or features are missing on a large scale, the tree model cannot solve the problem, resulting in a sharp drop in model effect. In summary, the currently commonly used methods cannot completely solve the data disturbance problem and cannot obtain robust results. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a traffic status prediction method and device, which can effectively reduce the impact of data disturbance and improve the accuracy of traffic prediction.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a traffic state prediction method is provided, comprising:
[0007] Determine the training sample data according to the historical traffic data of the training section, the traffic data of the first period, and the traffic data of the first period of the section adjacent to the training section; wherein the historical traffic data is used as the first data source, the traffic data of the first period of the training section is used as the second data source, and the traffic data of the first period of the section adjacent to the training section is used as the third data source;
[0008] According to the training sample data, determining the weight of each data source and the weight of each training sample respectively;
[0009] Based on the training sample data, the weight of each data source, the weight of each training sample and a preset loss function, a traffic model is trained;
[0010] Based on the traffic model, the traffic status of the road section to be predicted is determined.
[0011] Optionally, the process of determining the training sample data includes: extracting features from the first data source, the second data source and the third data source respectively to determine the training sample data; wherein the features include at least one or more of the following: speed, vehicle spacing, lane occupancy and vehicle flow within a preset interval.
[0012] Optionally, the process of determining the weight of each data source includes:
[0013] For each data source, determining the information value and coverage of each feature attributed to the data source;
[0014] Determine the average information value and average coverage of the data source according to the information value and coverage of each feature;
[0015] Normalizing the average information value and average coverage of the first data source, the second data source, and the third data source;
[0016] The weight of each data source is determined based on the normalized average information value and average coverage.
[0017] Optionally, the process of determining the weight of each training sample includes: for each training sample, determining the feature missing rate of the training sample under each data source; and determining the weight of the training sample according to the feature missing rate of the training sample under each data source and the weight of each data source.
[0018] Optionally, the method further comprises: acquiring traffic status data of a second time period of the training section, the second time period being later than the first time period;
[0019] The preset loss function is shown as follows:
[0020]
[0021] Where v represents the number of the data source, n v Indicates the total number of data sources, w v Indicates the weight of the data source numbered v, W v is a matrix whose elements in the i-th row and j-th column represent the weight of the j-th feature of the i-th sample on the data source numbered v. v represents the feature missing matrix of the data source numbered v, U v represents the latent space of the data source numbered v, V represents the representation of the sample data in the latent space, Loss represents the loss function, Y represents the traffic status data of the second time period of the training section, λ1, λ2 and λ3 represent the hyperparameters of the preset traffic model, and S represents the parameters of the preset traffic model.
[0022] Optionally, based on the training sample data, the weight of each data source, the weight of each training sample and a preset loss function, training a traffic model includes:
[0023] Based on the sample data, the weight of each data source, the weight of each training sample and a preset loss function, an alternating optimization algorithm and a convex optimization strategy are used to iteratively train and obtain a traffic model.
[0024] To achieve the above object, according to another aspect of an embodiment of the present invention, a traffic state prediction device is provided, comprising:
[0025] A sample determination module, used to determine training sample data according to historical traffic data of a training section, traffic data of a first period, and traffic data of a section adjacent to the training section during the first period; wherein the historical traffic data is used as a first data source, the traffic data of the training section during the first period is used as a second data source, and the traffic data of the section adjacent to the training section during the first period is used as a third data source;
[0026] A weight determination module, used to determine the weight of each data source and the weight of each training sample according to the training sample data;
[0027] A model training module, used to train a traffic model based on the training sample data, the weight of each data source, the weight of each training sample and a preset loss function;
[0028] The traffic prediction module is used to determine the traffic status of the road section to be predicted based on the traffic model.
[0029] Optionally, the sample determination module is also used to: extract features from the first data source, the second data source and the third data source respectively to determine training sample data; wherein the features include at least one or more of the following: speed, vehicle spacing, lane occupancy and vehicle flow within a preset interval.
[0030] Optionally, the weight determination module is also used to: determine, for each data source, the information value and coverage of each feature attributable to the data source; determine the average information value and average coverage of the data source based on the information value and coverage of each feature; normalize the average information value and average coverage of the first data source, the second data source, and the third data source; and determine the weight of each data source based on the normalized average information value and average coverage.
[0031] Optionally, the weight determination module is further used to: for each training sample, determine the feature missing rate of the training sample under each data source; determine the weight of the training sample according to the feature missing rate of the training sample under each data source and the weight of each data source.
[0032] Optionally, the device further comprises a data acquisition module, configured to acquire traffic status data of a second time period of the training section, wherein the second time period is later than the first time period;
[0033] The preset loss function is shown as follows:
[0034]
[0035] Where v represents the number of the data source, n v Indicates the total number of data sources, w v Indicates the weight of the data source numbered v, W v is a matrix whose elements in the i-th row and j-th column represent the weight of the i-th feature of the i-th sample on the data source numbered v. v represents the feature missing matrix of the data source numbered v, U v represents the latent space of the data source numbered v, V represents the representation of the sample data in the latent space, Loss represents the loss function, Y represents the traffic status data of the second time period of the training section, λ1, λ2 and λ3 represent the hyperparameters of the preset traffic model, and S represents the parameters of the preset traffic model.
[0036] Optionally, the model training module is also used to iteratively train the traffic model using an alternating optimization algorithm and a convex optimization strategy based on the sample data, the weight of each data source, the weight of each training sample and a preset loss function.
[0037] To achieve the above-mentioned purpose, according to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the traffic status prediction method provided by an embodiment of the present invention.
[0038] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the traffic status prediction method provided by an embodiment of the present invention is implemented.
[0039] An embodiment of the above invention has the following advantages or beneficial effects: because the historical traffic data of the training section is used as the first data source, the traffic data of the first time period of the training section is used as the second data source, and the traffic data of the first time period of the section adjacent to the training section is used as the third data source, and features are extracted from the first data source, the second data source and the third data source to generate training sample data; according to the training sample data, the weight of each data source and the weight of each training sample are determined respectively; based on the training sample data, the weight of each data source, the weight of each training sample and the preset loss function, a traffic model is trained to obtain; based on the traffic model, a technical means for determining the traffic state of the section to be predicted can regard the data from different data sources as different characterizations of the sample from different perspectives. In order to integrate the features of each data source, a new representation of a sample is learned by a multi-perspective matrix decomposition method, and then a traffic model is obtained through iterative training. The use of the traffic model can effectively reduce the impact of data disturbance and improve the accuracy of traffic prediction.
[0040] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0042] Figure 1 is a schematic diagram of the main process of a traffic state prediction method according to an embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of adjacent road sections according to a traffic state prediction method according to another embodiment of the present invention;
[0044] Figure 3 is a schematic diagram of a sub-process of a traffic state prediction method according to another embodiment of the present invention;
[0045] Figure 4 is a schematic diagram of a sub-process of a traffic state prediction method according to another embodiment of the present invention;
[0046] Figure 5 is a schematic diagram of matrix decomposition of a traffic state prediction method according to an embodiment of the present invention;
[0047] Figure 6 is a schematic diagram of main modules of a traffic state prediction device according to an embodiment of the present invention;
[0048] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0049] Figure 8It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention 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 invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0051] Figure 1 is a traffic state prediction method according to an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0052] Step S101: Determine training sample data based on historical traffic data of a training section, traffic data of a first period, and traffic data of a section adjacent to the training section during the first period; wherein the historical traffic data is used as a first data source, the traffic data of the training section during the first period is used as a second data source, and the traffic data of the section adjacent to the training section during the first period is used as a third data source.
[0053] In this step, the historical traffic data of the training section, the traffic data of the first period, and the traffic data of the first period of the section adjacent to the training section can be video images taken by a camera or navigation data of a third-party navigation application. The above data may fluctuate or be missing due to noise, data acquisition devices (such as cameras), etc. (such as missing videos due to camera failure). The section adjacent to the training section can be a section that has an intersection with the training section, for example, Figure 2 As shown, the training section is located at an intersection, and the training section can be one or more of the other three sections at the intersection.
[0054] Since the real-time requirement of the traffic system is high, the time period set in this embodiment is at the minute level, for example, the duration of each time period is 20 minutes. If the first time period is 3:10-3:30, the second time period is 3:30-3:50.
[0055] In this embodiment, the historical traffic data may be traffic data earlier than the first time period. For example, if the first time period is 15:00-15:20 on March 20, 2019, the historical traffic data may be video images shot all day on March 19, 2019, or video images shot from 15:00 to 15:20 on March 19, 2019, or video images shot all day on March 20, 2018, or video images shot from 15:00 to 15:20 on March 20, 2018, or video images shot from March 1 to March 19, 2019, etc., and the present invention is not limited to this.
[0056] As a specific example, the process of determining training samples includes:
[0057] Features are extracted from the first data source, the second data source and the third data source respectively to determine training sample data; wherein the features include at least one or more of the following: speed, vehicle spacing, lane occupancy rate and vehicle flow within a preset interval.
[0058] In this step, the speed may be the average speed of vehicles passing through the training section, the inter-vehicle distance is the distance between two vehicles, and the lane occupancy rate may be determined based on the length of the training section, the average vehicle length, and the inter-vehicle distance. Specifically, a CNN network may be used to extract features. Since the CNN network (Convolutional Neural Network) is a black box model, the extracted features are not interpretable, so the traditional HOG features may be used to characterize the shape of local objects in the video image, such as the shape of the vehicle, the shape of the building or the isolation belt, and the inter-vehicle distance and the lane occupancy rate may be further determined. Among them, the CNN network (Convolutional Neural Network) is a feedforward neural network, and its artificial neurons can respond to surrounding units within a portion of the coverage range, and have excellent performance for large image processing. The HOG feature (Histogram of Oriented Gradient) is a feature descriptor used for object detection in computer vision and image processing.
[0059] In the embodiment of the present invention, data from different data sources are regarded as different characterizations of the sample from different perspectives.
[0060] In an optional embodiment, external factors related to driving can also be used as a data source or a feature. For example, the date range can include: Spring Festival, five days before the Spring Festival, five days after the Spring Festival, etc.; the time range can include: morning rush hour, evening rush hour, overtime time period, normal, etc.; the weather information can include: rain and snow, exposure to the sun, extreme cold, normal, etc.
[0061] Step S102: According to the training sample data, determine the weight of each data source and the weight of each training sample respectively.
[0062] Specifically, Figure 3 As shown, the process of determining the weight of each data source includes:
[0063] Step S301: for each data source, determining the information value and coverage of each feature belonging to the data source;
[0064] Step S302: determining the average information value and average coverage of the data source according to the information value and coverage of each feature;
[0065] Step S303: normalizing the average information value and average coverage of the first data source, the second data source, and the third data source;
[0066] Step S304: Determine the weight of each data source according to the normalized average information value and average coverage.
[0067] Among them, Information Value (IV) is mainly used in machine learning to encode input variables and evaluate their predictive ability. The size of the IV value of the feature variable indicates the strength of the variable's predictive ability, that is, the degree of influence of the feature variable on the target variable (in this embodiment, the target variable is the traffic status). Specifically, the calculation process of the IV value is as follows: first, take out the values of all training samples on the feature (the training sample is equivalent to a matrix, then take out a column of the matrix), then sort and bin this value, for example, divide it into n segments, then Here IV i Represents the value on the mth segment,
[0068] The coverage of a feature refers to the non-null value rate of the feature, that is, the ratio of the number of non-null feature values to the total number of training samples. After calculating the information value and coverage of each feature, the average information value and average coverage of each data source are calculated, that is, the mean of the information value and the mean of the coverage of all features belonging to the data source. Furthermore, in this embodiment, a set of average information value A = [A1, A2, A3] and average coverage B = [B1, B2, B3] at the data source level are obtained.
[0069] Then, the above average information value A = [A1, A2, A3] and average coverage B = [B1, B2, B3] are normalized. For example, vector V = [1, 2, 3, 4]. In this vector, the largest element is 4 and the smallest element is 1. Then the normalization formula is: (x-1) / (4-1). After normalization, V = [(1-1) / (4-1), (2-1) / (4-1), (3-1) / (4-1), (4-1) / (4-1)] = [0, 1 / 3, 2 / 3, 1]. In this embodiment, normalization can avoid the influence of features of different orders of magnitude on the robustness of the model.
[0070] Finally, the weight of each data source is calculated according to the following formula:
[0071] W v =α*A v +(1-α)*B v
[0072] Where v represents the number of the data source, W v Indicates the weight of the data source numbered v, A v represents the average information value of the data source numbered v, B v Indicates the average coverage of the data source numbered v.
[0073] In this embodiment, the importance of a data source is measured by the average information value and average coverage of the data source. In this embodiment, it is set that if the average information value of a data source is relatively large, it means that the data source has a strong ability to distinguish good and bad traffic conditions, and this data source is more important. In addition, if a data source is more likely to be missing in samples, it means that the data source is more important. Based on such a setting, the traffic model of this embodiment can focus on learning the information of data sources that are easily missing.
[0074] After determining the weight of each data source, determine the weight of each sample, such as Figure 4 As shown, specifically including:
[0075] Step S405: for each training sample, determining the feature missing rate of the training sample under each data source;
[0076] Step S406: Determine the weight of the training sample according to the feature missing rate of the training sample under each data source and the weight of each data source. Specifically, the sum of the product of the feature missing rate of the training sample under each data source and the weight of each data source is the weight of the sample s.
[0077] For steps S401 - S404 , please refer to steps S301 - S304 , which will not be described in detail herein.
[0078] Among them, for each sample, its weight is the weighted average of the weights of each data source. For each sample, calculate the feature missing rate of the sample under each data source. For example, there are 3 data sources in total, and 4, 4 and 3 features can be extracted respectively. Sample s = [0.3, 0.5, 0, 0.1, 0, 7, 0, 0.1, 0.1, 0.3, 0.5], sample s has 1 feature on data source 1, then the feature missing rate of sample s under data source 1 is 0.25; sample s has 2 missing features on data source 2, then the feature missing rate of sample s under data source 2 is 0.5; sample s has no missing features on data source 3, then the feature missing rate of sample s under data source 3 is 0.
[0079] Then, calculate the sum of the feature missing rate of sample s under each data source and the product of the weight of each data source. The sum of the products is the weight of sample s. Assume that the weight of data source 1 is 0.6, the weight of data source 2 is 0.5, and the weight of data source 1 is 0.4, then the weight of sample s is: 0.25*0.6+0.5*0.5+0*0.4=0.4.
[0080] Step S103: Based on the training sample data, the weight of each data source, the weight of each training sample and a preset loss function, a traffic model is trained.
[0081] In an optional embodiment, the method further includes: obtaining traffic status data of a second period of the training road section, the second period being later than the first period. Because the trained traffic model is a prediction model, the second period is later than the first period, that is, the traffic status of the second period is predicted using the traffic data in step S101.
[0082] The traffic status data of the second time period of the training section is traffic condition information, that is, traffic congestion or no traffic congestion.
[0083] As a specific example, the preset loss function is shown as follows:
[0084]
[0085] Where v represents the number of the data source, n v Indicates the total number of data sources, w v Indicates the weight of the data source numbered v, W v is a matrix whose elements in the i-th row and j-th column represent the weight of the j-th feature of the i-th sample on the data source numbered v. v represents the feature missing matrix of the data source numbered v, U vrepresents the latent space of the data source numbered v, V represents the representation of the sample data in the latent space, Loss represents the loss function, Y represents the traffic status data of the second time period of the training section, λ1, λ2 and λ3 represent the hyperparameters of the preset traffic model, and S represents the parameters of the preset traffic model.
[0086] In machine learning, parameters are configuration variables inside the model, and their values are usually estimated from training data; hyperparameters are configuration variables outside the model, and their values cannot be estimated from training data and are usually specified manually. v (latent space) is the low-dimensional vector space into which the data source numbered v is projected. v It is a matrix with values of 0 and 1, which is used to indicate which features are missing in the feature vector of the training sample under the data source numbered v, where the elements corresponding to the missing features are 0.
[0087] The weights of each data source and each training sample calculated in step S102 are used as initial parameters and input into the loss function. During the training process of the model, the unknown parameters will continuously optimize themselves. Part of the control parameter U v Will not be too large, which will control the parameter within a reasonable range and keep the model robust; in addition, part, using the multi-view matrix decomposition method, which will X v Mapping multiple perspective spaces, so that a description of the training sample will be generated in each perspective space, its meaning is as follows Figure 5 shown.
[0088] In the embodiment of the present invention, data from different data sources are regarded as different characterizations of samples from different perspectives. In order to integrate the features of each data source, the multi-perspective matrix decomposition method is not a simple feature splicing, but a data-driven approach to learn a new representation V of a sample. This technical solution is implemented by matrix decomposition (i.e., a matrix is decomposed into the product of two matrices, X v ≈V*U v ).
[0089] After calculating the weight of each data source and the weight of each sample and setting the loss function adopted by Loss(Y, VS) (for example, Loss(Y, VS) adopts the square loss function), an appropriate optimization method is selected for iterative training to obtain a robust traffic model.
[0090] In an optional embodiment, a preset traffic model can be obtained by iterative training based on an alternating optimization algorithm and a convex optimization strategy.
[0091] Among them, the alternative optimization algorithm: each time, only one variable is optimized while other variables are fixed, and it is rotated and iterated in turn until the obtained parameter of the variable is lower than an acceptable threshold, such as 10e-3. For the optimization of a single variable, a convex optimization strategy can be adopted, such as the Gradient Descent Optimization algorithm. Among them, convex optimization refers to a special kind of optimization, which refers to a type of optimization problem of finding the minimum objective function. Among them, the optimization problem whose objective function is a convex function and whose domain is a convex set is called an unconstrained convex optimization problem. The optimization problem whose objective function and inequality constraint function are both convex functions, whose equality constraint function is an affine function, and whose domain is a convex set is a constrained optimization problem.
[0092] As a specific example, the iterative training process includes:
[0093] (1) Randomly initialize all parameters U to be solved v , V and S;
[0094] (2) Fixed U v , V remains unchanged, and S is solved using the gradient descent algorithm;
[0095] (3) Fixed U v , S remains unchanged, and V is solved using the gradient descent algorithm;
[0096] (4) Fix V and S and use the gradient descent algorithm to find U v ;
[0097] (5) Iterate (2)-(4) until the algorithm converges (that is, after each iteration, U v , V and S values, relative to the values obtained in the previous iteration, their changes are all less than the threshold).
[0098] Step S104: Based on the traffic model, determine the traffic status of the road section to be predicted.
[0099] Specifically, the following processes may be included:
[0100] Acquire historical traffic data, first-period traffic data of the road section to be predicted, and first-period traffic data of the road section adjacent to the road section to be predicted; use the historical traffic data as a first data source, the first-period traffic data of the road section to be predicted as a second data source, and the first-period traffic data of the road section adjacent to the road section to be predicted as a third data source;
[0101] Extracting features from the first data source, the second data source, and the third data source respectively to generate sample data;
[0102] Based on the sample data, determining the weight of each data source and the weight of each sample respectively;
[0103] The traffic state of the second time period of the road section to be predicted is determined according to the sample data, the weight of each data source, the weight of each sample and the traffic model.
[0104] The traffic status prediction method of an embodiment of the present invention regards data from different data sources as different characterizations of samples from different perspectives. In order to fuse the features of each data source, a multi-perspective matrix decomposition method is used to learn a new representation of a sample, and then a traffic model is obtained through iterative training. The traffic model can effectively reduce the impact of data disturbance and improve the accuracy of traffic prediction.
[0105] The traffic state prediction method of the embodiment of the present invention can also be applied to other fields, such as credit access and genetic disease prediction. As a specific example, in the credit access scenario, the historical records of different user behaviors can be used as different data sources, for example, the user's purchase record is used as a data source, the browsing record is used as a data source, and the purchase record is used as a data source. The features extracted from the purchase record can be the number of days since the user's last purchase of a certain type of goods, the average purchase frequency of a certain type of goods, the average amount of a certain type of goods purchased, etc. The features extracted from the browsing record can be: the number of days since the user's last browsing of a certain type of goods, the average browsing frequency of a certain type of goods, the average amount of a certain type of goods browsed, etc. The features extracted from the purchase record can be: the number of days since the user's last purchase of a certain type of goods, the average purchase frequency of a certain type of goods, the average amount of a certain type of goods purchased, etc.
[0106] Figure 6 is a schematic diagram of the main modules of the traffic state prediction device 600 according to an embodiment of the present invention. Figure 6 As shown, the device 600 includes:
[0107] The sample determination module 601 is used to determine the training sample data according to the historical traffic data of the training section, the traffic data of the first period, and the traffic data of the first period of the section adjacent to the training section; wherein the historical traffic data is used as the first data source, the traffic data of the first period of the training section is used as the second data source, and the traffic data of the first period of the section adjacent to the training section is used as the third data source;
[0108] A weight determination module 602, configured to determine the weight of each data source and the weight of each training sample according to the training sample data;
[0109] A model training module 603, used to train a traffic model based on the training sample data, the weight of each data source, the weight of each training sample and a preset loss function;
[0110] The traffic prediction module 604 is used to determine the traffic status of the road section to be predicted based on the traffic model.
[0111] Optionally, the sample determination module 601 is also used to extract features from the first data source, the second data source and the third data source respectively to determine training sample data; wherein the features include at least one or more of the following: speed, vehicle spacing, lane occupancy and vehicle flow within a preset interval.
[0112] Optionally, the weight determination module 602 is also used to: for each data source, determine the information value and coverage of each feature attributable to the data source; determine the average information value and average coverage of the data source based on the information value and coverage of each feature; normalize the average information value and average coverage of the first data source, the second data source, and the third data source; and determine the weight of each data source based on the normalized average information value and average coverage.
[0113] Optionally, the weight determination module 602 is further used to: for each training sample, determine the feature missing rate of the training sample under each data source; determine the weight of the training sample according to the feature missing rate of the training sample under each data source and the weight of each data source.
[0114] Optionally, the device 600 further includes a data acquisition module, configured to acquire traffic status data of a second time period of the training section, wherein the second time period is later than the first time period;
[0115] The preset loss function is shown as follows:
[0116]
[0117] Where v represents the number of the data source, n V Indicates the total number of data sources, w V Indicates the weight of the data source numbered v, W v is a matrix whose elements in the i-th row and j-th column represent the weight of the j-th feature of the i-th sample on the data source numbered v. v represents the feature missing matrix of the data source numbered v, U vrepresents the latent space of the data source numbered v, V represents the representation of the sample data in the latent space, Loss represents the loss function, Y represents the traffic status data of the second time period of the training section, λ1, λ2 and λ3 represent the hyperparameters of the preset traffic model, and S represents the parameters of the preset traffic model.
[0118] Optionally, the model training module 603 is also used to iteratively train the traffic model using an alternating optimization algorithm and a convex optimization strategy based on the sample data, the weight of each data source, the weight of each training sample and a preset loss function.
[0119] The above device can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0120] Figure 7 An exemplary system architecture 700 is shown to which the traffic status prediction method or traffic status prediction device according to the embodiments of the present invention can be applied.
[0121] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0122] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0123] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0124] The server 705 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information and product information) to the terminal device.
[0125] It should be noted that the traffic state prediction method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the traffic state prediction device is generally disposed in the server 705 .
[0126] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0127] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0128] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0129] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0130] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0131] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes a sending module, an acquisition module, a determination module, and a first processing module. The names of these modules do not, in some cases, constitute a limitation on the unit itself. For example, the sending module may also be described as a "module for sending a picture acquisition request to the connected server."
[0134] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0135] Determine the training sample data according to the historical traffic data of the training section, the traffic data of the first period, and the traffic data of the first period of the section adjacent to the training section; wherein the historical traffic data is used as the first data source, the traffic data of the first period of the training section is used as the second data source, and the traffic data of the first period of the section adjacent to the training section is used as the third data source;
[0136] According to the training sample data, the weight of each data source and the weight of each training sample are determined respectively;
[0137] Based on the training sample data, the weight of each data source, the weight of each training sample and the preset loss function, the traffic model is trained;
[0138] Based on the traffic model, determine the traffic status of the road section to be predicted.
[0139] The technical solution of the embodiment of the present invention regards the data from different data sources as different characterizations of samples from different perspectives. In order to fuse the features of each data source, a new representation of a sample is learned by multi-perspective matrix decomposition method, and then a traffic model is obtained through iterative training. The traffic model can effectively reduce the impact of data disturbance and improve the accuracy of traffic prediction.
[0140] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A traffic state prediction method, characterized in that: include: Determine the training sample data according to the historical traffic data of the training section, the traffic data of the first period, and the traffic data of the first period of the section adjacent to the training section; wherein the historical traffic data is used as the first data source, the traffic data of the first period of the training section is used as the second data source, and the traffic data of the first period of the section adjacent to the training section is used as the third data source; According to the training sample data, the weight of each data source and the weight of each training sample are determined respectively; wherein the process of determining the weight of each data source includes: for each data source, determining the information value and coverage rate of each feature belonging to the data source; determining the average information value and average coverage rate of the data source according to the information value and coverage rate of each feature; normalizing the average information value and average coverage rate of the first data source, the second data source and the third data source; determining the weight of each data source according to the normalized average information value and average coverage rate; Based on the training sample data, the weight of each data source, the weight of each training sample and a preset loss function, a traffic model is trained; Based on the traffic model, the traffic status of the road section to be predicted is determined.
2. The method according to claim 1, characterized in that The process of determining training sample data includes: Features are extracted from the first data source, the second data source and the third data source respectively to determine training sample data; wherein the features include at least one or more of the following: speed, vehicle spacing, lane occupancy rate and vehicle flow within a preset interval.
3. The method according to claim 2, characterized in that The process of determining the weight of each training sample includes: For each training sample, determining a feature missing rate of the training sample under each data source; The weight of the training sample is determined according to the feature missing rate of the training sample under each data source and the weight of each data source.
4. The method according to claim 3, characterized in that The method further includes: acquiring traffic status data of a second time period of the training section, the second time period being later than the first time period; The preset loss function is shown as follows: Where v represents the number of the data source, n v Indicates the total number of data sources, w v Indicates the weight of the data source numbered v, W v is a matrix whose elements in the i-th row and j-th column represent the weight of the j-th feature of the i-th sample on the data source numbered v. v represents the feature missing matrix of the data source numbered v, U v represents the latent space of the data source numbered v, V represents the representation of the sample data in the latent space, Loss represents the loss function, Y represents the traffic status data of the second period of the training section, λ1, λ2 and λ3 represent the hyperparameters of the preset traffic model, and S represents the parameters of the preset traffic model.
5. The method according to claim 4, characterized in that Based on the training sample data, the weight of each data source, the weight of each training sample and the preset loss function, the traffic model obtained by training includes: Based on the sample data, the weight of each data source, the weight of each training sample and a preset loss function, an alternating optimization algorithm and a convex optimization strategy are used to iteratively train and obtain a traffic model.
6. A traffic status prediction device, characterized in that: include: A sample determination module, used to determine training sample data according to historical traffic data of a training section, traffic data of a first period, and traffic data of a section adjacent to the training section during the first period; wherein the historical traffic data is used as a first data source, the traffic data of the training section during the first period is used as a second data source, and the traffic data of the section adjacent to the training section during the first period is used as a third data source; A weight determination module is used to determine the weight of each data source and the weight of each training sample according to the training sample data; wherein the process of determining the weight of each data source includes: for each data source, determining the information value and coverage of each feature belonging to the data source; determining the average information value and average coverage of the data source according to the information value and coverage of each feature; normalizing the average information value and average coverage of the first data source, the second data source and the third data source; and determining the weight of each data source according to the normalized average information value and average coverage; A model training module, used for training a traffic model based on the training sample data, the weight of each data source, the weight of each training sample and a preset loss function; The traffic prediction module is used to determine the traffic status of the road section to be predicted based on the traffic model.
7. The device according to claim 6, characterized in that The sample determination module is also used for: Features are extracted from the first data source, the second data source and the third data source respectively to determine training sample data; wherein the features include at least one or more of the following: speed, vehicle spacing, lane occupancy rate and vehicle flow within a preset interval.
8. The device according to claim 7, characterized in that The weight determination module is also used for: For each training sample, determining a feature missing rate of the training sample under each data source; The weight of the training sample is determined according to the feature missing rate of the training sample under each data source and the weight of each data source.
9. The device according to claim 8, characterized in that The device further comprises a data acquisition module, which is used to acquire traffic status data of a second time period of the training section, wherein the second time period is later than the first time period; The preset loss function is shown as follows: Where v represents the number of the data source, n v Indicates the total number of data sources, w v represents the weight of the data source numbered v. Wv is a matrix whose elements in the i-th row and j-th column represent the weight of the i-th feature of the i-th sample on the data source numbered v. v represents the feature missing matrix of the data source numbered v, U v represents the latent space of the data source numbered v, V represents the representation of the sample data in the latent space, L0ss represents the loss function, Y represents the traffic status data of the second time period of the training section, λ1, λ2 and λ3 represent the hyperparameters of the preset traffic model, and S represents the parameters of the preset traffic model.
10. The device according to claim 9, characterized in that The model training module is also used to: Based on the sample data, the weight of each data source, the weight of each training sample and a preset loss function, an alternating optimization algorithm and a convex optimization strategy are used to iteratively train and obtain a traffic model.
11. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Traffic state parameter estimation method and system
CN104408915A
Traffic flow prediction method and device, computer device, and storage medium
CN109272169A