Methods, devices, equipment, and media for predicting long-term available capacity of intercity ride-hailing services based on a multi-task model using physical information.
Through a multi-task model based on physical information, combined with the principle of capacity conservation and deep learning technology, the accuracy and correlation problems of long-term capacity prediction of intercity online ride-hailing are solved, and more accurate long-term capacity prediction and more stable service quality are achieved. .
Patent Information
- Application Number
- CN202411247314.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-06
AI Technical Summary
The existing intercity online ride-hailing capacity prediction methods mainly focus on short-term predictions, making it difficult to effectively make long-term predictions, and failing to fully consider the correlation between capacity changes between the two cities, resulting in mismatch between supply and demand and unstable service quality.
Using a multi-task model based on physical information, by obtaining historical orders and capacity data, designing the loss function of the capacity conservation principle, using the two-way long and short-term memory network and the Transformer layer, extracting shared features and assigning expert network features to make long-term availability in the two cities Capacity forecast.
It improves the accuracy and physical consistency of the long-term available capacity forecast of intercity online ride-hailing, provides sufficient scheduling time and demand management strategies, alleviates potential supply and demand mismatch problems.
Smart Images

Figure CN118761567B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of inter-city online car-hailing capacity technology, and specifically to a method, device, equipment and medium for predicting the long-term available capacity of inter-city online car-hailing based on a physical information multi-task model. Background Art
[0002] With the rapid expansion of modern technology and urban transportation networks, intercity online ride-hailing services have become increasingly important as an important bridge connecting cities. It has not only driven rapid economic growth, but also promoted exchanges and cooperation between regions. However, with the sharp increase in demand for intercity online ride-hailing services, intercity online ride-hailing services are also facing many challenges, such as imbalance between supply and demand, traffic jams during peak hours, and unstable service quality. Therefore, it is very important for intercity operating platforms to be able to predict available capacity in advance to avoid demand mismatches. This can not only effectively alleviate potential supply and demand contradictions, but also improve the overall service level.
[0003] At present, in the existing online car-hailing capacity prediction methods, only the short-term capacity prediction within the city is targeted. The short-term prediction uses fewer influencing factors and a simple model to meet the demand, but it is only suitable for immediate decision-making and has limited scheduling operation space. Intercity online car-hailing has a lag in capacity supply due to its long-distance travel, so it is particularly important to make long-term predictions on the available capacity of intercity online car-hailing. Long-term predictions require more data and more complex models to capture future long-term trends in advance, provide more ample scheduling time, and optimize the allocation of vehicle resources. Among them, short-term predictions are data for predicting one time slice, two time slices, three time slices, etc. in the future, and long-term predictions are data for predicting one time slice, two time slices, three time slices, etc. in the future. At the same time, there is a correlation between the capacity changes of intercity online car-hailing in the two cities, and there is a capacity conservation principle, that is, there are three situations for the location of capacity, in city A, in city B, and on the road between the two cities. Therefore, the prediction of a single city for intercity online car-hailing needs to consider not only the information of the city itself, but also the information of another city.
[0004] In view of this, this application is filed. Summary of the invention
[0005] The present invention provides a method, device, equipment and medium for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model, which can at least partially improve the above-mentioned problems.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for predicting the long-term available capacity of inter-city online ride-hailing vehicles based on a physical information multi-task model, comprising:
[0008] Obtain historical order data and historical capacity data of intercity online ride-hailing vehicles on the current route, and pre-process the historical order data and historical capacity data;
[0009] Obtain available transport capacity according to a preset time interval, use an operation time slice corresponding to the available transport capacity as an available transport capacity feature, and encode multiple features of the operation time slice to obtain multiple coded features corresponding to each time slice, wherein the coded features include time features, external features, historical data features, flow features, and demand features;
[0010] Designing a total loss function according to the intercity capacity conservation principle, wherein the total loss function is a weighted sum of mean square error loss and capacity balance loss;
[0011] Sorting the coded features of the operation time slices in chronological order, normalizing the sorted features to obtain a data set, and segmenting the normalized data set according to a preset time step to obtain input data for a prediction model;
[0012] Through the multi-task prediction framework of the preset prediction model, the available capacity of the two cities is predicted simultaneously. The bidirectional long short-term memory network BiLSTM is used as the shared expert network to extract the shared features of the two tasks. The gating network is used to allocate the feature contributions of different expert networks according to the specific needs of different tasks, and the feature representation specific to each task is generated after position encoding processing. An independent Transformer layer is designed for each task to obtain the prediction results of the long-term available capacity of the two cities on the current route.
[0013] The present invention also provides a device, comprising:
[0014] A historical data acquisition unit, used to acquire historical order data and historical capacity data of inter-city online ride-hailing vehicles on the current route, and pre-process the historical order data and historical capacity data;
[0015] an encoding unit, configured to obtain available transport capacity according to a preset time interval, use an operation time slice corresponding to the available transport capacity as an available transport capacity feature, and encode multiple features of the operation time slice to obtain multiple encoding features corresponding to each time slice, wherein the encoding features include time features, external features, historical data features, flow features, and demand features;
[0016] A loss function unit, used to design a total loss function according to the inter-city transport capacity conservation principle, wherein the total loss function is a weighted sum of a mean square error loss and a transport capacity balance loss;
[0017] A data segmentation unit, used to sort the coded features of the operation time slices in chronological order, normalize the sorted features to obtain a data set, and segment the normalized data set according to a preset time step to obtain input data for a prediction model;
[0018] The prediction unit is used to simultaneously predict the available capacity of two cities through a multi-task prediction framework of a preset prediction model. It uses a bidirectional long short-term memory network BiLSTM as a shared expert network to extract the shared features of the two tasks, and uses a gating network to allocate feature contributions of different expert networks according to the specific needs of different tasks. After position encoding processing, it generates a specific feature representation for each task, and designs an independent Transformer layer for each task to obtain the long-term available capacity prediction results of the two cities on the current route.
[0019] The present invention also provides a device for predicting the long-term available capacity of inter-city online ride-hailing vehicles based on a physical information multi-task model, which includes a memory and a processor, wherein a computer program is stored in the memory, and the computer program can be executed by the processor to implement a method for predicting the long-term available capacity of inter-city online ride-hailing vehicles based on a physical information multi-task model as described in any one of the above.
[0020] The present invention also provides a computer-readable storage medium storing a computer program, which can be executed by a processor of a device where the computer-readable storage medium is located to implement a method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model as described in any one of the above.
[0021] In summary, the long-term available capacity prediction method for intercity online ride-hailing vehicles based on the physical information multi-task model mines relevant influencing factors based on historical data information, designs a loss function that follows the principle of conservation of capacity in view of the characteristics of intercity online ride-hailing vehicles, and simultaneously extracts and utilizes data from two cities through a multi-task prediction framework. This integrated method effectively captures long-term and long-distance dependencies, improves the accuracy of the long-term available capacity prediction results of intercity online ride-hailing vehicles and complies with physical consistency, so that relevant transportation agencies not only have sufficient scheduling time, but also can deploy demand management strategies in advance to alleviate potential mismatches between demand and supply. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flowchart of a method for predicting the long-term available transport capacity of an inter-city online car-hailing vehicle based on a physical information multi-task model provided by the first embodiment of the present invention;
[0023] Figure 2 It is a schematic diagram of the process of order data preprocessing of the method for predicting the long-term available transportation capacity of inter-city online car-hailing vehicles based on the physical information multi-task model provided by the first embodiment of the present invention;
[0024] Figure 3 It is a schematic diagram of the flow of capacity data preprocessing of the method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on the physical information multi-task model provided by the first embodiment of the present invention;
[0025] Figure 4 It is a schematic diagram of the prediction model structure of the method for predicting the long-term available transportation capacity of inter-city online car-hailing vehicles based on the physical information multi-task model provided by the first embodiment of the present invention;
[0026] Figure 5 It is a structural schematic diagram of the long-term available capacity prediction device for inter-city online car-hailing based on the physical information multi-task model provided by the second embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0028] refer to Figure 1 , Figure 4 As shown, the first embodiment of the present invention discloses a method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model, which can be executed by a long-term available capacity prediction device for inter-city online car-hailing vehicles based on a physical information multi-task model (hereinafter referred to as the prediction device), and in particular, executed by one or more processors in the prediction device to implement the following method:
[0029] S1, obtaining historical order data and historical capacity data of intercity online taxis on the current route, and preprocessing the historical order data and historical capacity data;
[0030] Specifically, step S1 includes: cleaning interference data in the historical order data, wherein the interference data includes duplicate data, non-passenger riding data, and invalid data;
[0031] Clean the missing data in the historical capacity data.
[0032] Specifically, in this embodiment, available transport capacity (i.e., available transport capacity) refers to the number of available vehicles. Valid data refers to carpooling order data and chartered car order data. The interference data in the historical data includes duplicate data, non-passenger riding data, and invalid data. Therefore, the historical data needs to be cleaned. The cleaning process is as follows: Figure 2 and Figure 3 shown.
[0033] Duplicate data refers to the situation where a passenger makes multiple travel requests on the same day but is only successfully served once or not served at all. For such data, the uniqueness of the passenger ID can be used to determine whether to retain the duplicate data. If the same passenger has multiple travel request orders on the same day and none of them are served, determine whether each order is in the same time slice. If there are two or more orders in the same time slice, retain the first order in the time slice; if the same passenger has multiple travel request orders on the same day and one order is served, delete the remaining orders with failed travel requests. Non-passenger ride orders refer to freight orders, where users place orders and entrust intercity operators to deliver across cities. Such orders have a large time constraint range and are generally considered to interfere with data and are deleted. Invalid data refers to lying and supplementing orders, that is, orders where intercity operators send vehicles across cities to supplement the transportation capacity of neighboring cities. Such orders have no starting point and end point, and have no actual travel demand significance. They are generally considered to interfere with data and are deleted. Among them, missing data refers to data in which transportation capacity information is not recorded or cannot be obtained in certain time intervals.
[0034] S2, obtaining available transport capacity according to a preset time interval, taking an operation time slice corresponding to the available transport capacity as a feature of the available transport capacity, and encoding multiple features of the operation time slice to obtain multiple coded features corresponding to each time slice, wherein the coded features include time features, external features, historical data features, flow features, and demand features;
[0035] Specifically, step S2 includes: dividing the operation time of the online car-hailing service into a plurality of operation time slices according to a preset time window size, and obtaining the available transport capacity characteristics within the time interval indicated by the operation time slices, and using the available transport capacity characteristics as the predicted label;
[0036] The multiple features of the operation time slice are encoded to obtain multiple feature codes of each time slice, wherein the classification features are processed by read-hot encoding, and the remaining features are processed by numerical encoding. The classification features include week features, holiday features, weather features, and precipitation features.
[0037] In this embodiment, the time interval represented by each slice is , Indicates the time corresponding to the slice, Indicates the time window size. Get the time interval as Available capacity information, extract available capacity characteristics , the available transport force features can be used as predicted labels.
[0038] According to the principle of capacity conservation, data from different sources are encoded to fuse multi-source data and construct time features that meet the requirements of model training. , External features , Historical data characteristics , Flow characteristics , Demand characteristics . Numerical encoding is used to process non-categorical features, and read-hot encoding is used to process categorical features.
[0039] Weekly Features For time slice The feature of the day of the week to which the date belongs is encoded using read-hot encoding. ,in , the value is 0 or 1, 0 means it is not that day, 1 means it is that day. The variables are represented as Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday.
[0040] Holiday Features , which represents time slice The holiday characteristics of the date are read-hot encoded. ,in , the value is 0 or 1, 0 means it is not a holiday of this type, and 1 means it is a holiday of this type. Each variable represents holidays and normal days respectively.
[0041] Weather characteristics For time slice The weather characteristics of the date are encoded using read-hot encoding. ,in , the value is 0 or 1, 0 represents not this type of weather, 1 represents this type of weather. Each variable is represented as sunny, cloudy, overcast, light rain, and other.
[0042] Precipitation characteristics For time slice The precipitation characteristics of the date are coded with numerical values to indicate the amount of precipitation.
[0043] Temperature characteristics For time slice The temperature characteristics of the date are coded numerically. , each variable is represented as maximum temperature, minimum temperature, and average temperature.
[0044] Historical data characteristics For time slice The historical data characteristics of the date are coded with numerical values. , where the variables represent time slices The historical available transport capacity for the corresponding time interval, each variable is represented by the historical available transport capacity two weeks ago, one week ago, one week ago, two days ago, and one day ago respectively.
[0045] Flow characteristics For time slice The flow characteristics of the date are coded numerically. , each variable is represented by the available transport capacity flow of the previous two time slices, the available transport capacity flow of the previous time slice, and the minimum outflow of transport capacity in the current time slice.
[0046] Demand characteristics For time slice The demand characteristics of the date are coded with numerical values, indicating the number of people who need to travel in the current time slice.
[0047] S3, designing a total loss function according to the inter-city transport capacity conservation principle, wherein the total loss function is a weighted sum of a mean square error loss and a transport capacity balance loss;
[0048] Specifically, step S3 includes: designing the capacity balance loss according to the inter-city capacity conservation principle, and the formula is:
[0049] ;
[0050] in, To balance the loss of transport capacity, is the number of time steps, is the actual available transport capacity of City A, is the predicted available transport capacity of city A, is the actual available transport capacity of City B, is the predicted available transport capacity of city B;
[0051] Design mean square error loss, the formula is:
[0052] ;
[0053] in, is the mean square error loss;
[0054] According to the capacity balance loss and mean square error loss, the total loss function is obtained, and the formula is:
[0055]
[0056] in, is the total loss, is a hyperparameter that balances the mean square error loss and the capacity balance loss.
[0057] In this embodiment, the purpose of the capacity balance loss is to make the predicted total available capacity close to the actual total available capacity.
[0058] S4, sorting the coded features of the operation time slices in chronological order, normalizing the sorted features to obtain a data set, and segmenting the normalized data set according to a preset time step to obtain input data for a prediction model;
[0059] Specifically, step S4 includes: the data set is divided into a training data set and a test data set in proportion, and when training the model, the input data of the model includes input samples and output samples.
[0060] In this embodiment, step S4 is used to obtain the input samples and output samples of the model. The data set is divided into a training data set and a test data set in proportion. During training, the input data of the model includes input samples and output samples. The multi-source data after feature encoding is sorted from small to large by time slices to assemble a new data set. Then the maximum and minimum normalization method is used to standardize the data set.
[0061] Next, the processed data set is divided into training data set and test data set in proportion. The input samples of the multi-task prediction model are constructed according to the specified input step size and output step size. , and output samples .
[0062] Model input: two cities Moment History Time slice data and .in, express City data, express City data, Represents the historical time step of the input, time slice data , is the time feature (including week and holiday features), are external characteristics (including weather, precipitation, temperature), is the historical data feature, is the flow characteristic, is the demand characteristic of the current time slice, It is the available transport capacity feature of the current time slice.
[0063] .
[0064] Model output: two cities Moment of the future Available capacity for each time slice and .in, express The city's available transport capacity, express The city's available transport capacity, Indicates the time step of the output.
[0065] .
[0066] S5, through the multi-task prediction framework of the preset prediction model, simultaneously predicts the available capacity of two cities, adopts the bidirectional long short-term memory network BiLSTM as the shared expert network, extracts the shared features of the two tasks, uses the gating network to allocate the feature contributions of different expert networks according to the specific needs of different tasks, and generates the specific feature representation of each task after position encoding processing. An independent Transformer layer is designed for each task to obtain the long-term available capacity prediction results of the two cities on the current route.
[0067] Specifically, step S5 includes: predicting the available transport capacity of the two cities simultaneously through a multi-task prediction framework of a preset prediction model, wherein the multi-task prediction framework processes and utilizes data of the two cities simultaneously to ensure that the prediction model can refer to the transport capacity information of another city when predicting the transport capacity of one city;
[0068] The shared expert network is used through a shared feature extraction module to capture the shared features between the two tasks, expressed as:
[0069] ;
[0070] In the formula, input data and Through the shared feature extraction module , output shared features , each expert network Extract the most important features from it and generate specific feature representations after processing these features .
[0071] The gating network is used to dynamically calculate the weighted sum coefficient according to the specific requirements of different tasks, distribute the feature contributions of different expert networks, multiply the output features of all shared expert networks by the weighted coefficients of the gating network and then add them together to generate task-specific feature representations. The expression is:
[0072] ;
[0073] In the formula, It is The weighted coefficients of the expert networks are calculated using the softmax function. It is The output features of the expert network are It's a task In time The feature representation of is the weighted sum of all expert network output features, It's a task For The weighted coefficients of the output features of the expert network, It's a task In time The characteristic representation of It's a task For The weighted coefficients of the output features of the expert network.
[0074] Adding position encoding to the feature representation extracted from each task to enhance the temporal information, wherein the position encoding uses a combination of sine and cosine functions;
[0075] For the data after position encoding, the Transformer model is introduced, and an independent Transformer layer is designed for each task to better adapt to the specific needs and characteristics of each task. Expression:
[0076] ;
[0077] In the formula, It's a task The prediction results, It's a task The prediction results, It's a task The final data after processing, It's a task The final data after processing.
[0078] In this embodiment, the data of two cities are input, and the model can predict two task objectives at the same time based on the correlation of the data of the two cities. The bidirectional long short-term memory network (BiLSTM) is selected as the shared expert network, and its ability to capture the bidirectional dependencies of time series data helps to better meet long-term predictions. Position encoding is added to the feature representation extracted from each task to improve the ability to capture long-term dependencies and the accuracy of long-term predictions. Position encoding uses a combination of sine and cosine functions to ensure the uniqueness of the encoded signal. Designing an independent Transformer layer can ensure that each task can extract high-level features that are highly relevant to itself from the shared feature representation. At the same time, the Transformer can effectively capture long-distance dependencies, thereby improving the accuracy of long-term predictions.
[0079] In this embodiment, the method for predicting the long-term available capacity of intercity online ride-hailing vehicles based on the physical information multi-task model mines relevant influencing factors based on historical data information, designs a loss function that follows the principle of conservation of capacity in view of the characteristics of intercity online ride-hailing vehicles, and simultaneously extracts and utilizes data from two cities through a multi-task prediction framework to capture long-term and long-distance dependencies, which can effectively improve the accuracy of the long-term available capacity prediction results of intercity online ride-hailing vehicles and ensure physical consistency, so that relevant transportation agencies not only have sufficient scheduling time, but also can deploy demand management strategies in advance to alleviate potential mismatches between demand and supply.
[0080] The method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on the physical information multi-task model adopts a grid search method to set the model experimental parameters during training to obtain the optimal parameter combination. A method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on the physical information multi-task model of embodiment 1 of the present invention is described with a specific case to verify the effectiveness of the method of the present invention.
[0081] The historical order data and capacity data of intercity online taxis on a certain route of an intercity operating company are selected as the research objects, as shown in Tables 1 and 2. The specific time is from March 1, 2023 to May 31, 2023, and the time window size is 30 minutes, divided into 32 time slices according to the operating hours of 06:00-22:00.
[0082] Table 1 Historical order data
[0083]
[0084] Table 2 Historical capacity data
[0085]
[0086] After cleaning the data, the operation time is divided into time windows of 30 minutes to construct the features required for model training. An example of model features is shown in Table 3.
[0087] Table 3 Model feature description
[0088]
[0089] The features after feature encoding are assembled into a data set, and the training set and test set are divided into a ratio of 4:1. The input step size is 224 (a week of time slice data). ), the output step size is 32 (one day of time slice data ) construct the input and output samples of the model, and the prediction target is to use the historical data of the two cities for one week and , predict the available capacity for the next day and The amount of time slices and the number of samples constructed are shown in Table 4.
[0090] Table 4 Time slice quantity and sample number
[0091]
[0092] The parameter setting for model training uses the best parameter combination searched on the Internet, and the obtained model parameter combinations are shown in Table 5.
[0093] Table 5 Model parameters
[0094]
[0095] After completing the training of the available capacity prediction model for intercity online car-hailing, the test set is input into the model for testing, and all prediction results are evaluated. The evaluation indicators root mean square error (RMSE), mean absolute error (MAE), and symmetric mean absolute percentage error (SMAPE) are used to evaluate the prediction accuracy of the model. The lower the value, the better the prediction accuracy of the model. The calculation formulas of the three evaluation indicators are as follows:
[0096] ;
[0097] in, It represents the true value, It represents the predicted value. is the total number of samples.
[0098] The inter-city online car-hailing long-term available capacity prediction method based on the physical information multi-task model is compared with the following six currently typical prediction model methods.
[0099] (1) Long short-term memory (LSTM) is a recurrent neural network (RNN) that is specifically designed to process and predict time series data. By introducing memory units and gating mechanisms, LSTM can more effectively capture long-term dependencies in long sequences and solve the gradient vanishing problem of traditional RNN in long sequence processing.
[0100] (2) Bidirectional long short-term memory (BiLSTM) is an extension of LSTM, which enhances the ability to understand time series data by processing the forward and backward information of the sequence simultaneously. This structure enables BiLSTM to more comprehensively capture the dependencies in the sequence and is suitable for tasks that require consideration of contextual information.
[0101] (3) Autoformer is a model based on automatic feature learning and Transformer, designed specifically for time series forecasting. It automatically adapts to different time series patterns by learning the features and structure of the data and generates accurate forecast results. Autoformer has strong adaptability and can handle a variety of time series data.
[0102] (4) Informer is a variant of the Transformer model, designed to capture long-distance dependencies in sequences. It has strong generalization capabilities and is suitable for various time series prediction tasks. Informer can efficiently process long sequence data by optimizing the self-attention mechanism.
[0103] (5) PatchTST is a model that uses a graph convolutional network (GCN) and a self-attention mechanism for the prediction and analysis of time series data. PatchTST focuses on capturing the spatial relationships and periodic features in the data and is suitable for time series data with complex spatial dependencies and periodicity.
[0104] (6) Transformer is a neural network model based on the self-attention mechanism. It was originally used for natural language processing tasks, but is also widely used in time series prediction. Transformer captures the dependencies in the sequence through the self-attention mechanism, has parallel processing capabilities, and can efficiently process long sequence data.
[0105] The performance of the above methods in terms of prediction effect is shown in Table 6:
[0106] Table 6 Prediction results of different methods
[0107]
[0108] By comparing the MAE, RMSE, and SMAPE of different methods, it can be found that the long-term available capacity prediction method for intercity online car-hailing based on physical information multi-task provided by the present invention, when the multi-task prediction model considers the correlation between two tasks and the principle of conservation of capacity, the three evaluation indicators are significantly lower than other prediction models, and it shows a better accuracy in long-term prediction.
[0109] This example also compares the performance of the prediction model with and without flow characteristics, as shown in Table 7:
[0110] Table 7 Prediction effect with or without flow characteristics
[0111]
[0112] By comparing the prediction effects with and without flow features, the results show that the introduction of flow features provides the model with rich context information, helps the model to more accurately understand the capacity change trend, and improves the model's prediction ability. This embodiment also conducts corresponding ablation experiments, as shown in Table 8.
[0113] Table 8 Ablation experiment
[0114]
[0115] According to the comparison results of the ablation experiment, (1) when the gated network is removed, the outputs of all expert networks are averaged, the model loses flexibility, and cannot focus on the most important features, resulting in a decrease in model performance. This shows that the gated network can reasonably allocate the feature contributions of different expert networks according to different task requirements and improve model performance. (2) When multiple tasks share the Transformer layer, all tasks use the same feature transformation, and the model cannot meet the specific requirements of each task, resulting in different degrees of decline in the prediction results of different tasks. This shows that designing a separate Transformer layer for each task can better adapt to the specific mode of each task and improve the overall performance of the model. (3) When the capacity balance constraint is removed, the model performance decreases, indicating that the capacity conservation constraint makes the model follow physical rationality in the prediction process and improves the prediction ability. (4) After removing the shared expert network, the single-task model performance decreases significantly, indicating that the multi-task prediction model can capture and utilize the association and complementary relationship between different tasks and improve the overall performance of the model.
[0116] In summary, the method for predicting the long-term available capacity of intercity online ride-hailing vehicles based on the physical information multi-task model mines relevant influencing factors based on historical data information, designs a loss function that follows the principle of conservation of capacity according to the characteristics of intercity online ride-hailing vehicles, and simultaneously extracts and utilizes data from two cities through a multi-task prediction framework to capture long-term and long-distance dependencies. It can effectively improve the accuracy of the long-term available capacity prediction results of intercity online ride-hailing vehicles and ensure physical consistency, so that relevant transportation agencies not only have sufficient scheduling time, but also can deploy demand management strategies in advance to alleviate potential mismatches between demand and supply.
[0117] See also Figure 5 The second embodiment of the present invention further provides a device for predicting the long-term available transportation capacity of inter-city online car-hailing vehicles based on a physical information multi-task model, which includes:
[0118] A historical data acquisition unit 101 is used to acquire historical order data and historical capacity data of inter-city online ride-hailing vehicles on the current route, and pre-process the historical order data and historical capacity data;
[0119] The encoding unit 102 is used to obtain the available transport capacity according to the preset time interval, use the operation time slice corresponding to the available transport capacity as the available transport capacity feature, and encode multiple features of the operation time slice to obtain multiple encoding features corresponding to each time slice, wherein the encoding feature includes time feature, external feature, historical data feature, flow feature, and demand feature;
[0120] A loss function unit 103, used to design a total loss function according to the inter-city transport capacity conservation principle, wherein the total loss function is a weighted sum of a mean square error loss and a transport capacity balance loss;
[0121] The data segmentation unit 104 is used to sort the coded features of the operation time slices in chronological order, normalize the sorted features to obtain a data set, and segment the normalized data set according to a preset time step to obtain input data for a prediction model;
[0122] The prediction unit 105 is used to simultaneously predict the available capacity of two cities through a multi-task prediction framework of a preset prediction model, adopt a bidirectional long short-term memory network BiLSTM as a shared expert network, extract the shared features of the two tasks, use a gating network to allocate feature contributions of different expert networks according to the specific needs of different tasks, and generate a specific feature representation for each task after position encoding processing, and design an independent Transformer layer for each task to obtain the prediction results of the long-term available capacity of the two cities on the current route.
[0123] The third embodiment of the present invention also provides a device for predicting the long-term available capacity of inter-city online ride-hailing vehicles based on a physical information multi-task model, which includes a memory and a processor, wherein a computer program is stored in the memory, and the computer program can be executed by the processor to implement a method for predicting the long-term available capacity of inter-city online ride-hailing vehicles based on a physical information multi-task model as described in any one of the above.
[0124] The fourth embodiment of the present invention also provides a computer-readable storage medium storing a computer program, which can be executed by a processor of a device where the computer-readable storage medium is located, so as to implement a method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model as described in any one of the above.
[0125] Exemplarily, the above-mentioned devices and process steps can be implemented by a computer program. The computer program can be divided into one or more units. The one or more units are stored in the memory and executed by the processor to complete the present invention.
[0126] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0127] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the present invention by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0128] Wherein, if the electronic device or printer integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0129] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0130] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model, characterized in that: include: Obtain historical order data and historical capacity data of intercity online ride-hailing vehicles on the current route, and pre-process the historical order data and historical capacity data; Obtain available transport capacity according to a preset time interval, use an operation time slice corresponding to the available transport capacity as an available transport capacity feature, and encode multiple features of the operation time slice to obtain multiple coded features corresponding to each time slice, wherein the coded features include time features, external features, historical data features, flow features, and demand features; Designing a total loss function according to the intercity capacity conservation principle, wherein the total loss function is a weighted sum of mean square error loss and capacity balance loss; Sorting the coded features of the operation time slices in chronological order, normalizing the sorted features to obtain a data set, and segmenting the normalized data set according to a preset time step to obtain input data for a prediction model; Through the multi-task prediction framework of the preset prediction model, the available capacity of the two cities is predicted simultaneously. The bidirectional long short-term memory network BiLSTM is used as the shared expert network to extract the shared features of the two tasks. The gating network is used to allocate the feature contributions of different expert networks according to the specific needs of different tasks, and the feature representation specific to each task is generated after position encoding processing. An independent Transformer layer is designed for each task to obtain the prediction results of the long-term available capacity of the two cities on the current route.
2. The method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model according to claim 1 is characterized in that: The historical order data and historical transportation capacity data are preprocessed, specifically: Cleaning interference data in the historical order data, wherein the interference data includes duplicate data, non-passenger riding data, and invalid data; Clean the missing data in the historical capacity data.
3. The method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model according to claim 1 is characterized in that: The available transport capacity is obtained according to a preset time interval, and the operation time slice corresponding to the available transport capacity is used as the available transport capacity feature. Multiple features of the operation time slice are encoded to obtain multiple encoding features corresponding to each time slice, specifically: According to the preset time window size, the operation time of the online car-hailing service is divided into multiple operation time slices, and the available transport capacity characteristics within the time interval indicated by the operation time slices are obtained, and the available transport capacity characteristics are used as the predicted labels; The multiple features of the operation time slice are encoded to obtain multiple feature codes of each time slice, wherein the classification features are processed by read-hot encoding, and the remaining features are processed by numerical encoding. The classification features include week features, holiday features, weather features, and precipitation features.
4. The method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model according to claim 1 is characterized in that: The total loss function is designed according to the principle of conservation of intercity transport capacity, specifically: According to the principle of intercity capacity conservation, the capacity balance loss is designed, and the formula is: ; in, To balance the loss of transport capacity, is the number of time steps, is the actual available transport capacity of City A, is the predicted available transport capacity of city A, is the actual available transport capacity of City B, is the predicted available transport capacity of city B; Design mean square error loss, the formula is: ; in, is the mean square error loss; According to the capacity balance loss and mean square error loss, the total loss function is obtained, and the formula is: ; in, is the total loss, is a hyperparameter that balances the mean square error loss and the capacity balance loss.
5. The method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model according to claim 1 is characterized in that: The data set is segmented according to a preset time step to construct input data for a multi-task prediction model, and is divided into a training data set and a test data set in proportion.
6. The method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model according to claim 1 is characterized in that: Combining a variety of existing technologies, through the multi-task prediction framework of the preset prediction model, the available capacity of two cities is predicted simultaneously. The bidirectional long short-term memory network BiLSTM is used as the shared expert network to extract the shared features of the two tasks. The gating network is used to allocate the feature contributions of different expert networks according to the specific needs of different tasks, and the feature representation specific to each task is generated after position encoding processing. An independent Transformer layer is designed for each task to obtain the prediction results of the long-term available capacity of the two cities on the current route. Specifically: The available transport capacity of the two cities is predicted simultaneously by a multi-task prediction framework of a preset prediction model, wherein the multi-task prediction framework processes and utilizes data of the two cities simultaneously to ensure that the prediction model can refer to the transport capacity information of the other city when predicting the transport capacity of one city; The shared expert network is used through a shared feature extraction module to capture the shared features between the two tasks, expressed as: ; In the formula, input data and Through the shared feature extraction module , output shared features , each expert network Extract the most important features from it and generate specific feature representations after processing these features , Represents H historical time slice data of city A at time t, Represents H historical time slice data of city B at time t; The gating network is used to dynamically calculate the weighted sum coefficient according to the specific requirements of different tasks, distribute the feature contributions of different expert networks, multiply the output features of all shared expert networks by the weighted coefficients of the gating network and then add them together to generate task-specific feature representations. The expression is: ; In the formula, It is The weighted coefficients of the expert networks are calculated using the softmax function. It is The output features of the expert network are It's a task In time The feature representation of is the weighted sum of all expert network output features, It's a task For The weighted coefficients of the output features of the expert network, It's a task In time The characteristic representation of It's a task For The weighted coefficients of the output features of the expert network; Adding position encoding to the feature representation extracted from each task to enhance the temporal information, wherein the position encoding uses a combination of sine and cosine functions; For the data after position encoding, the Transformer model is introduced. An independent Transformer layer is designed for each task to better adapt to the specific needs and characteristics of each task. The expression is: ; In the formula, It's a task The prediction results, It's a task The prediction results, It's a task The final data after processing, It's a task The final data after processing.
7. A device for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model, characterized in that: include: A historical data acquisition unit, used to acquire historical order data and historical capacity data of inter-city online ride-hailing vehicles on the current route, and pre-process the historical order data and historical capacity data; an encoding unit, configured to obtain available transport capacity according to a preset time interval, use an operation time slice corresponding to the available transport capacity as an available transport capacity feature, and encode multiple features of the operation time slice to obtain multiple encoding features corresponding to each time slice, wherein the encoding features include time features, external features, historical data features, flow features, and demand features; A loss function unit, used to design a total loss function according to the inter-city transport capacity conservation principle, wherein the total loss function is a weighted sum of a mean square error loss and a transport capacity balance loss; A data segmentation unit, used to sort the coded features of the operation time slices in chronological order, normalize the sorted features to obtain a data set, and segment the normalized data set according to a preset time step to obtain input data for a prediction model; The prediction unit is used to simultaneously predict the available capacity of two cities through a multi-task prediction framework of a preset prediction model. It uses a bidirectional long short-term memory network BiLSTM as a shared expert network to extract the shared features of the two tasks, and uses a gating network to allocate feature contributions of different expert networks according to the specific needs of different tasks. After position encoding processing, it generates a specific feature representation for each task, and designs an independent Transformer layer for each task to obtain the long-term available capacity prediction results of the two cities on the current route.
8. A device for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the method for predicting the long-term available capacity of inter-city online car-hailing vehicles based on a physical information multi-task model as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program can be executed by a processor of the device where the computer-readable storage medium is located to implement the long-term available capacity prediction method for inter-city online car-hailing based on the physical information multi-task model as described in any one of claims 1 to 6.
