Estimation method and system for daily order completion amount of online car-hailing platform
By combining the model architecture of CNN and Transformer, the local and global features of the online ride-hailing platform are extracted, and the sensitivity problem to outliers and nonlinear relationships in the existing technology is solved, and the accuracy and generalization of the complete order quantity prediction are improved. Ability to achieve real-time prediction.
Patent Information
- Application Number
- CN202411183872.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-22
AI Technical Summary
The existing online ride-hailing platform's order-complete prediction method is sensitive to outliers and is difficult to capture nonlinear relationship patterns, resulting in limited prediction accuracy and applicability.
Using a model architecture combining convolutional neural network (CNN) and Transformer, local features are extracted through the CNN encoder and used the Transformer decoder's multi-head attention mechanism and feedforward neural network to capture long-distance dependencies to generate daily completions in the next week. Estimated results of single quantity.
It improves prediction accuracy and model generalization capabilities, reduces the impact of outliers and nonlinear factors on the prediction results, provides real-time prediction capabilities, and helps online ride-hailing platforms better make resource scheduling and operational decisions.
Smart Images

Figure CN119006037A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of online car-hailing, and in particular to the estimation and evaluation of the number of completed orders on an online car-hailing platform, and in particular to a method and system for estimating the daily number of completed orders on an online car-hailing platform. Background Art
[0002] The estimation of the number of completed orders on online ride-hailing platforms is rooted in the rapid development of the industry and the increasingly competitive market environment. It is also a response to the deep need to continuously optimize operational efficiency and improve user experience. At present, the estimation of the number of completed orders on online ride-hailing platforms mainly relies on the technical means of time series analysis. However, the time series analysis method shows a high sensitivity when facing outliers in the data set. Specifically, if the data set is mixed with outliers, it is very likely to cause significant interference to the accuracy of the analysis results, thereby causing the prediction results to deviate from reality and reduce its application value. Therefore, in the process of using time series analysis to estimate the number of completed orders on online ride-hailing platforms, the effective handling of outliers is particularly critical, the purpose of which is to weaken or even eliminate the potential negative impact of outliers on the final analysis results.
[0003] Furthermore, time series data itself may contain complex nonlinear relationship patterns, such as periodic fluctuations, step changes and other characteristics. The existence of these characteristics poses a challenge to traditional linear models, because the latter often find it difficult to accurately capture and describe such nonlinear relationships. In view of this, when faced with time series data with complex nonlinear characteristics, traditional time series analysis methods may show obvious limitations, and their prediction accuracy and applicability may be restricted to varying degrees.
[0004] To this end, the present invention proposes a method and system for estimating the daily number of orders completed on an online ride-hailing platform. Summary of the invention
[0005] In view of this, the present invention hopes to provide a method and system for estimating the daily order volume of an online car-hailing platform to solve or alleviate the technical problems existing in the prior art, that is, how to make the daily order volume model of the online car-hailing platform not be interfered by outlier sensitivity and nonlinearity, so as to accurately estimate the daily order volume, and at least provide a beneficial option for this; the technical solution of the present invention is implemented as follows:
[0006] First, the estimation method for the daily order volume of online ride-hailing platforms:
[0007] 1. Overview:
[0008] The present invention provides a model architecture combining convolutional neural network (CNN) and Transformer, aiming to accurately estimate the number of completed orders on online ride-hailing platforms. The CNN encoder is used to extract local and high-level information of these features to form a rich feature representation. The Transformer decoder further processes these features, captures long-range dependencies through a multi-head attention mechanism and a feedforward neural network, and finally outputs the estimated results of the number of completed orders per day in the next week.
[0009] (II) Technical solution:
[0010] In order to achieve the above technical objectives, the present invention selects to execute the following operation steps.
[0011] 2.1 Step S1, Data Engineering:
[0012] Collect date and time features a, weather features b, holiday features c, city features d, competitor information e, marketing campaign data f, driver vehicle information g, and passenger behavior features h from various data sources (such as databases, API interfaces, external files, etc.);
[0013] Then the collected data is cleaned and the date and time features are encoded and converted into numerical forms that can be understood by the model;
[0014] One-hot encoding is performed on the above classification features (weather feature b, holiday feature c, city feature d, and driver vehicle information g);
[0015] Normalize the numerical features (competitor information e, marketing activity data f, and passenger behavior characteristics h);
[0016] Then, all the above features are integrated into the dataset D.
[0017] 2.1.1 Step S100, feature encoding:
[0018] a′=encodeDateTime(a);
[0019] Among them, a′ is the encoded date and time feature, and encodeDateTime is the encoding function.
[0020] For feature x = [b, c, d, g], perform one-hot encoding:
[0021]
[0022] Among them, x i ′ is the i-th element after one-hot encoding, category i is the i-th category of feature x.
[0023] 2.1.1 Step S101, normalization:
[0024] Normalize the feature y = [e, f, h]:
[0025]
[0026] Among them, y′ is the normalized feature, min(y) and max(y) are the minimum and maximum values of feature y, respectively.
[0027] 2.1.3 Step S102, coordinate all features into data set D:
[0028] D={a′,b′,c′,d′,e′,f′,g′,h′};
[0029] Among them, a′, b′, c′, d′, e′, f′, g′, and h′ are the processed date and time features, weather features, holiday features, city features, competitor information, marketing activity data, driver vehicle information, and passenger behavior characteristics, respectively.
[0030] 2.2 Step S2, feature reasoning:
[0031] The dataset D is input into the CNN encoder and converted into a three-dimensional tensor D' based on the input layer. The convolution layer extracts the local features of the three-dimensional tensor D' through convolution operations and forms high-level features D".
[0032] 2.2.1 Step S200, input layer conversion:
[0033] The dataset D is fed into the input layer of the CNN encoder and converted into a three-dimensional tensor D':
[0034] D′=InputLayerTransform(D);
[0035] Among them, D′ is the transformed three-dimensional tensor, and InputLayerTransform is the transformation function of the input layer.
[0036] 2.2.2 Step S201, convolutional layer feature extraction:
[0037] The convolution layer extracts the local features of the three-dimensional tensor D' through convolution operations. For the lth convolution kernel in the convolution layer, perform the following operations:
[0038]
[0039] Among them, Z l is the output of the lth convolution kernel, M and N are the row and column sizes of the convolution kernel when it slides on the input tensor, D i,j′ is the value of the input tensor D' at position (i, j), K l,i,j is the weight of the lth convolution kernel at position (i, j), b l is the bias term of the lth convolution kernel.
[0040] 2.2.3 Step S202, forming high-level features D”:
[0041] The convolution layer combines the outputs of multiple convolution kernels: D″=[Z1,Z2,…,Z L ];
[0042] Among them, D″ is the high-level feature representation, L is the number of convolution kernels in the convolution layer,
[0043] [Z1,Z2,…,Z L ] means concatenating the outputs of each convolution kernel in the depth direction.
[0044] 2.3 Step S3, generate the estimated result sequence S:
[0045] The high-level features D" are converted into one-dimensional sequence data s through the Transformer decoder, and the long-distance dependencies in the input sequence are captured based on the multi-head attention mechanism and feedforward neural network. The output layer in the form of a fully connected layer outputs the estimated result sequence S including the number of orders completed each day in the next week;
[0046] 2.3.1 Step S300, Transformer decoder conversion:
[0047] s=TransformerDecoder(D”);
[0048] Among them, TransformerDecoder is the transformation function of the Transformer decoder.
[0049] In the Transformer decoder, a multi-head attention mechanism is used to capture long-range dependencies in the input sequence. For the h-th head, its attention weight is for:
[0050]
[0051] in, is the attention score between position i and position j in the h-th head, and n is the length of the sequence.
[0052] The calculation of attention score is:
[0053]
[0054] in, and is the weight matrix of queries and keys in the hth head, q i and k j are the query and key vectors at position i and position j respectively, and d k is the dimension of the key vector.
[0055] 2.3.2 Step S301, feedforward neural network:
[0056] The output of the attention mechanism is further processed using a feedforward neural network:
[0057] FFN(s)=max(0,xW1+b1)W2+b2;
[0058] Among them, FFN is the function of the feedforward neural network, W1 and W2 are weight matrices, and b1 and b2 are bias terms.
[0059] 2.3.3 Step S302, output layer:
[0060] The output layer in the form of a fully connected layer outputs a sequence S of estimated results of the number of orders completed each day in the next week: S = OutputLayer(s);
[0061] Among them, OutputLayer is the function of the output layer.
[0062] 2.4 Model training and optimization:
[0063] Although the above model uses a CNN encoder and a Transformer decoder, the model still needs to be trained before it can be used, including using the mean square error loss function to measure the difference between the estimated result and the true value, and updating the model parameters through the back propagation algorithm; using the Adam optimizer to accelerate the convergence process of the model, using the Dropout regularization technique to prevent the model from overfitting, and finding the best model configuration through hyperparameter tuning.
[0064] 2.4.1 The first step is to calculate the loss function:
[0065] The mean square error (MSE) loss function is used to measure the difference between the estimated result and the true value.
[0066]
[0067] Where n is the number of samples, y i is the true value, It is an estimated result.
[0068] 2.4.2 The second step, back propagation algorithm:
[0069] The parameters of the model are updated through the back-propagation algorithm to minimize the loss function. For each parameter θ in the model, the update rule is:
[0070]
[0071] Where η is the learning rate, is the gradient of the loss function with respect to the parameters θ.
[0072] 2.4.3 Step 3, Adam optimizer:
[0073] The Adam optimizer is used to accelerate the convergence process of the model. The first-order moment estimate and the second-order moment estimate of the gradient are calculated, and the deviation is corrected. Finally, the parameter update rule is:
[0074]
[0075] Where θt is the parameter value at time step t, η is the learning rate, and They are the first-order moment estimate and the second-order moment estimate after bias correction, ∈ is a small constant (∈=10 -8 ) to prevent the denominator from being zero.
[0076] 2.4.4 The fourth step is to prevent the model from overfitting through Dropout regularization technology:
[0077] During training, for each neuron, its activation value is set to zero with a Dropout probability p:
[0078] Among them, r j is a random variable that follows a Bernoulli distribution, y is the activation value of the neuron, is the activation value after applying Dropout.
[0079] 2.4.5 Step 5: Hyperparameter Tuning:
[0080] Use techniques such as cross-validation to evaluate model performance under different hyperparameter combinations and select the best performing combination, including learning rate η, dropout probability p, batch size, and number of training rounds.
[0081] (III) Mechanism for solving technical problems:
[0082] CNN extracts local features of input data through convolutional layers. These features are robust to outliers and nonlinear factors. The extraction of local features helps the model capture subtle changes in the data and provides strong support for subsequent predictions. Transformer captures long-distance dependencies in the input sequence through a multi-head attention mechanism, and further processes features in combination with a feedforward neural network to generate accurate estimates of the number of completed orders. This step effectively addresses the impact of nonlinear factors on the prediction results and improves the generalization ability of the model.
[0083] Second, the system for estimating the number of orders completed daily on online ride-hailing platforms:
[0084] The system includes a processor and a memory connected to the processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the processor executes the estimation method as described above. At the same time, the processor is connected to:
[0085] (1) Data collection and preprocessing module for collecting feature data from multiple data sources:
[0086] Including date and time, weather, holidays, city information, competitor conditions, marketing activities, driver vehicle information and passenger behavior characteristics. Clean the collected data to remove duplicate, erroneous or invalid data to ensure data quality and reliability. Encode date and time features and convert them into numerical forms that the model can understand; one-hot encode categorical features; normalize numerical features to ensure consistency and efficiency of model training.
[0087] (2) Model building module that implements the model architecture combining CNN and Transformer:
[0088] The CNN encoder is used to extract local features of the input data and form a rich feature representation. The Transformer decoder uses a multi-head attention mechanism and a feedforward neural network to capture long-distance dependencies in the input sequence and generate accurate estimates of the number of completed orders. Integrating the advantages of CNN and Transformer enables the model to capture local details and process global information.
[0089] (3) Model training module for training the model using the collected and preprocessed dataset:
[0090] The mean square error loss function is used to measure the difference between the estimated result and the true value. The Adam optimizer is applied to accelerate the convergence process of the model, and the optimal model configuration is found through hyperparameter tuning. Regularization techniques and Dropout strategies are implemented to prevent overfitting of the model and improve the generalization ability of the model.
[0091] Compared with the prior art, the present invention has the following beneficial effects:
[0092] 1. Improve prediction accuracy: By combining the CNN and Transformer model architectures, the present invention can more effectively capture and utilize local and global features in the data, thereby improving the prediction accuracy of the daily number of online ride-hailing orders.
[0093] 2. Improve the generalization ability of the model: The present invention uses regularization technology and Dropout strategy to effectively prevent model overfitting, improve the generalization ability of the model, and enable the model to better adapt to new and unseen data.
[0094] 3. Provide real-time prediction capabilities: The technical solution of the present invention can process input data in real time and output prediction results, providing real-time order volume estimates for online ride-hailing platforms, which helps the platforms better schedule resources and make operational decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0096] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0097] Figure 2 Schematic diagram of three convolutional networks in step S2 of embodiment 1 of the present invention;
[0098] Figure 3 Schematic diagram of the convolution operation in step S2 of the first embodiment of the present invention;
[0099] Figure 4 This is a schematic diagram of a multi-head attention mechanism in step S3 of the first embodiment of the present invention;
[0100] Figure 5 It is a schematic diagram of the system composition of the present invention;
[0101] Figure 6 This is a flow chart of the second embodiment of the present invention. DETAILED DESCRIPTION
[0102] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below;
[0103] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0104] Explanation of relevant terms:
[0105] (1) Date and time features: including year, month, season, day of the week, and whether it is a working day, which are used to identify the temporal variation pattern of the number of completed orders.
[0106] (2) Weather characteristics: including temperature, rainfall and wind speed.
[0107] (3) Holiday characteristics: including statutory holidays and school holidays.
[0108] (4) Urban characteristics: including the population density and traffic conditions of the city.
[0109] (5) Competitor information: activities and promotions of other online ride-hailing platforms.
[0110] (6) Marketing activities: the platform’s own promotional activities and advertising.
[0111] (7) Driver vehicle information: including the number of available vehicles and the distribution of different types of vehicles.
[0112] (8) Passenger behavior characteristics: including activity level and number of historical orders.
[0113] Embodiment 1: Figures 1 to 4 As shown, this embodiment discloses a method for estimating the daily order volume of an online car-hailing platform, including the following execution steps:
[0114] In this embodiment, regarding step S1, data engineering: extracting historical order data from the database, including order time and order location.
[0115] Get real-time weather information such as temperature, humidity, and wind speed through the API interface.
[0116] Import holiday schedules and city zone data from external files.
[0117] Collect information on competitors' order volumes and promotions.
[0118] Extract the platform's own marketing activity data, such as coupon distribution and discount activities.
[0119] Get basic information about the driver and vehicle, such as vehicle type and driver level.
[0120] Analyze passenger behavior data, including passengers’ order frequency and preferred time periods.
[0121] Specifically, step S100, feature coding:
[0122] a′=encodeDateTime(a);
[0123] Among them, a′ is the encoded date and time feature, and encodeDateTime is the encoding function.
[0124] One-hot encoding of weather features (such as sunny, rainy, and snowy days);
[0125] One-hot encoding is performed on holiday features (such as weekdays, weekends, and statutory holidays).
[0126] One-hot encoding of city features (different cities or urban areas);
[0127] One-hot encode the driver’s vehicle information (vehicle type, driver level);
[0128]
[0129] Among them, x i ′ is the i-th element after one-hot encoding, category i is the i-th category of feature x.
[0130] Specifically, in step S101, normalization is performed on the feature y=[e,f,h]:
[0131] Normalize the competitor's order volume and scale it between 0 and 1;
[0132] Normalize campaign data to account for campaign size and reach;
[0133] Normalize passenger behavior characteristics, order frequency, and average ride time;
[0134]
[0135] Among them, y′ is the normalized feature, min(y) and max(y) are the minimum and maximum values of feature y, respectively.
[0136] Specifically, in step S102, all features are integrated into a data set D:
[0137] D={a′,b′,c′,d′,e′,f′,g′,h′};
[0138] Among them, a′, b′, c′, d′, e′, f′, g′, and h′ are the processed date and time features, weather features, holiday features, city features, competitor information, marketing activity data, driver vehicle information, and passenger behavior characteristics, respectively.
[0139] In this embodiment, regarding step S2, feature reasoning: the data set D (including processed date and time features, weather features, holiday features, city features, competitor information, marketing activity data, driver vehicle information and passenger behavior features) is input into the input layer of the CNN encoder, and is converted into a three-dimensional tensor D' based on the input layer. The convolution layer extracts local features of the three-dimensional tensor D' through convolution operations and forms high-level features D". The input layer converts the data set D into a three-dimensional tensor D', where the three dimensions of the tensor may represent the number of features, time steps (such as different time periods in a day) and spatial dimensions (such as different cities or regions), respectively.
[0140] Specifically, step S200, input layer conversion: The convolution layer extracts local features of the three-dimensional tensor D' through convolution operations. For each convolution kernel, it slides on the input tensor and multiplies it with the elements at the corresponding position of the input tensor, then sums and adds the bias term to obtain the output of the convolution kernel. Different convolution kernels can capture different local features in the input tensor, such as the relationship between date and time features and the number of completed orders, and the relationship between weather features and the number of completed orders. The dataset D is input to the input layer of the CNN encoder and converted into a three-dimensional tensor D':
[0141] D′=InputLayerTransform(D);
[0142] Among them, D′ is the transformed three-dimensional tensor, and InputLayerTransform is the transformation function of the input layer.
[0143] Specifically, step S201, convolution layer feature extraction The convolution layer extracts local features of the three-dimensional tensor D' through convolution operation. For the lth convolution kernel in the convolution layer, perform the following operations:
[0144]
[0145] Among them, Zl is the output of the lth convolution kernel, M and N are the row and column sizes of the convolution kernel when it slides on the input tensor, D i,j ′ is the value of the input tensor D' at position (i, j), K l,i,j is the weight of the lth convolution kernel at position (i, j), b l is the bias term of the lth convolution kernel. These high-level features contain more abstract and complex information in the input tensor, which is helpful for subsequent estimation tasks.
[0146] Step S202, the convolution layer combines the outputs of multiple convolution kernels: D″=[Z1,Z2,…,Z L ];
[0147] Among them, D″ is the high-level feature representation, L is the number of convolution kernels in the convolution layer,
[0148] [Z1,Z2,…,Z L ] means concatenating the outputs of each convolution kernel in the depth direction.
[0149] In this embodiment, regarding step S3, an estimated result sequence S is generated: the high-level feature D" is converted into a one-dimensional sequence data s through a Transformer decoder, and the long-distance dependencies in the input sequence are captured based on a multi-head attention mechanism and a feedforward neural network, and an estimated result sequence S including the number of orders completed each day in the next week is output based on an output layer in the form of a fully connected layer;
[0150] Step S300, Transformer decoder conversion: In the Transformer decoder, a multi-head attention mechanism is used to capture long-distance dependencies in the input sequence. This means that the model can take into account the impact of features in the past period of time on the future order completion volume:
[0151] s=TransformerDecoder(D”);
[0152] Among them, TransformerDecoder is the transformation function of the Transformer decoder.
[0153] In the Transformer decoder, a multi-head attention mechanism is used to capture long-range dependencies in the input sequence. For the h-th head, its attention weight is for:
[0154]
[0155] in, is the attention score between position i and position j in the hth head, and n is the length of the sequence. The output of the attention mechanism is further processed using a feedforward neural network to extract deeper features and prepare them for subsequent estimation tasks.
[0156] Furthermore, the calculation of the attention score is:
[0157]
[0158] in, and is the weight matrix of queries and keys in the hth head, q i and k j are the query and key vectors at position i and position j respectively, and d k is the dimension of the key vector.
[0159] Step S301, feedforward neural network:
[0160] The output of the attention mechanism is further processed using a feedforward neural network:
[0161] FFN(s)=max(0,xW1+b1)W2+b2;
[0162] Among them, FFN is the function of the feedforward neural network, W1 and W2 are weight matrices, and b1 and b2 are bias terms.
[0163] Specifically, step S302, output layer:
[0164] The output layer in the form of a fully connected layer outputs a sequence S of estimated results of the number of orders completed each day in the next week: S = OutputLayer(s);
[0165] Among them, OutputLayer is the function of the output layer. Based on the output layer in the form of a fully connected layer, the output of the feedforward neural network is converted into an estimated result sequence S of the number of orders completed each day in the next week. The output layer contains multiple neurons, each neuron corresponds to the estimated result of the number of orders completed in a day. Through the processing of the softmax activation function, the final estimated result sequence S can be obtained.
[0166] In this embodiment, the model python architecture program of the above steps S2 to S3 is as follows:
[0167]
[0168]
[0169]
[0170]
[0171] In the above program, the CNN encoder adds one dimension to the input data D to meet the requirements of conv2d. A one-dimensional convolution kernel is used to perform convolution operations on the feature dimension to extract local features. The output of the convolution layer is then flattened to obtain a high-level feature representation.
[0172] The input to the Transformer decoder is the high-level features of the CNN encoder. A multi-head attention mechanism is used to capture long-range dependencies in the input sequence. The output of the attention mechanism is further processed by a feedforward neural network. The output layer is a fully connected layer that outputs a sequence of estimated results of the number of orders completed each day in the next week.
[0173] Embodiment 2: Based on Embodiment 1, this embodiment further provides a training method for the model of Embodiment 1 as follows:
[0174] The first step is to calculate the loss function:
[0175] The mean square error (MSE) loss function is used to measure the difference between the estimated daily order volume and the actual value. Specifically, for each sample, we calculate the square of the difference between its estimated daily order volume and the actual daily order volume, then sum the squared differences of all samples and divide by the number of samples to get the MSE loss value.
[0176]
[0177] Where n is the number of samples, y i is the true value, It is an estimated result.
[0178] The second step is the back propagation algorithm:
[0179] The parameters of the model are updated through the back-propagation algorithm to minimize the loss function. For each parameter θ in the model, the update rule is:
[0180]
[0181] Where η is the learning rate, It is the gradient of the loss function with respect to the parameter θ, indicating the direction of parameter update.
[0182] Step 3, Adam optimizer:
[0183] The Adam optimizer is used to accelerate the convergence process of the model. The Adam optimizer updates the parameters by calculating the first-order moment estimate (i.e., mean) and the second-order moment estimate (i.e., uncentered variance) of the gradient and performing bias correction. The parameter update rule is:
[0184]
[0185] Where θt is the parameter value at time step t, η is the learning rate, and They are the first-order moment estimate and the second-order moment estimate after bias correction, ∈ is a small constant (∈=10 -8 ) to prevent the denominator from being zero.
[0186] The fourth step is to prevent the model from overfitting through Dropout regularization technology:
[0187] In order to prevent the model from overfitting, the Dropout regularization technique is applied. For each neuron in the neural network, its activation value is set to zero with a Dropout probability p. Specifically, for each neuron’s activation value y, a random variable r is generated that follows a Bernoulli distribution. j , then according to r j The value of determines whether to set y to zero:
[0188]
[0189] Among them, r j is a random variable that follows a Bernoulli distribution, y is the activation value of the neuron, is the activation value after applying Dropout.
[0190] Step 5: Hyperparameter tuning:
[0191] Use techniques such as cross-validation to evaluate model performance under different hyperparameter combinations and select the best performing combination, including learning rate η, dropout probability p, batch size, and number of training rounds. The best hyperparameter combination is selected by training the model under different hyperparameter combinations and evaluating its performance on the validation set. Specifically, we can use methods such as grid search or random search to traverse possible hyperparameter combinations and record the model performance under each combination. Finally, we select the best performing combination as the final hyperparameter setting.
[0192] Embodiment 3: Figure 5 As shown, based on the first embodiment, this embodiment further provides an estimation system for the daily order volume of the online car-hailing platform:
[0193] The system includes a processor and a memory connected to the processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the processor executes the estimation method as described above. At the same time, the processor is connected to:
[0194] (1) Data collection and preprocessing module for collecting feature data from multiple data sources:
[0195] Including date and time, weather, holidays, city information, competitor conditions, marketing activities, driver vehicle information and passenger behavior characteristics. Clean the collected data to remove duplicate, erroneous or invalid data to ensure data quality and reliability. Encode date and time features and convert them into numerical forms that the model can understand; one-hot encode categorical features; normalize numerical features to ensure consistency and efficiency of model training.
[0196] (2) Model building module that implements the model architecture combining CNN and Transformer:
[0197] The CNN encoder is used to extract local features of the input data and form a rich feature representation. The Transformer decoder uses a multi-head attention mechanism and a feedforward neural network to capture long-distance dependencies in the input sequence and generate accurate estimates of the number of completed orders. Integrating the advantages of CNN and Transformer enables the model to capture local details and process global information.
[0198] (3) Model training module for training the model using the collected and preprocessed dataset:
[0199] The mean square error loss function is used to measure the difference between the estimated result and the true value. The Adam optimizer is applied to accelerate the convergence process of the model, and the optimal model configuration is found through hyperparameter tuning. Regularization techniques and Dropout strategies are implemented to prevent overfitting of the model and improve the generalization ability of the model.
[0200] All the above embodiments only express the implementation methods of the relevant practical applications of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
[0201] For those skilled in the art, it can be further appreciated that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0202] At the same time, those skilled in the art can understand that all or part of the processes in all the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Claims
1. A method for estimating the daily order volume of an online car-hailing platform, characterized in that: The steps are as follows: S1, collects date and time features a, weather features b, holiday features c, city features d, competitor information e, marketing activity data f, driver vehicle information g, and passenger behavior features h, and integrates them into data set D; S2, input the dataset D into the CNN encoder, convert it into a three-dimensional tensor D' based on the input layer, and the convolution layer extracts the local features of the three-dimensional tensor D' through convolution operations and forms high-level features D"; S3, the high-level features D" are converted into one-dimensional sequence data s through the Transformer decoder, and the long-distance dependencies in the input sequence are captured based on the multi-head attention mechanism and feedforward neural network. The output layer in the form of a fully connected layer outputs the estimated result sequence S including the number of orders completed each day in the next week.
2. The estimation method according to claim 1, characterized in that: In said S1, it includes: S100, a′=encodeDateTime(a); Where a′ is the encoded date and time feature, encodeDateTime is the encoding function; x i ′ is the i-th element after one-hot encoding, category i is the i-th category of feature x; S101, perform normalization on the feature y = [e, f, h]: Among them, y′ is the normalized feature, min(y) and max(y) are the minimum and maximum values of feature y, respectively.
3. The estimation method according to claim 2, characterized in that: In S1, the data set D = {a′, b′, c′, d′, e′, f′, g′, h′}; Among them, a′, b′, c′, d′, e′, f′, g′, and h′ are the processed date and time features, weather features, holiday features, city features, competitor information, marketing activity data, driver vehicle information, and passenger behavior characteristics, respectively.
4. The estimation method according to claim 1, characterized in that: In said S2, it includes: S200, input the data set D into the input layer of the CNN encoder and convert it into a three-dimensional tensor D': D'=InputLayerTransform(D); Where D′ is the transformed three-dimensional tensor, and InputLayerTransform is the transformation function of the input layer; S201, for the lth convolution kernel in the convolution layer, perform the following operations: Among them, Z l is the output of the lth convolution kernel, M and N are the row and column sizes of the convolution kernel when it slides on the input tensor, D i,j ′ is the value of the input tensor D' at position (i, j), K l,i,j is the weight of the lth convolution kernel at position (i, j), b l is the bias term of the lth convolution kernel.
5. The estimation method according to claim 4, characterized in that: In S2, the convolution layer combines the outputs of multiple convolution kernels: D″=[Z1, Z2, …, Z L ]; Among them, D″ is the high-level feature representation, L is the number of convolution kernels in the convolution layer, [Z1,Z2,…,Z L ] means concatenating the outputs of each convolution kernel in the depth direction.
6. The estimation method according to claim 1, 2 or 4, characterized in that: In said S3, it includes: S300, s=TransformerDecoder(D”); Among them, TransformerDecoder is the transformation function of the Transformer decoder; S301, using a feedforward neural network: FFN(s)=max(0,xW1+b1)W2+b2; Among them, FFN is the function of the feedforward neural network, W1 and W2 are weight matrices, and b1 and b2 are bias terms; S302, the output layer in the form of a fully connected layer outputs a sequence S of estimated results including the number of orders completed each day in the next week: S = OutputLayer(s); Among them, OutputLayer is the function of the output layer.
7. The estimation method according to claim 6, characterized in that: In the S300, a multi-head attention mechanism is used to capture long-distance dependencies in the input sequence; For the h-th head, its attention weight is: in, is the attention score between position i and position j in the h-th head, and n is the length of the sequence.
8. The estimation method according to claim 7, characterized in that: The calculation of attention score is: in, and is the weight matrix of queries and keys in the hth head, q i and k j are the query and key vectors at position i and position j respectively, and d k is the dimension of the key vector.
9. A system for estimating the number of orders completed daily on an online car-hailing platform, characterized by: The system includes a processor and a memory connected to the processor, wherein program instructions are stored in the memory, and when the program instructions are executed by the processor, the processor executes the estimation method according to any one of claims 1 to 8.
10. The estimation system according to claim 9, characterized in that: The processor is connected with, A data collection and preprocessing module for collecting feature data from multiple data sources; A model building module that implements a model architecture combining CNN and Transformer; Model training module for training models using collected and preprocessed datasets.
Citation Information
Cited By
CNN-Transform-based dynamic flexible job shop scheduler and scheduling method
CN120215438A
