Order delivery time prediction method and device, electronic device and storage medium
By obtaining the actual arrival and pick-up time of the delivery staff, training the meal time prediction model and using different loss functions, the problem of inaccurate prediction of order meal time in the existing technology is solved, and more accurate prediction results are achieved. Business scenario requirements.
Patent Information
- Application Number
- CN201910872902.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-16
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2039-09-16
AI Technical Summary
In the prior art, the method for predicting order meal delivery time is based on the delivery staff's pick-up time, resulting in inaccurate prediction, because the delivery staff's pick-up time may not be equal to the order meal delivery time, resulting in inaccurate delivery scheduling results.
By obtaining the actual arrival time and actual meal pickup time of the delivery staff, training the meal time prediction model, and flexibly adopting different loss functions based on the relationship between the predicted meal time and the actual arrival time of the orders of different samples, the Perform model training to ensure the accuracy of prediction results.
It improves the accuracy of order meal time prediction, makes the prediction results more in line with the needs of the business scenario, and avoids the impact of delivery efficiency caused by delivery staff arriving at the store too early or too late.
Smart Images

Figure CN110717620B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network technology, and in particular to a method and device for predicting order delivery time, an electronic device and a storage medium. Background Art
[0002] Order delivery time refers to the time from when the merchant receives the order to when the merchant prepares the food. Order delivery time represents the difficulty of delivering the order, and can be used as an important parameter of the order delivery scheduling system, directly affecting the results of order suppression and dispatching. Therefore, it is very important to improve the accuracy of order delivery time prediction.
[0003] Related technologies usually predict the order delivery time based on the order delivery person's pick-up time. However, in actual delivery, the delivery person's pick-up time may not be equal to the order delivery time. For example, the order may be delivered before the delivery person picks up the food. Therefore, the order delivery time predicted by this method is not accurate. Summary of the invention
[0004] The purpose of the present invention is to provide a method and device for predicting the delivery time of an order, an electronic device and a storage medium to solve the problems existing in the related art.
[0005] In order to achieve the above object, according to a first aspect of an embodiment of the present disclosure, a method for predicting order delivery time is provided, comprising:
[0006] Get the actual arrival time and pick-up time of the delivery person for the order to be delivered;
[0007] Inputting the actual store arrival time and the actual meal pickup time into a meal delivery time prediction model to obtain a predicted meal delivery time for the order to be delivered;
[0008] Among them, for sample orders with different relationships among the predicted meal delivery time, the actual arrival time of the delivery person and the actual meal pickup time, different loss functions are used to train the meal delivery time prediction model.
[0009] Optionally, the loss function is used to characterize the mapping relationship between the loss amount predicted by the meal delivery time prediction model and the predicted meal delivery time, actual store arrival time and actual meal pickup time of the sample order;
[0010] When the predicted meal delivery time of the sample order is later than the actual meal pickup time of the delivery person of the sample order, the loss function is the first relationship function;
[0011] When the predicted meal delivery time of the sample order is between the actual arrival time of the delivery person of the sample order and the actual meal pickup time, the loss function is the second relationship function;
[0012] When the predicted delivery time of a sample order is earlier than the actual arrival time of the delivery person of the sample order, the loss function is the third relationship function.
[0013] Optionally, for the same sample order, the loss amount calculated by the second relationship function is smaller than the loss amount calculated by the first relationship function and the loss amount calculated by the third relationship function.
[0014] Optionally, the meal delivery time prediction model is trained according to the following method:
[0015] Obtain a sample data set, where the sample data set includes the actual arrival time of the delivery personnel and the actual pickup time of different sample orders;
[0016] For each sample order of the sample data set, determine the loss function corresponding to the sample order according to the relationship between the predicted meal delivery time, the actual arrival time of the delivery person, and the actual meal pickup time of the sample order;
[0017] Constructing a total loss function according to the loss function of each sample order in the sample data set;
[0018] With the goal of minimizing the total loss function, an optimization algorithm is used to train the meal delivery time prediction model.
[0019] Optionally, the method further comprises:
[0020] Select a target coefficient combination from a plurality of preset coefficient combinations corresponding to the loss function expression;
[0021] The loss function is determined according to the target coefficient combination and the loss function expression.
[0022] Optionally, selecting a target coefficient combination from a plurality of preset coefficient combinations of corresponding loss function expressions includes:
[0023] Substitute each coefficient combination in the multiple coefficient combinations into the loss function expression to obtain a loss function to be selected;
[0024] For each of the candidate loss functions, perform the following operations:
[0025] A candidate prediction model is obtained by training the candidate loss function and a preset training set;
[0026] Using a pre-set validation set to evaluate the effectiveness of the candidate prediction model;
[0027] From all the obtained candidate prediction models, the coefficient combination corresponding to the candidate prediction model with the best effect is used as the target coefficient combination.
[0028] Optionally, the loss function expression is:
[0029]
[0030] in, is the predicted loss amount for sample order i; is the predicted pickup time of the sample order i; arrivetime i The actual arrival time of the delivery person for the sample order i; taketime i is the actual pick-up time of the delivery person for the sample order i; α and β are a coefficient combination of the loss function expression, and β>α>1.
[0031] According to a second aspect of an embodiment of the present disclosure, there is provided a device for predicting order delivery time, comprising:
[0032] The acquisition module is used to obtain the actual arrival time and actual pickup time of the delivery personnel for the order to be delivered;
[0033] A prediction module, used to input the actual store arrival time and the actual meal pickup time into a meal delivery time prediction model to obtain a predicted meal delivery time for the order to be delivered;
[0034] Among them, for sample orders with different relationships among the predicted meal delivery time, the actual arrival time of the delivery person and the actual meal pickup time, different loss functions are used to train the meal delivery time prediction model.
[0035] Optionally, the loss function is used to characterize the mapping relationship between the loss amount predicted by the meal delivery time prediction model and the predicted meal delivery time, actual store arrival time and actual meal pickup time of the sample order;
[0036] When the predicted meal delivery time of the sample order is later than the actual meal pickup time of the delivery person of the sample order, the loss function is the first relationship function;
[0037] When the predicted meal delivery time of the sample order is between the actual arrival time of the delivery person of the sample order and the actual meal pickup time, the loss function is the second relationship function;
[0038] When the predicted delivery time of a sample order is earlier than the actual arrival time of the delivery person of the sample order, the loss function is the third relationship function.
[0039] Optionally, for the same sample order, the loss amount calculated by the second relationship function is smaller than the loss amount calculated by the first relationship function and the loss amount calculated by the third relationship function.
[0040] Optionally, the device further comprises a training module, and the training module is used to train the meal delivery time prediction model according to the following method:
[0041] Obtain a sample data set, where the sample data set includes the actual arrival time of the delivery personnel and the actual pickup time of different sample orders;
[0042] For each sample order of the sample data set, determine the loss function corresponding to the sample order according to the relationship between the predicted meal delivery time, the actual arrival time of the delivery person, and the actual meal pickup time of the sample order;
[0043] Constructing a total loss function according to the loss function of each sample order in the sample data set;
[0044] With the goal of minimizing the total loss function, an optimization algorithm is used to train the meal delivery time prediction model.
[0045] Optionally, the device further comprises:
[0046] A selection module, used for selecting a target coefficient combination from a plurality of preset coefficient combinations corresponding to the loss function expression;
[0047] A determination module is used to determine the loss function according to the target coefficient combination and the loss function expression.
[0048] Optionally, the selection module includes:
[0049] A first determination submodule is used to bring each coefficient combination in the multiple coefficient combinations into the loss function expression to obtain a loss function to be selected;
[0050] The loop submodule is used to perform the following operations for each of the candidate loss functions:
[0051] A candidate prediction model is obtained by training the candidate loss function and a preset training set;
[0052] Using a pre-set validation set to evaluate the effectiveness of the candidate prediction model;
[0053] The second determination submodule is used to take the coefficient combination corresponding to the candidate prediction model with the best effect from all the obtained candidate prediction models as the target coefficient combination.
[0054] Optionally, the loss function expression is:
[0055]
[0056] in, is the predicted loss amount for sample order i; is the predicted pickup time of the sample order i; arrivetime i The actual arrival time of the delivery person for the sample order i; taketime i is the actual pick-up time of the delivery person for the sample order i; α and β are a coefficient combination of the loss function expression, and β>α>1.
[0057] According to a third aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0058] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0059] a memory having a computer program stored thereon;
[0060] A processor is used to execute the computer program in the memory to implement the steps of the method described in the first aspect.
[0061] Through the above technical scheme, at least the following technical effects can be achieved: for the training of the meal delivery time prediction model, the relationship between the meal delivery time of the order and the actual arrival time of the deliveryman and the actual pickup time is comprehensively considered. For sample orders with different relationships among the predicted meal delivery time, the actual arrival time of the deliveryman and the actual pickup time, different loss functions are flexibly used to correct the training of the meal delivery time prediction model. Compared with using the same loss function for all sample orders, the actual arrival time of the deliveryman and the actual pickup time of the order can be fully utilized, so that the prediction results of the trained meal delivery time prediction model are more accurate and more reasonable, and then based on the meal delivery time prediction model, the predicted meal delivery time for the delivery order is predicted to be more accurate and more in line with the needs of the business scenario.
[0062] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0064] Figure 1 is a flow chart of a method for predicting order delivery time according to an exemplary embodiment of the present disclosure;
[0065] Figure 2 is a schematic diagram of a loss function according to an exemplary disclosed embodiment of the present disclosure;
[0066] Figure 3 is a flowchart of a method for training a meal delivery time prediction model according to an exemplary embodiment of the present disclosure;
[0067] Figure 4 is a flowchart of a method for determining a loss function according to an exemplary embodiment of the present disclosure;
[0068] Figure 5 is a block diagram of a device for predicting order delivery time according to an exemplary embodiment of the present disclosure;
[0069] Figure 6 is a block diagram of a device for predicting order delivery time according to another exemplary embodiment of the present disclosure;
[0070] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0071] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0072] The present disclosure is mainly applied to delivery business scenarios such as takeaway delivery and supermarket delivery. In such delivery business, it is usually necessary to predict the order delivery time (i.e., the time required from the merchant receiving the order to the merchant preparing the food) in order to schedule the delivery of the order. The order delivery time prediction method in the related art usually predicts the order delivery time based on the order delivery person's meal pick-up time. However, in the actual delivery process, the delivery person's meal pick-up time may not be equal to the order delivery time. For example, the order has been delivered before the delivery person picks up the meal, so the order delivery time predicted by this method is not accurate.
[0073] In order to solve the above technical problems, the embodiments of the present disclosure provide a method for predicting the order delivery time, so as to improve the accuracy of the prediction results of the order delivery time.
[0074] Figure 1 is a flow chart of a method for predicting order delivery time according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the method comprises the following steps:
[0075] S101. Obtain the actual store arrival time and actual meal pickup time of the delivery person for the order to be delivered.
[0076] S102. Input the actual arrival time of the deliveryman and the actual pickup time into the meal delivery time prediction model to obtain the predicted meal delivery time of the order to be delivered, wherein different loss functions are used to train the meal delivery time prediction model for sample orders with different relationships among the predicted meal delivery time, the actual arrival time of the deliveryman and the actual pickup time.
[0077] Among them, in actual business scenarios, the relationship between the predicted delivery time of an order, the actual arrival time of the deliveryman and the actual pickup time usually includes the following three situations, namely, ① the predicted delivery time of the order is later than the actual pickup time of the deliveryman of the order; ② the predicted delivery time of the order is between the actual arrival time of the deliveryman of the order and the actual pickup time; ③ the predicted delivery time of the order is earlier than the actual arrival time of the deliveryman of the order.
[0078] For the first case, the predicted result of the order delivery time may be too optimistic, that is, the order has not been delivered yet but the delivery person arrives at the store early, which will cause the delivery person to wait for a long time before picking up the food after arriving at the store, affecting the delivery efficiency of the order and other existing orders of the delivery person. For the third case, the predicted result of the order delivery time may be too conservative, that is, the delivery person arrives at the store too late and the order has actually been delivered, which will affect the delivery time of the delivery person's existing orders. For the second case, the predicted result of the order delivery time is moderate, which can avoid the situation where the delivery person arrives at the store too early or too late, and thus can ensure the delivery time of the order.
[0079] Based on this, for the training of the meal delivery time prediction model, the above three situations are comprehensively considered. For sample orders that meet the above different situations, different loss functions are flexibly used to correct the training of the meal delivery time prediction model. Compared with using the same loss function for all sample orders, the actual arrival time of the delivery person and the actual pick-up time of the order can be fully utilized, so that the prediction results of the trained meal delivery time prediction model are more accurate and reasonable. Then, based on the meal delivery time prediction model, the predicted meal delivery time for the order to be delivered is more accurate and more in line with the needs of the business scenario.
[0080] In order to enable those skilled in the art to better understand the technical solution provided by the embodiments of the present disclosure, the method for predicting the order delivery time provided by the embodiments of the present disclosure is described in detail below.
[0081] First, for the loss function described in the above step S102, the loss function can be used to characterize the mapping relationship between the loss amount predicted by the meal delivery time prediction model and the predicted meal delivery time of the sample order, the actual arrival time of the deliveryman and the actual pickup time. Specifically, in the above first case, that is, the predicted meal delivery time of the sample order is later than the actual pickup time of the deliveryman of the sample order, at this time, the loss function is the first relationship function; in the above second case, that is, the predicted meal delivery time of the sample order is between the actual arrival time of the deliveryman of the sample order and the actual pickup time, at this time, the loss function is the second relationship function; in the above third case, that is, the predicted meal delivery time of the sample order is earlier than the actual arrival time of the deliveryman of the sample order, at this time, the loss function is the third relationship function.
[0082] Furthermore, the above loss function satisfies the following condition: for the same sample order, the loss amount calculated by the above second relationship function is less than the loss amount calculated by the above first relationship function and the loss amount calculated by the above third relationship function. Figure 2 As shown, Figure 2 A schematic diagram of a possible loss function is shown, where the horizontal axis represents the predicted delivery time of the sample order The vertical axis represents the loss amount predicted by the meal delivery time prediction model arrive time i represents the actual arrival time of the delivery person for sample order i, taketime i Indicates the actual pickup time of the deliveryman for sample order i.
[0083] In this way, different loss functions are used to train the order prediction model for training samples that meet the above-mentioned different situations. Since the loss amount of the above-mentioned second situation is smaller than the loss amount of the above-mentioned first situation and the loss amount of the above-mentioned third situation, the meal delivery time prediction model will be more inclined to make the predicted meal delivery time of the order that originally meets the second situation more accurate, that is, the meal delivery time prediction model will tend to make the predicted meal delivery time of the order between the actual arrival time of the deliveryman and the actual pick-up time, and then predict the meal delivery time of the order through the meal delivery time prediction model, which can avoid the problem of subsequent order delivery being affected due to the deliveryman arriving at the store too early or too late.
[0084] Secondly, with respect to the meal delivery time prediction model in the above step S102, the disclosed embodiment also includes a method for training the meal delivery time prediction model. It is worth noting that the training of the meal delivery time prediction model is performed in advance based on the massive sample orders collected. In the subsequent process of predicting the meal delivery time of the order, there is no need to train the meal delivery time prediction model every time, or the meal delivery time prediction model can be periodically updated based on the newly collected sample orders.
[0085] Specifically, the training method for the meal delivery time prediction model is as follows: Figure 3 As shown, the following steps are included:
[0086] S301: Obtain a sample data set.
[0087] The sample data set includes the actual arrival time and actual pickup time of the delivery personnel for different sample orders.
[0088] S302. For each sample order in the sample data set, determine the loss function corresponding to the sample order according to the relationship between the predicted delivery time of the sample order, the actual arrival time of the delivery person, and the actual pickup time.
[0089] Specifically, when using the meal delivery time prediction model to predict the meal delivery time of all orders in the sample data set, for each sample order, if the predicted meal delivery time of the sample order is later than the actual meal pickup time of the deliveryman of the sample order, the loss function corresponding to the sample order is determined to be the above-mentioned first relationship function; if the predicted meal delivery time of the sample order is between the actual arrival time of the deliveryman and the actual meal pickup time, the loss function of the sample is determined to be the above-mentioned second relationship function; if the predicted meal delivery time of the sample order is earlier than the actual arrival time of the deliveryman, the loss function corresponding to the sample order is determined to be the third relationship function. Thus, the loss function corresponding to each sample order in the sample data set is obtained.
[0090] S303. Construct a total loss function according to the loss function of each sample order in the sample data set.
[0091] Specifically, the loss function of each sample order in the sample data set can be used as the total loss function, that is, Where N is the number of sample orders in the sample data set.
[0092] S304, with the goal of minimizing the total loss function, using an optimization algorithm to train a meal delivery time prediction model.
[0093] The optimization algorithm may be a gradient descent (GD) algorithm.
[0094] By adopting the method of training the meal delivery time prediction model, different loss functions are adopted for sample orders with different relationships between the predicted meal delivery time and the actual arrival time and actual pickup time of the deliveryman, and a total loss function is constructed based on the loss function of each sample order. The model is trained with the goal of minimizing the total loss function. The meal delivery time prediction model can be made to tend to make the predicted meal delivery time of the order fall between the actual arrival time and the actual pickup time of the deliveryman. Then, the meal delivery time of the order can be predicted by the meal delivery time prediction model, which can avoid the problem of the delivery of subsequent orders being affected due to the deliveryman arriving at the store too early or too late.
[0095] Furthermore, in another exemplary embodiment of the present disclosure, the loss function described in the above step S102, the embodiment of the present disclosure also includes a method for determining the loss function.
[0096] Specifically, the method for determining the loss function is as follows: Figure 4 As shown, the following steps are included:
[0097] S401. Select a target coefficient combination from multiple sets of coefficient combinations corresponding to the preset loss function expressions.
[0098] Optionally, the loss function expression can be in the following form:
[0099]
[0100] in, is the predicted loss amount for sample order i; is the predicted pickup time of the sample order i; arrivetime i The actual arrival time of the delivery person for the sample order i; taketime i is the actual pick-up time of the delivery person for the sample order i; α and β are a coefficient combination of the loss function expression, and β>α>1.
[0101] The loss function corresponds to multiple sets of preset coefficient combinations. In an optional implementation, any coefficient combination can be selected from the multiple preset coefficient combinations as the target coefficient combination.
[0102] In another optional implementation, in order to further improve the accuracy of the trained meal delivery time prediction model, each coefficient combination in the multiple coefficient combinations can also be first substituted into the loss function expression to obtain a candidate loss function. Then, for each candidate loss function, the following operations are performed: a candidate prediction model is obtained by training the candidate loss function and a pre-set training set; and the effect of the candidate prediction model is evaluated using a pre-set validation set. Finally, from all the obtained candidate prediction models, the coefficient combination corresponding to the candidate prediction model with the best effect is used as the target coefficient combination.
[0103] S402: Determine the loss function according to the target coefficient combination and the loss function expression.
[0104] Specifically, the determined target coefficient combination is substituted into the loss function expression to obtain the loss function.
[0105] The disclosed embodiment also provides a device for predicting meal delivery time. Figure 5 is a block diagram of a device for predicting order delivery time according to an exemplary embodiment of the present disclosure. Figure 5 As shown, the device 500 includes:
[0106] Acquisition module 501, used to obtain the actual arrival time of the delivery person of the order to be delivered and the actual pickup time;
[0107] Prediction module 502, used to input the actual store arrival time and the actual meal pickup time into a meal delivery time prediction model to obtain a predicted meal delivery time for the order to be delivered;
[0108] Among them, for sample orders with different relationships among the predicted meal delivery time, the actual arrival time of the delivery person and the actual meal pickup time, different loss functions are used to train the meal delivery time prediction model.
[0109] By using the above-mentioned meal delivery time prediction device, different loss functions are adopted for sample orders with different relationships between the predicted meal delivery time and the actual arrival time and actual pickup time of the deliveryman, and a total loss function is constructed based on the loss function of each sample order. Model training is performed with the goal of minimizing the total loss function. The meal delivery time prediction model can be made to tend to make the predicted meal delivery time of the order fall between the actual arrival time and the actual pickup time of the deliveryman. Then, the meal delivery time of the order is predicted by the meal delivery time prediction model, which can avoid the problem of the delivery of subsequent orders being affected due to the deliveryman arriving at the store too early or too late.
[0110] Optionally, the loss function is used to characterize the mapping relationship between the loss amount predicted by the meal delivery time prediction model and the predicted meal delivery time, actual store arrival time and actual meal pickup time of the sample order;
[0111] When the predicted meal delivery time of the sample order is later than the actual meal pickup time of the delivery person of the sample order, the loss function is the first relationship function;
[0112] When the predicted meal delivery time of the sample order is between the actual arrival time of the delivery person of the sample order and the actual meal pickup time, the loss function is the second relationship function;
[0113] When the predicted delivery time of a sample order is earlier than the actual arrival time of the delivery person of the sample order, the loss function is the third relationship function.
[0114] Optionally, for the same sample order, the loss amount calculated by the second relationship function is smaller than the loss amount calculated by the first relationship function and the loss amount calculated by the third relationship function.
[0115] In this way, different loss functions are used to train the order prediction model for training samples that meet the above-mentioned different situations. Since the loss amount calculated by the above-mentioned second relationship function is smaller than the loss amount calculated by the above-mentioned first relationship function and the loss amount calculated by the above-mentioned third relationship function, the meal delivery time prediction model will be more inclined to make the prediction results of orders that originally meet the predicted meal delivery time between the actual arrival time of the deliveryman and the actual pickup time more accurate, that is, the meal delivery time prediction model will tend to make the predicted meal delivery time of the order between the actual arrival time of the deliveryman and the actual pickup time, and then predict the meal delivery time of the order through the meal delivery time prediction model, which can avoid the problem of subsequent order delivery being affected due to the deliveryman arriving at the store too early or too late.
[0116] Alternatively, if Figure 6 As shown, the device 500 further includes a training module 503, and the training module 503 is used to train the meal delivery time prediction model according to the following method:
[0117] Obtain a sample data set, where the sample data set includes the actual arrival time of the delivery personnel and the actual pickup time of different sample orders;
[0118] For each sample order of the sample data set, determine the loss function corresponding to the sample order according to the relationship between the predicted meal delivery time, the actual arrival time of the delivery person, and the actual meal pickup time of the sample order;
[0119] Constructing a total loss function according to the loss function of each sample order in the sample data set;
[0120] With the goal of minimizing the total loss function, an optimization algorithm is used to train the meal delivery time prediction model.
[0121] Alternatively, if Figure 6 As shown, the device 500 also includes:
[0122] A selection module 504 is used to select a target coefficient combination from a plurality of preset coefficient combinations corresponding to the loss function expression;
[0123] The determination module 505 is used to determine the loss function according to the target coefficient combination and the loss function expression.
[0124] Alternatively, if Figure 6 As shown, the selection module 504 includes:
[0125] A first determination submodule 541 is used to bring each coefficient combination in the multiple coefficient combinations into the loss function expression to obtain a loss function to be selected;
[0126] The loop submodule 542 is used to perform the following operations for each of the selected loss functions:
[0127] A candidate prediction model is obtained by training the candidate loss function and a preset training set;
[0128] Using a pre-set validation set to evaluate the effectiveness of the candidate prediction model;
[0129] The second determination submodule 543 is used to select the coefficient combination corresponding to the candidate prediction model with the best effect from all the obtained candidate prediction models as the target coefficient combination.
[0130] In this way, the accuracy of the trained meal delivery time prediction model can be further improved.
[0131] Optionally, the loss function expression is:
[0132]
[0133] in, is the predicted loss amount for sample order i; is the predicted pickup time of the sample order i; arrivetime i The actual arrival time of the delivery person for the sample order i; taketime i is the actual pick-up time of the delivery person for the sample order i; α and β are a coefficient combination of the loss function expression, and β>α>1.
[0134] Regarding the device in the above embodiment, the specific manner in which each module performs operations is implemented in the same or similar manner as in the above method embodiment, and will not be elaborated here.
[0135] In addition, those skilled in the art will clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0136] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method for predicting the order delivery time when the program is executed by a processor.
[0137] The present disclosure also provides an electronic device, including:
[0138] a memory having a computer program stored thereon;
[0139] A processor is used to execute the computer program in the memory to implement the steps of the above-mentioned order delivery time prediction method.
[0140] Figure 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be provided as a server. Figure 7 The electronic device 700 includes a processor 722, which may be one or more, and a memory 732 for storing a computer program executable by the processor 722. The computer program stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 722 may be configured to execute the computer program to perform the above-mentioned order delivery time prediction method.
[0141] In addition, the electronic device 700 may further include a power supply component 726 and a communication component 750, wherein the power supply component 726 may be configured to perform power management of the electronic device 700, and the communication component 750 may be configured to implement communication of the electronic device 700, for example, wired or wireless communication. In addition, the electronic device 700 may further include an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732, such as Windows ServerTM, Mac OSXTM, UnixTM, LinuxTM, etc.
[0142] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned order delivery time prediction method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 732 including program instructions, and the above-mentioned program instructions can be executed by the processor 722 of the electronic device 700 to complete the above-mentioned order delivery time prediction method.
[0143] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0144] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0145] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A method for predicting order delivery time, characterized in that: include: Get the actual arrival time and pick-up time of the delivery person for the order to be delivered; Inputting the actual store arrival time and the actual meal pickup time into a meal delivery time prediction model to obtain a predicted meal delivery time for the order to be delivered; Among them, for sample orders with different relationships between the predicted meal delivery time, the actual delivery person's arrival time at the store, and the actual meal pickup time, different loss functions are used to train the meal delivery time prediction model. The loss function is used to characterize the mapping relationship between the loss amount predicted by the meal delivery time prediction model and the predicted meal delivery time, actual store arrival time and actual meal pickup time of the sample order; When the predicted meal delivery time of the sample order is later than the actual meal pickup time of the delivery person of the sample order, the loss function is the first relationship function; When the predicted meal delivery time of the sample order is between the actual arrival time of the delivery person of the sample order and the actual meal pickup time, the loss function is the second relationship function; When the predicted delivery time of a sample order is earlier than the actual arrival time of the delivery person of the sample order, the loss function is the third relationship function: For the same sample order, the loss amount calculated by the second relationship function is smaller than the loss amount calculated by the first relationship function and the loss amount calculated by the third relationship function.
2. The method according to claim 1, characterized in that The meal delivery time prediction model is trained according to the following method: Obtain a sample data set, where the sample data set includes the actual arrival time of the delivery personnel and the actual pickup time of different sample orders; For each sample order of the sample data set, determine the loss function corresponding to the sample order according to the relationship between the predicted meal delivery time, the actual arrival time of the delivery person, and the actual meal pickup time of the sample order; Constructing a total loss function according to the loss function of each sample order in the sample data set; With the goal of minimizing the total loss function, an optimization algorithm is used to train the meal delivery time prediction model.
3. The method according to any one of claims 1 to 2, characterized in that: The method further comprises: Select a target coefficient combination from a plurality of preset coefficient combinations corresponding to the loss function expression; The loss function is determined according to the target coefficient combination and the loss function expression.
4. The method according to claim 3, characterized in that The step of selecting a target coefficient combination from a plurality of preset coefficient combinations of corresponding loss function expressions comprises: Substitute each coefficient combination in the multiple coefficient combinations into the loss function expression to obtain a loss function to be selected; For each of the candidate loss functions, perform the following operations: A candidate prediction model is obtained by training the candidate loss function and a preset training set; Using a pre-set validation set to evaluate the effectiveness of the candidate prediction model; From all the obtained candidate prediction models, the coefficient combination corresponding to the candidate prediction model with the best effect is used as the target coefficient combination.
5. The method according to claim 3, characterized in that: The loss function expression is: in, is the predicted loss amount for sample order i; is the predicted pickup time of the sample order i; arrivetime i The actual arrival time of the delivery person for the sample order i; taketime i is the actual pick-up time of the delivery person for the sample order i; α and β are a coefficient combination of the loss function expression, and β>α>1.
6. A meal delivery time prediction device, characterized in that: include: The acquisition module is used to obtain the actual arrival time and actual pickup time of the delivery personnel for the order to be delivered; A prediction module, used to input the actual store arrival time and the actual meal pickup time into a meal delivery time prediction model to obtain a predicted meal delivery time for the order to be delivered; Among them, for sample orders with different magnitude relationships among the predicted meal delivery time, the actual delivery person's arrival time at the store, and the actual meal pickup time, different loss functions are used to train the meal delivery time prediction model; The loss function is used to characterize the mapping relationship between the loss amount predicted by the meal delivery time prediction model and the predicted meal delivery time, actual store arrival time and actual meal pickup time of the sample order; When the predicted meal delivery time of the sample order is later than the actual meal pickup time of the delivery person of the sample order, the loss function is the first relationship function; When the predicted meal delivery time of the sample order is between the actual arrival time of the delivery person of the sample order and the actual meal pickup time, the loss function is the second relationship function; When the predicted delivery time of the sample order is earlier than the actual arrival time of the delivery person of the sample order, the loss function is the third relationship function; For the same sample order, the loss amount calculated by the second relationship function is smaller than the loss amount calculated by the first relationship function and the loss amount calculated by the third relationship function.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.
8. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 5.
