Method and device for predicting travel time of target object and medium
By analyzing the user's historical travel data, determining the travel mode and selecting a suitable time series model, the flexibility and accuracy of travel time prediction in the prior art are solved, and accurate prediction of users' travel time is achieved.
Patent Information
- Application Number
- CN202411068967.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-12-10
AI Technical Summary
The existing user travel time prediction methods mainly focus on the fixed travel mode of commuters, lack the flexibility of time division, and fail to effectively consider the diversity of user travel behaviors, especially in non-working days, resulting in low prediction accuracy.
By obtaining the historical car travel information data set of the target object, determining that its travel mode is a regular mode or a complex and changeable mode, and selecting the corresponding time series model based on the travel mode for prediction. The specific steps include: analyzing travel attribute information, generating travel regularity scores, determining travel modes, and selecting appropriate time series models (such as ARIMA or LSTM) for prediction.
Accurate prediction of user travel time is achieved, and accurate prediction can be achieved for both regular and complex multivariate objects, avoiding the problem of low accuracy caused by individual travel time differences in predictions based on historical data of all objects.
Smart Images

Figure CN119106758A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle travel time prediction, and in particular to a method, device and medium for predicting the travel time of a target object. Background Art
[0002] Predicting users' travel time (the time users use their cars to travel) is of great significance in the fields of intelligent transportation and providing personalized services. For example, through accurate travel time prediction, shared travel services (taxi platforms) can prepare vehicles more efficiently and push weather forecasts and road conditions information through APP and other channels at appropriate times, thereby enhancing users' driving experience.
[0003] At present, a feasible method for predicting user travel time mainly focuses on the car demand of commuters and uses a fixed travel mode (e.g., commuting) for prediction. For example, 7 to 9 in the morning is considered as the morning peak. Obviously, the prediction method for fixed time periods lacks flexibility in time division. For example, some users often travel at noon, which is not the peak time in the fixed time period. Especially in the case of non-working days, it can be seen that this prediction method does not take into account the diversity of user travel behavior.
[0004] In summary, how to accurately predict users' car travel time and improve user experience is one of the most important research directions for technical personnel in this field. Summary of the invention
[0005] In view of this, one aspect of the present application provides a method for predicting a target object's travel time, the method comprising:
[0006] Obtain the target object's historical vehicle travel information dataset;
[0007] Determine the travel mode of the target object according to the travel information data set; wherein the travel mode includes a regular mode and a complex and changeable mode;
[0008] A corresponding time series model is selected according to the travel mode, so as to predict the vehicle travel time of the target object through the time series model.
[0009] Optionally, determining the travel mode of the target object according to the travel information dataset includes:
[0010] Determine the travel attribute information of the target object according to the travel information data set; wherein the travel attribute information is used to characterize at least one of the regularity of travel time, the regularity of travel space, the stability of travel frequency and the consistency of travel mileage;
[0011] Based on the travel attribute information, generating a travel regularity score for the target object;
[0012] The travel mode of the target object is determined according to the travel regularity score.
[0013] Optionally, the travel information data set includes the travel start time, the travel starting POI, the travel end POI, the travel mileage and the number of trips within a preset period.
[0014] Optionally, determining the travel attribute information of the target object according to the travel information data set includes:
[0015] Determining a standard deviation of the regularity of the travel time based on the travel start time;
[0016] Determine an entropy value of the travel space regularity according to the trip starting point POI and the trip end point POI;
[0017] Determining a first coefficient of variation regarding stability of the travel frequency based on the number of trips;
[0018] Based on the trip distance, a second coefficient of variation regarding consistency of the trip distance is determined.
[0019] Optionally, generating a travel regularity score of the target object based on the travel attribute information includes:
[0020] Standardizing the travel attribute information to obtain one or more target indicator values corresponding to the travel attribute information;
[0021] Assigning corresponding weights to each of the target indicator values;
[0022] The travel regularity score is calculated according to the weight and the target index value.
[0023] Optionally, determining the travel mode of the target object according to the travel regularity score includes:
[0024] When the travel regularity score is not greater than a preset score, determining the travel mode to be the regular mode;
[0025] When the travel regularity score is greater than the preset score, the travel mode is determined to be the complex and changeable mode.
[0026] Optionally, the time series model includes a first model and a second model, and selecting a corresponding time series model according to the travel mode to predict the vehicle travel time of the target object through the time series model includes:
[0027] When the travel mode is the regular mode, clustering the travel information data set to determine the peak travel time of the target object; and inputting the peak travel time into the first model to obtain the predicted travel time of the target object;
[0028] When the travel mode is the complex and changeable mode, the travel information data set is input into the second model to obtain the predicted travel time.
[0029] Another aspect of the present application provides a device for predicting a travel time of a target object, the device comprising:
[0030] A data set acquisition module is used to acquire the travel information data set of the target object's historical vehicle use;
[0031] A travel mode determination module, used to determine the travel mode of the target object according to the travel information data set; wherein the travel mode includes a regular mode and a complex and variable mode;
[0032] The travel time prediction module is used to select a corresponding time series model according to the travel mode, so as to predict the vehicle travel time of the target object through the time series model.
[0033] Another aspect of the present application provides a device for predicting the travel time of a target object, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the program, the steps of the method for predicting the travel time of the target object are implemented.
[0034] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method for predicting the travel time of a target object when the program is executed by a processor.
[0035] The present application provides a method, device and medium for predicting the travel time of a target object, which has the following beneficial effects: by analyzing the regularity of the travel time of the target object and selecting a suitable time series model for prediction based on the regularity, accurate prediction can be achieved for both regular objects and complex and variable objects. In addition, prediction based on the historical vehicle travel information of the target object itself can effectively avoid the problem of low prediction accuracy caused by differences in individual travel time compared to prediction based on historical data of all objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a flow chart of a method for predicting the travel time of a target object provided in an embodiment of the present application;
[0037] Figure 2A schematic diagram of a flow chart of a method for predicting a target object's travel time provided by another embodiment of the present application;
[0038] Figure 3 A schematic diagram of a flow chart of a method for predicting a target object's travel time provided in yet another embodiment of the present application;
[0039] Figure 4 A flowchart of a method for predicting travel time of a target object provided by another embodiment of the present application;
[0040] Figure 5 A schematic diagram of the structure of a device for predicting the travel time of a target object provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of the structure of a device for predicting travel time of a target object provided in another embodiment of the present application.
[0042] The reference numerals are as follows: 60 is a memory, 61 is a processor, 62 is a display screen, 63 is an input / output interface, 64 is a communication interface, 65 is a power supply, 66 is a communication bus, 601 is a computer program, 602 is an operating system, and 603 is data. DETAILED DESCRIPTION
[0043] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0044] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0045] Figure 1 A flow chart of a method for predicting the travel time of a target object provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the method includes:
[0046] S10: Obtain a travel information dataset of the target object's historical vehicle usage;
[0047] In order to improve the accuracy of the user's travel time prediction, in a specific embodiment, a travel information dataset of the target object's historical vehicle use is obtained through step S10. That is, in order to better understand the user's personalized travel mode, the user's (target object's) own historical data is extracted for analysis and prediction.
[0048] To further ensure the prediction accuracy, in an optional embodiment, when obtaining the travel information data set, only the data within a preset time period closest to the current date is obtained, for example, the data set within 30 days closest to today is obtained.
[0049] The travel information data set may include but is not limited to the vehicle identification number (VIN), the travel start time, the travel end time, the travel starting point of interest (POI), the travel end point of interest (POI), the travel date, the travel mileage and the number of trips. It is worth noting that in an optional embodiment, the travel start time and the travel end time are composed of hours, minutes and seconds.
[0050] It should be noted that the travel information data can represent a trip through a row of data, and a trip number is set for each trip. It can also be distinguished and stored in the form of a table, which is not limited in this application. It is worth noting that the database storing the travel information data can be multiple databases for storing the driving information of different vehicles, or all vehicles can share one database. When predicting the travel time, the historical travel data corresponding to the target object can be retrieved according to the vehicle VIN. From the perspective of saving resources, in an optional embodiment, the driving information of all vehicles can be stored in one database.
[0051] In addition, it should be noted that the execution subject of the embodiment of the present application may include but is not limited to the vehicle controller and domain controller of the target vehicle, and the target vehicle includes the vehicle of the hydrogen-electric hybrid system, including but not limited to sedans, sport utility vehicles (SUV), multi-purpose vehicles (MPV), off-road vehicles, pickup trucks or other power-driven non-track-borne vehicles.
[0052] In addition, it should be noted that in the specific implementation of the present application, the travel information data of the target object's historical vehicle usage is involved. When the above embodiments of the present application are applied to specific products or technologies, it is necessary to obtain the target object's permission or consent, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0053] S11: determining the travel mode of the target object according to the travel information data set; wherein the travel mode includes a regular mode and a complex and variable mode;
[0054] S12: Select a corresponding time series model according to the travel mode to predict the vehicle travel time of the target object through the time series model.
[0055] Furthermore, the travel information data set is analyzed in step S11, and the travel mode of the target object is determined according to the analysis result, wherein the travel mode is divided into a regular mode and a complex and changeable mode according to the user's travel time.
[0056] The regular pattern represents that the travel time of the target object is relatively central, with strong regularity and little fluctuation. You can choose a time series model that has a better prediction effect on stable data for prediction. The complex and variable pattern represents that the travel time of the target object is not fixed, is relatively complex, and has large fluctuations. In order to improve the prediction accuracy of the travel time of such users, you can choose a time series model that has a better prediction effect on non-stable data for prediction.
[0057] That is to say, after determining the travel mode of the target object, a suitable time series model can be selected according to the travel mode of the target object to predict the target object's future car usage time.
[0058] In an optional embodiment, for target objects with regular patterns, models that can be selected include but are not limited to State Space Models (SSM) models and Autoregressive Integrated Moving Average (ARIMA) models.
[0059] In another optional embodiment, for target objects with complex and changeable patterns, the models that can be selected include but are not limited to the Gated Recurrent Unit (GRU) model and the Long Short-Term Memory (LSTM) model.
[0060] It should be noted that when predicting the travel time of the target object, the prediction time can be set according to the regularity of the target object's travel time. For example, according to historical travel time, user A usually uses the vehicle after 5 a.m., then the prediction can be set before 5 a.m., for example, the prediction can be started at 4 a.m. In addition, it should be noted that the target object can be a user who uses the vehicle, or can be directly understood as a vehicle, which is not limited in this application.
[0061] Therefore, the method for predicting the travel time of the target object provided in the embodiment of the present application analyzes the regularity of the travel time of the target object and selects a suitable time series model for prediction based on the regularity, thereby achieving accurate prediction for both regular objects and complex and variable objects. In addition, prediction based on the historical vehicle travel information of the target object itself can effectively avoid the problem of low prediction accuracy caused by differences in individual travel time compared to prediction based on historical data of all objects.
[0062] Figure 2 A flowchart of a method for predicting the travel time of a target object provided by another embodiment of the present application is shown as follows: Figure 2 As shown, according to the travel information dataset, the travel mode of the target object is determined, including:
[0063] S20: Determine travel attribute information of the target object according to the travel information data set; wherein the travel attribute information is used to characterize at least one of travel time regularity, travel space regularity, travel frequency stability, and travel mileage consistency;
[0064] The travel mode of the target object includes a regular mode and a complex and changeable mode. In a specific embodiment, the travel mode of the target object can be evaluated based on at least one of the four indicators: regularity of travel time, regularity of travel space, stability of travel frequency, and consistency of travel mileage.
[0065] Of course, it is understandable that the more indicators considered, the more accurate the travel mode evaluation results will be. Therefore, in an optional embodiment, travel attribute information is determined based on the travel information data set to characterize the four indicators of travel time regularity, travel space regularity, travel frequency stability, and travel mileage consistency of the target object.
[0066] The travel attribute information can be a specific value, a field, or a string, which is not limited in this application. In fact, the travel attribute information can be understood as the degree of characterization of the regularity of travel time, the regularity of travel space, the stability of travel frequency, and the consistency of travel mileage.
[0067] For example, when the travel attribute information is the regularity of travel time, and the travel attribute information is a specific value, the smaller the value is, the more regular the travel of the target object is.
[0068] S21: Generate a travel regularity score for the target object based on the travel attribute information;
[0069] S22: Determine the travel mode of the target object according to the travel regularity score.
[0070] Furthermore, after determining the travel attribute information used to characterize the regularity of travel time, the regularity of travel space, the stability of travel frequency and the consistency of travel mileage, the travel regularity score of the target object is calculated and generated based on the travel attribute information, and the travel mode of the target object can be determined based on the travel regularity score.
[0071] Specifically, in an optional embodiment, when the score is higher, it represents that the travel of the target object is more complex and changeable. On the contrary, when the score is lower, it represents that the travel of the target object is more regular.
[0072] Therefore, the method for predicting the travel time of the target object provided in the embodiment of the present application determines the travel mode of the target object based on at least one of the regularity of travel time, regularity of travel space, stability of travel frequency and consistency of travel mileage, which can provide a prediction basis for travel time prediction, thereby improving prediction accuracy.
[0073] In an optional embodiment, the travel information data set includes the travel start time, the travel starting point POI, the travel end point POI, the travel mileage and the number of trips within a preset period.
[0074] Further, in another optional embodiment, determining the travel attribute information of the target object according to the travel information data set includes:
[0075] Determine the standard deviation regarding the regularity of travel times based on the travel start time;
[0076] Determine the entropy value of the travel space regularity based on the starting POI and the ending POI of the trip;
[0077] Determine the first coefficient of variation regarding the stability of the frequency of trips based on the number of trips;
[0078] Based on the trip mileage, a second coefficient of variation regarding the consistency of the trip mileage is determined.
[0079] In a specific embodiment, the travel start time of the target object is collected, and the standard deviation of the travel start time is calculated to characterize the regularity of the travel time. Specifically, the average value of the travel start time is first calculated, and then the square of the deviation of each sample point (each travel start time) from the average value is calculated. Further, the square root of the average value of the square of the deviation is taken to obtain the standard deviation.
[0080] For example, the travel start time of a target object includes: 8:00, 8:15 and 8:30, which are converted into calculable values: 8.00, 8.25 and 8.30. Then the mean value of the travel start time mu = (8.00 + 8.25 + 8.30) / 3 = 8.25. Further, the square of the deviation of each travel start time from the mean value mu is: (8.00-8.25)^2 + 0 + (8.30-8.25)^2 = 0.125, and the average value of the square of the deviation is 0.125 / 3 = 0.04167. Finally, the standard deviation of the travel start time is determined to be sqrt (0.04167) = 0.2041.
[0081] It can be understood that the standard deviation represents the degree of deviation of the data points from their mean. If the standard deviation is small, it means that the data points are relatively concentrated, that is, the travel time of the target object is relatively regular. On the contrary, if the standard deviation is large, it means that the data points are widely dispersed, that is, the travel time of the target object is relatively complex and changeable.
[0082] In an optional embodiment, based on the diversity of the starting point POI and the end point POII, a lower diversity indicates that the travel location of the target object is relatively stable. The diversity can be evaluated by entropy. Specifically, a larger entropy value indicates a higher uncertainty of the travel location of the target object.
[0083] Therefore, when determining the entropy value of the travel space regularity based on the starting POI and the ending POI, specifically, first collect the starting POI and the ending POI of the target object, and calculate the frequency of each POI, that is, the number of POI appearances / total number of trips.
[0084] Furthermore, the entropy value H is calculated by the following formula:
[0085]
[0086] Among them, H is the entropy value, p(x i ) is the probability of the i-th POI appearing, and n is the total number of POI types. The lower the entropy value H, the more the target object's starting point POI and the destination POI are concentrated in a few POIs, indicating that the spatial regularity of the target object's travel starting point is high. The higher the entropy value H, the more the target object's starting point POI and the destination POI are widely distributed, indicating that their spatial regularity is low.
[0087] In another optional embodiment, when analyzing the stability of the target object's travel frequency, it can be determined based on the first coefficient of variation of the number of trips, wherein a smaller coefficient of variation indicates that the target object's travel frequency is relatively stable.
[0088] For example, the number of trips of a target object per day in a week includes 10, 12, 11, 10, 13, 10 and 12, and the mean of the number of trips is: (10+12+11+10+13+10+12) / 7=11.14, then the standard deviation of the number of trips is 1.1249, and further calculation results in the first coefficient of variation of 0.101. Since the first coefficient of variation is small, it indicates that the travel frequency of the target object is relatively fixed every day.
[0089] In another optional embodiment, when analyzing the consistency of the travel mileage of the target object, it can also be determined by the coefficient of variation. Specifically, the second coefficient of variation is determined according to the travel mileage, and the consistency of the travel mileage is further analyzed according to the second coefficient of variation.
[0090] The mileage variation coefficient indicates the ratio of the target object's mileage fluctuation degree to the average mileage. A low coefficient of variation indicates that the target object's mileage is relatively consistent each time it travels, that is, the mileage fluctuation is small, indicating that the target object's travel mileage is relatively fixed, for example, the commuting route may be the same every day. On the contrary, a high coefficient of variation indicates that the mileage fluctuation is large and the consistency of travel mileage is poor.
[0091] Figure 3 A flowchart of a method for predicting the travel time of a target object provided in another embodiment of the present application is provided. Based on the above embodiment, as an optional embodiment, Figure 3 As shown, based on the travel attribute information, a travel regularity score of the target object is generated, including:
[0092] S30: Standardizing the travel attribute information to obtain one or more target index values corresponding to the travel attribute information;
[0093] In a specific embodiment, after determining the travel attribute information of the target object, in order to eliminate the magnitude and scale differences between different travel attribute information, the travel attribute information is standardized through step S30 to obtain one or more target indicator values corresponding to the travel attribute information. In an optional embodiment, the standardization can be performed by the indicator Z-score.
[0094] It should be noted that the types of travel attribute information are the same as the number of target index values, that is, several travel attribute information can be standardized to obtain several target index values.
[0095] S31: assigning corresponding weights to each target indicator value;
[0096] S32: Calculate the travel regularity score based on the weight and the target indicator value.
[0097] Further, a corresponding weight is assigned to each target index value, and the travel regularity score is calculated based on the weight and the target index value. In an optional embodiment, the weight assignment of the target index value can be achieved by principal component analysis (PCA) technology. For each principal component, its corresponding eigenvector (i.e., the coefficient on each target index value) is observed, and these coefficients indicate the importance of the corresponding index in the principal component.
[0098] In an optional embodiment, in order to improve the accuracy of travel mode analysis, four indicators of travel time regularity, travel space regularity, travel frequency stability and travel mileage consistency of the target object are analyzed at the same time. After standardizing the travel attribute information corresponding to the four indicators, four target indicator values are obtained: Z1, Z2, Z3 and Z4, where the weights assigned by PCA are w1, w2, w3 and w4 respectively, and w1+w2+w3+w4=1.
[0099] Furthermore, the travel regularity score S = w1*Z1+w2*Z2+w3*Z3+w4*Z4, where Z1, Z2, Z3 and Z4 are the target indicator values corresponding to the regularity of travel time, the regularity of travel space, the stability of travel frequency and the consistency of travel mileage, respectively.
[0100] Based on the above embodiment, as an optional embodiment, determining the travel mode of the target object according to the travel regularity score includes:
[0101] When the travel regularity score is not greater than the preset score, the travel mode is determined to be a regular mode;
[0102] When the travel regularity score is greater than the preset score, the travel mode is determined to be a complex and changeable mode.
[0103] It should be noted that the preset score can be set based on historical data or experience. For example, 40% of users drive to and from get off work (i.e., the target object with a relatively regular travel pattern), and the 40th percentile can be taken as the preset threshold. If the travel regularity score is lower than this threshold, the user is considered to be a user with a strong regularity, that is, the travel pattern is a regular pattern. Otherwise, the user is considered to be a complex and changeable type of user, that is, the travel pattern is a complex and changeable pattern.
[0104] In an optional embodiment, the time series model includes a first model and a second model, and the corresponding time series model is selected according to the travel mode to predict the vehicle travel time of the target object through the time series model, including:
[0105] When the travel mode is a regular mode, clustering the travel information data set to determine the peak travel time of the target object; and inputting the peak travel time into the first model to obtain the predicted travel time of the target object;
[0106] When the travel mode is complex and changeable, the travel information data set is input into the second model to obtain the predicted travel time.
[0107] In a specific embodiment, the time series model includes a first model and a second model, which are respectively used to predict the travel time of the target object under different travel modes.
[0108] When the travel mode of the target object is a regular mode, it indicates that the travel time of the target object is relatively stable and regular. At this time, you can choose a model that has a better modeling effect on stationary data, such as the SSM model or the ARIMA model.
[0109] It is understandable that the ARIMA model is relatively simple, easy to understand and implement. In addition, through differential operation, ARIMA can process non-stationary time series and convert them into stationary series, which is convenient for analysis and prediction, that is, it has strong stability and wide application range. Therefore, in a preferred embodiment, when the travel mode of the target object is a regular mode, the ARIMA model can be selected to predict the travel time.
[0110] Before prediction is made through the ARIMA model, in order to improve the prediction accuracy, in an optional embodiment, the travel information data set can be clustered to determine the peak travel time of the target object, and further, the peak travel time is input into the ARIMA model for prediction.
[0111] The clustering algorithm may include but is not limited to the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm, the OPTICS (Ordering Points To Identify the Clustering Structure) clustering algorithm and the HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise). Since the DBSCAN clustering algorithm has the advantages of strong adaptive clustering capability and good ability to identify and process noise in a data set, in a preferred embodiment, the DBSCAN clustering algorithm may be used to cluster the travel information data set to obtain the peak travel time of the target object.
[0112] During clustering, features useful for identifying peak travel time are extracted from the travel information dataset, which may include but are not limited to travel start time, travel time length, and travel times. Furthermore, the peak travel time of the target object is identified by using the DBSCAN clustering algorithm.
[0113] Specifically, in the DBSCAN clustering algorithm, the peak-period cluster will have more travel records and the travel start time has a high concentration. The threshold threshold is set to determine the peak-period cluster. Specifically, the number of trips of each cluster (each travel record) is calculated first, and the clusters with a travel coefficient greater than the threshold threshold are retained as peak-period clusters.
[0114] Furthermore, the average start time of each cluster is calculated, and then the start time and duration of the peak period are determined based on the average start time. Specifically, it is determined based on the distribution range of the travel start time in each cluster, and the interquartile range (IQR) is used to estimate the time fluctuation range of the travel peak period of each cluster, that is, the peak travel time of the target object.
[0115] It should be noted that the peak travel time clustered here is a wave range of travel time. By further inputting this wave range into the ARIMA model, the specific travel time of the target object can be predicted. For ease of understanding, an example will be given below.
[0116] For example, suppose a target object's travel information dataset includes the following data:
[0117] Trip 1: {date: 2023-06-01, time: 08:15, duration: 0.5 hours};
[0118] Trip 2: {date: 2023-06-02, time: 08:20, duration: 0.4 hours};
[0119] Trip 3: {date: 2023-06-03, time: 09:10, duration: 0.6 hours};
[0120] Trip 4: {date: 2023-06-04, time: 08:05, duration: 0.5 hours};
[0121] Trip 5: {date: 2023-06-05, time: 08:25, duration: 0.45 hours};
[0122] When using the DBSCAN clustering algorithm, the parameters epsilon and minPts are required, where epsilon is defined as the distance threshold, for example, travel deviations within 20 minutes are considered similar. minPts is defined as the minimum number of trips required for clustering, for example, 2 means that a cluster requires at least 2 travel records.
[0123] The specific results of the DBSCAN clustering algorithm can be, for example, that cluster 1 contains trips 1, 2, 4, and 5, which are similar to each other. Cluster 2 contains trip 3, which is quite different from the other trips. When the threshold is 3, clusters with 3 or more trip records are considered to be peak-period clusters. Referring to the above clustering results, we can see that cluster 1 is a peak-period cluster.
[0124] Furthermore, the average start time and duration of the peak clusters are calculated: the average start time of cluster 1 is (08:15+08:20+08:05+08:25) / 4≈08:16. When the interquartile range IQR is used to estimate the travel time fluctuation range, the lower quartile Q1=8:15, the upper quartile Q3=8:20, and IQR=Q3-Q1=5 minutes. Therefore, the estimated peak travel time (peak fluctuation range) is: [Q1-1.5*IQR, Q3+1.5*IQR]≈[8:07.5, 8:27.5], where 8:07.5 means 8:07:05 and 8:27.5 means 8:27:05.
[0125] Therefore, the fixed time period division used in the traditional method is not enough to cope with the diversity of the target object's behavior, especially the travel situation on non-working days. The dynamic time period division method adopted in the embodiment of the present application can automatically identify the travel peak period according to the historical travel data of the target object, and divide the time period accordingly, so as to effectively cope with the changes in the travel behavior of the target object, especially in reflecting unconventional travel modes (for example, travel during holidays or special events).
[0126] In fact, the target objects of the regular pattern will recognize their own peak hours. For example, some target objects travel at 2 or 3 in the morning. Most of the existing peak hours are determined by experience and are rough. For example, 7 to 9 is the morning peak, and 16 to 18 is the evening peak. It does not take into account that the time periods with high travel frequency for each target object are different. However, the embodiment of the present application can directly determine the peak travel time of different target objects through a clustering algorithm.
[0127] Furthermore, for the target objects with "strong regularity", ARIMA is used for modeling. To improve the modeling speed, Spark is used in the cluster. The specific steps include:
[0128] Step 1: Data reading: Use Spark to read the travel start time and travel date.
[0129] Step 2: Data filtering: Filter out travel records within a specified time period (e.g., 30 working days in history) that is closest to the current time, and filter out peak period data in dynamic time period divisions. It should be noted that when obtaining historical travel records, in order to improve prediction accuracy and ensure that the model can perform predictions normally, as many travel information data sets as possible should be obtained for prediction.
[0130] Step 3: Remove outliers: Calculate the median travel time of each target object, mark the records within the preset range of the median (for example, within the range of ±0.5 of the median), and filter out the records with more than a preset number (for example, more than 3) within the preset range of the median, and the proportion of these records to the total records is greater than the preset proportion (for example, 60%). That is, retaining more than 60% of the distance is equivalent to removing less than 40% of the outliers. If the proportion of outliers is too large, it means that the data is relatively irregular and has poor stability, which is not suitable for ARIMA modeling.
[0131] Step 4: Data Conversion: Convert the Spark DataFrame to Pandas DataFrame and fit the ARIMA model using the Statsmodels library.
[0132] Step 5: Model and predict different weeks of each target object separately: Group different weeks of each target object to ensure that each group has more than a preset number of records (for example, more than 3). Further, use the ARIMA model to fit the travel time data of each target object to predict the travel time of the same week in the future. That is, the travel information dataset of historical Monday predicts the travel time of Monday in the next week, the travel information dataset of historical Tuesday predicts the travel time of Tuesday in the next week, and so on, to predict the travel time of the next week.
[0133] Step 6: Prediction result saving: In an optional embodiment, the data warehouse is based on Hive, so the predicted travel time data needs to be converted into a Spark DataFrame for writing. That is, the Pandas DataFrame of the prediction result is converted into a Spark DataFrame, and the prediction result is stored in the corresponding Hive table using Spark SQL.
[0134] Of course, in an optional embodiment, when the travel mode is complex and changeable, the travel information data set is input into the second model to obtain the predicted travel time. Among them, because LSTM can effectively learn and retain long-term dependencies through its unique gating mechanism (input gate, forget gate and output gate), it solves the limitations of traditional RNN on long sequences. In addition, the LSTM structural design facilitates the long-term transmission of information, effectively alleviates the problem of gradient disappearance or explosion, and makes the model more stable when training deep networks. Therefore, in an optional embodiment, the second model can be an LSTM model.
[0135] For "complex and changeable" target objects, in order to obtain more accurate and reliable prediction information, the LSTM model is introduced. The LSTM model solves the problem of RNN short-term memory by adding gates on the basis of the RNN model, so that the recurrent neural network can truly and effectively utilize long-distance time series information. In the training process of the LSTM neural network, the data features at time t are first input into the input layer, and the results are output through the activation function. The output results, the hidden layer output at time t-1, and the information stored in the cell unit at time t-1 are input into the nodes of the LSTM structure. Through the processing of the Input Gate, Output Gate, Forget Gate and cell unit, the data is output to the next hidden layer or output layer, and the results of the LSTM structure nodes are output to the output layer neurons, the back propagation error is calculated, and each weight is updated. By using the LSTM memory capacity, the travel information of the target object can be fully utilized, so as to obtain more accurate travel prediction values of the target object.
[0136] When predicting the travel time of the target object, the following steps are specifically included:
[0137] Step 1: Data reading: Use Spark to read the travel start time and travel date.
[0138] Step 2: Data filtering: Filter out the complex and changeable travel records in the historical period closest to the current time (for example, within the past 50 working days), and split the data set into training set, validation set, and test set.
[0139] Step 3: Standardize the data: Standardize the digital features of the travel record information obtained above, and use word vector technology to convert it into digital high-dimensional information groups.
[0140] Step 4: Define the model structure: Further, define the structure of the LSTM neural network, including setting the number of LSTM units, the shape of the input data, the shape of the output data, etc. Add other types of layers between LSTM layers, including fully connected layers and Dropout layers, etc., to increase the complexity of the model or prevent overfitting. Select a loss function suitable for the regression problem, such as mean squared error (MSE), and select a suitable optimizer, such as stochastic gradient descent (SGD) or Adam.
[0141] Step 5 continuously models and predicts different days of the week for each target object: Due to the diversity of the travel of the variable target objects, the real information of the target objects' travel is continuously collected, the data set is expanded, and the powerful memory capacity of the deep network is used to continuously optimize the model, ultimately achieving perfect prediction of the responsible variable target objects.
[0142] Step 6: Save the prediction results: Convert the Pandas DataFrame of the prediction results to a Spark DataFrame, and use Spark SQL to store the prediction results in the corresponding Hive table.
[0143] For example, the travel data of a target object for several consecutive weeks is: Monday: [8:00, 8:05, 8:10, 7:55, 8:15], Tuesday: [9:00, 9:05, 9:10, 9:15, 9:20]. After the LSTM model is trained, the predicted travel time output by the LSTM model for Monday is 8:07, and the predicted travel time output by the LSTM model for Tuesday is 9:12.
[0144] Therefore, the technical solution provided in the embodiment of the present application is modeled according to the travel mode of the target object, and the appropriate prediction model (ARIMA model or LSTM model) is selected according to whether the travel mode of the target object is regular. For target objects with strong regularity, a simple ARIMA model can effectively predict. In the face of complex and changeable travel modes, the LSTM model can capture deeper time series characteristics, thereby achieving more accurate predictions.
[0145] Figure 4 A flow chart of a method for predicting the travel time of a target object provided by another embodiment of the present application is provided. In order to facilitate those skilled in the art to more clearly understand the technical solution of the present application, the following will be combined with Figure 4 Further explanation.
[0146] like Figure 4 As shown, the method for predicting the travel time of a target object provided in the embodiment of the present application includes:
[0147] S40: Acquire a travel information dataset;
[0148] In a specific embodiment, a trip information data set including but not limited to vehicle VIN, trip start time, trip end time, trip starting POI, trip end POI, trip date, trip mileage and trip number is obtained.
[0149] S41: Determine the travel mode. When the travel mode is a regular mode, proceed to step S42. When the travel mode is a complex and changeable mode, proceed to step S44.
[0150] Further, the travel mode of the target object is determined according to the travel information data set. Specifically, the travel attribute information of the target object is determined according to the travel information data set, wherein the travel attribute information is used to characterize at least one of the regularity of travel time, the regularity of travel space, the stability of travel frequency, and the consistency of travel mileage.
[0151] Further, based on the travel attribute information, a travel regularity score of the target object is generated, and according to the travel regularity score, the travel mode of the target object is determined. Since the method for determining the travel mode is described in detail in the above embodiment, reference may be made to the description of the above embodiment.
[0152] S42: clustering the travel information data set to determine the peak travel time of the target object;
[0153] S43: inputting the peak travel time into the first model for prediction;
[0154] When the target object's travel mode is a regular mode, that is, the travel is relatively regular, the peak travel time of the target object is first analyzed by a clustering algorithm to achieve dynamic time segmentation. Further, the peak time is input into the first model to predict the target object's future travel time.
[0155] S44: inputting the travel information data set into the second model for prediction;
[0156] Of course, if the travel mode of the target object is complex and changeable, the travel information dataset can be directly input into the second model.
[0157] S45: Output and store the predicted travel time.
[0158] In a specific embodiment, after the predicted travel time of the target object's future travel time is obtained, it is output and stored in step S45.
[0159] In the above embodiments, the method for predicting the travel time of a target object is described in detail. The present application also provides an embodiment corresponding to a device for predicting the travel time of a target object.
[0160] Figure 5A schematic diagram of a device for predicting the travel time of a target object provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the device comprises:
[0161] The data set acquisition module 50 is used to acquire the travel information data set of the historical vehicle used by the target object;
[0162] A travel mode determination module 51 is used to determine the travel mode of the target object according to the travel information data set; wherein the travel mode includes a regular mode and a complex and variable mode;
[0163] The travel time prediction module 52 is used to select a corresponding time series model according to the travel mode, so as to predict the vehicle travel time of the target object through the time series model.
[0164] In addition, the target object travel time prediction device provided in the embodiment of the present application also includes:
[0165] A travel attribute information determination module, used to determine the travel attribute information of the target object according to the travel information data set; wherein the travel attribute information is used to characterize at least one of the regularity of travel time, the regularity of travel space, the stability of travel frequency and the consistency of travel mileage;
[0166] A score generation module, used to generate a travel regularity score of a target object based on travel attribute information;
[0167] The travel mode determination module 51 is further used to determine the travel mode of the target object according to the travel regularity score.
[0168] A standardization processing module is used to perform standardization processing on the travel attribute information to obtain one or more target indicator values corresponding to the travel attribute information;
[0169] A weight allocation module is used to allocate corresponding weights to each target indicator value;
[0170] The score calculation module is used to calculate the travel regularity score based on the weight and target indicator value.
[0171] The processing module is used to determine that the travel mode is a regular mode when the travel regularity score is not greater than a preset score; and to determine that the travel mode is a complex and changeable mode when the travel regularity score is greater than the preset score.
[0172] The travel attribute information determination module is also used to determine the standard deviation of the regularity of travel time based on the start time of the trip; determine the entropy value of the regularity of travel space based on the starting POI and the end POI of the trip; determine the first coefficient of variation on the stability of travel frequency based on the number of trips; and determine the second coefficient of variation on the consistency of travel mileage based on the travel mileage.
[0173] The travel time prediction module 52 is also used to cluster the travel information data set to determine the peak travel time of the target object when the travel pattern is a regular pattern; and input the peak travel time into the first model to obtain the predicted travel time of the target object; when the travel pattern is a complex and changeable pattern, input the travel information data set into the second model to obtain the predicted travel time.
[0174] Figure 6 A schematic diagram of a device for predicting the travel time of a target object provided in another embodiment of the present application is shown in FIG. Figure 6 As shown, the device for predicting the travel time of a target object includes: a memory 60 for storing a computer program;
[0175] The processor 61 is used to implement the steps of the method for predicting the travel time of a target object mentioned in the above embodiment when executing a computer program.
[0176] The target object travel time prediction device provided in this embodiment may include but is not limited to a vehicle controller or a domain controller.
[0177] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of a digital signal processor (Digital Signal Processor, referred to as DSP), a field programmable gate array (Field-Programmable Gate Array, referred to as FPGA), and a programmable logic array (Programmable Logic Array, referred to as PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (Central Processing Unit, referred to as CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processor (Graphics Processing Unit, referred to as GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (Artificial Intelligence, referred to as AI) processor, which is used to process computing operations related to machine learning.
[0178] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the method for predicting the travel time of the target object disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, relevant data involved in the method for predicting the travel time of the target object, etc.
[0179] In some embodiments, the device for predicting the travel time of a target object may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0180] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the device for predicting the travel time of a target object, and may include more or fewer components than those shown in the figure.
[0181] The device for predicting the travel time of a target object provided in an embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the method for predicting the travel time of the target object in the above embodiment.
[0182] It should be noted that, although the operations are depicted in a specific order in the accompanying drawings, this should not be understood as requiring these operations to be performed in the specific order shown or to be performed sequentially, or requiring all illustrated operations to be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
Claims
1. A method for predicting the travel time of a target object, characterized in that: The method comprises: Obtain the target object's historical vehicle travel information dataset; Determine the travel mode of the target object according to the travel information data set; wherein the travel mode includes a regular mode and a complex and changeable mode; A corresponding time series model is selected according to the travel mode, so as to predict the vehicle travel time of the target object through the time series model.
2. The method for predicting the travel time of a target object according to claim 1, characterized in that: The determining the travel mode of the target object according to the travel information data set includes: Determine the travel attribute information of the target object according to the travel information data set; wherein the travel attribute information is used to characterize at least one of the regularity of travel time, the regularity of travel space, the stability of travel frequency and the consistency of travel mileage; Based on the travel attribute information, generating a travel regularity score for the target object; The travel mode of the target object is determined according to the travel regularity score.
3. The method for predicting the travel time of a target object according to claim 2, characterized in that: The travel information data set includes the travel start time, the travel starting point POI, the travel end point POI, the travel mileage and the number of trips within a preset period.
4. The method for predicting the travel time of a target object according to claim 3, characterized in that: The step of determining the travel attribute information of the target object according to the travel information data set includes: Determining a standard deviation of the regularity of the travel time based on the travel start time; Determine an entropy value of the travel space regularity according to the trip starting point POI and the trip end point POI; Determining a first coefficient of variation regarding stability of the travel frequency based on the number of trips; Based on the trip distance, a second coefficient of variation regarding consistency of the trip distance is determined.
5. The method for predicting the travel time of a target object according to claim 2, characterized in that: The step of generating a travel regularity score of the target object based on the travel attribute information includes: Standardizing the travel attribute information to obtain one or more target indicator values corresponding to the travel attribute information; Assigning corresponding weights to each of the target indicator values; The travel regularity score is calculated according to the weight and the target index value.
6. The method for predicting the travel time of a target object according to claim 2, characterized in that: Determining the travel mode of the target object according to the travel regularity score includes: When the travel regularity score is not greater than a preset score, determining the travel mode to be the regular mode; When the travel regularity score is greater than the preset score, the travel mode is determined to be the complex and changeable mode.
7. The method for predicting the travel time of a target object according to claim 1, characterized in that: The time series model includes a first model and a second model, and the selecting of a corresponding time series model according to the travel mode to predict the vehicle travel time of the target object through the time series model includes: When the travel mode is the regular mode, clustering the travel information data set to determine the peak travel time of the target object; and inputting the peak travel time into the first model to obtain the predicted travel time of the target object; When the travel mode is the complex and changeable mode, the travel information data set is input into the second model to obtain the predicted travel time.
8. A device for predicting the travel time of a target object, characterized in that: The device comprises: A data set acquisition module is used to acquire the travel information data set of the target object's historical vehicle use; A travel mode determination module, used to determine the travel mode of the target object according to the travel information data set; wherein the travel mode includes a regular mode and a complex and variable mode; The travel time prediction module is used to select a corresponding time series model according to the travel mode, so as to predict the vehicle travel time of the target object through the time series model.
9. A device for predicting the travel time of a target object, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the method for predicting the travel time of a target object as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for predicting the travel time of a target object as described in any one of claims 1 to 7 are implemented.
