Delivery duration prediction method, computer program product and device

By obtaining supply and demand ratio factors and distribution time related data, using neural networks to predict distribution time, combined with monotonous embedded network constraint relationships, the explanatory problem of the logistics distribution time prediction model is solved, and more accurate operation decision support is achieved.

CN120509808APending Publication Date: 2025-08-19RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510628056.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

In the prior art, the logistics distribution time prediction model has poor interpretability and cannot intuitively understand the true impact of various factors on delivery time, making it difficult to use the predicted results for effective operational decisions.

Method used

By obtaining the supply and demand ratio factor and delivery time related data of the target order, the weight factor is determined, and the neural network is used to predict the first delivery time and the second delivery time, and the distribution time change caused by the supply and demand ratio factor is determined based on its differences, combining the relationship between the influencing factors of the monotonic embedding network constraints and the delivery time.

Benefits of technology

It improves the accuracy of delivery time prediction, enhances the interpretability of the model, and can intuitively understand the impact of supply and demand ratio changes on delivery time, assists in operational decision-making and distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120509808A_ABST
    Figure CN120509808A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a delivery duration prediction method, a computer program product and equipment. When the delivery duration of a target order is predicted, a weight factor can be determined based on delivery duration related data related to the delivery duration in order information of the target order, a first delivery duration can be determined based on the weight factor and a supply-demand ratio factor, and a second delivery duration can be determined based on the weight factor. And the distribution duration variation caused by the supply-demand ratio factor can be determined based on the difference between the first distribution duration and the second distribution duration, so that the variation can be utilized to assist operation decision making, profit sharing and the like. According to the method provided by the embodiment of the invention, the accuracy of the predicted delivery duration can be improved, and the influence of the supply-demand ratio factor on the delivery duration can be determined based on the difference between the delivery duration which considers the supply-demand ratio factor and the delivery duration which does not consider the supply-demand ratio factor by predicting the delivery duration which considers the supply-demand ratio factor and the delivery duration which does not consider the supply-demand ratio factor, so that an operation decision is assisted based on the influence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of logistics and delivery technology, and in particular to a delivery time prediction method, computer program product, and device. Background Art

[0002] In the field of logistics and distribution, it is usually possible to predict the delivery time of an order. Delivery time plays an important role in assisting operational decision-making. For example, orders can be reasonably allocated and scheduled based on their delivery time to improve delivery efficiency; or the delivery time can be used to characterize the difficulty of an order and then price the order; or the delivery time can be sent to the user client so that the user knows the arrival time of the goods in advance and reduces waiting anxiety. In related technologies, when using models to predict delivery time, various data are usually directly input into the model to use the model to learn the impact of this data on delivery time. Models trained in this way have poor interpretability and cannot intuitively understand the actual impact of various factors on delivery time. This makes it difficult for R&D personnel to understand the basis of the prediction results and make effective operational decisions based on the prediction results. Summary of the Invention

[0003] To overcome the problems existing in the related art, the embodiments of this specification provide a delivery time prediction method, computer program product and device.

[0004] According to a first aspect of an embodiment of this specification, a delivery time prediction method is provided, the method comprising:

[0005] Obtaining order information for a target order, including a supply-demand ratio factor and delivery time-related data. The supply-demand ratio factor is the ratio of the number of currently active delivery transport capacity in the business district where the target order is located to the current delivery efficiency of the delivery transport capacity that is currently accepting the target order at the current time point.

[0006] Determining a weight factor based on the delivery time-related data, wherein the weight factor is used to represent the impact of the delivery time-related data on the delivery time;

[0007] determining a first delivery duration based on the supply-demand ratio factor and the weight factor, wherein the first delivery duration is positively correlated with the supply-demand ratio factor and the weight factor;

[0008] determining a second delivery time based on the weight factor, wherein the second delivery time is positively correlated with the weight factor;

[0009] A change in delivery time caused by the supply-demand ratio factor is determined based on a difference between the first delivery time and the second delivery time.

[0010] According to a second aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method mentioned in the first aspect is implemented.

[0011] According to a third aspect of the embodiments of this specification, an electronic device is provided, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program implements the method mentioned in the first aspect above when executed.

[0012] According to a fourth aspect of the embodiments of this specification, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method mentioned in the first aspect is implemented.

[0013] Beneficial effects of the embodiments of this specification: The embodiments of this specification provide a method for predicting delivery time. When predicting the delivery time of a target order, a weight factor can be determined based on the delivery time-related data related to the delivery time in the order information of the target order. The weight factor is used to characterize the impact of the delivery time-related data on the delivery time. Then, a first delivery time can be determined based on the weight factor and the supply-demand ratio factor, and a second delivery time can be determined based on the weight factor. The delivery time is positively correlated with the supply-demand ratio factor and the weight factor. Then, based on the difference between the first delivery time and the second delivery time, the change in delivery time caused by the supply-demand ratio factor can be determined, so as to use the change to assist in operational decision-making and profit sharing, etc. The method provided by the embodiments of this specification processes the original data to obtain the supply-demand ratio factor, so as to use the supply-demand ratio factor to predict the delivery time, thereby improving the accuracy of the predicted delivery time. Moreover, by predicting the delivery time with and without considering the supply-demand ratio factor, the impact of the supply-demand ratio factor on the delivery time can be determined based on the difference between the two, so as to assist in operational decision-making based on the impact.

[0014] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory and are not restrictive of the embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings herein are incorporated in and constitute a part of the embodiments of this specification, illustrate embodiments consistent with the embodiments of this specification, and together with the description, serve to explain the principles of the embodiments of this specification.

[0016] Figure 1 This is a schematic diagram of an application scenario shown in an exemplary embodiment of this specification;

[0017] Figure 2 This is a flow chart of a delivery time prediction method according to an exemplary embodiment of this specification;

[0018] Figure 3 This is a schematic diagram of the structure of a monotone embedding sub-network shown in an exemplary embodiment of this specification;

[0019] Figure 4 A schematic diagram of the structure of a neural network shown in an exemplary embodiment of this specification;

[0020] Figure 5 This is a schematic diagram of aggregating historical orders in the OD dimension according to an exemplary embodiment of this specification;

[0021] Figure 6 This is a schematic diagram illustrating an exemplary embodiment of this specification for determining the order splitting time based on the order distance ratio;

[0022] Figure 7 This is a schematic diagram of the structure of a neural network shown in an exemplary embodiment of this specification;

[0023] Figure 8 This is a schematic diagram illustrating an exemplary embodiment of this specification for using a monotonically embedded sub-network to ensure a monotonically increasing delivery distance and delivery time;

[0024] Figure 9 This is a logic block diagram of an electronic device according to an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0025] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible implementations consistent with the embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of the embodiments of this specification, as detailed in the appended claims.

[0026] The terms used in the embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit the embodiments of this specification. The singular forms "a," "the," and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0027] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "when..." or "when..." or "in response to determining."

[0028] In the field of logistics and distribution, the prediction of order delivery time has always been a key issue in this field. Reasonable prediction of order delivery time can provide a basis for operational decisions. For example, it can provide an accurate reference basis for the allocation and scheduling of orders, so that the scheduling system can reasonably allocate tasks according to the actual situation of the delivery capacity (for example, riders) and task requirements, and can better balance the work difficulty and working hours of the delivery capacity, improve work efficiency and task completion rate. Alternatively, the delivery time describes the delivery difficulty of the order to a certain extent, so that the order can be reasonably priced based on the predicted delivery time. Alternatively, the delivery time can also be sent to the user client so that the user knows the arrival time of the goods in advance and reduces waiting anxiety.

[0029] In related technologies, a delivery time prediction model can be trained, and the delivery time of an order can be predicted based on the trained delivery time prediction model. When training a delivery time prediction model, various data that affect delivery time are typically input into the model as features so that the model can learn the relationship between these features and delivery time. Models trained in this way have poor interpretability and cannot intuitively understand the actual impact of various factors on delivery time. This makes it difficult for R&D personnel to understand the basis for the prediction results and to make effective operational decisions based on the prediction results. Furthermore, there are scenarios where the impact of these raw data on delivery time may not be significant, but after certain processing of these raw data, the features obtained may have a more significant impact on delivery time. If this data is simply input into the model, the model will not be able to effectively learn the impact of this data on delivery time, resulting in lower accuracy of the prediction results. For example, taking factors such as the delivery efficiency of delivery capacity at the current time point and the number of active delivery capacity in the current business district as examples, the applicant found that the impact of each of the above two factors on delivery time may not be significant. However, by analyzing the relationship between delivery capacity operation behavior and order volume, the applicant found that when order volume increases (i.e., supply increases) and the number of active delivery capacity (demand) does not change significantly, delivery time will show a certain downward trend. This shows that there is a certain causal relationship between the supply-demand ratio and delivery time.

[0030] In order to more accurately predict the delivery time and intuitively understand the impact of changes in the supply-demand ratio on the delivery time, so as to provide a basis for operational decisions, an embodiment of this specification provides a delivery time prediction method. When predicting the delivery time of a target order, a weight factor can be determined based on the delivery time-related data related to the delivery time in the order information of the target order. The weight factor is used to characterize the impact of the delivery time-related data on the delivery time. Then, the first delivery time can be determined based on the weight factor and the supply-demand ratio factor, and the second delivery time can be determined based on the weight factor. Among them, the delivery time is positively correlated with the supply-demand ratio factor and the weight factor. Then, the change in delivery time caused by the supply-demand ratio factor can be determined based on the difference between the first delivery time and the second delivery time, so that the change can be used to assist operational decisions and profit sharing, etc. The method provided in the embodiment of this description processes the original data to obtain the supply-demand ratio factor, and uses the supply-demand ratio factor to predict the delivery time, thereby improving the accuracy of the predicted delivery time. In addition, by predicting the delivery time with and without considering the supply-demand ratio factor, the impact of the supply-demand ratio factor on the delivery time can be determined based on the difference between the two, and then operational decisions can be assisted based on the impact.

[0031] like Figure 1 The figure shows an application scenario diagram of an embodiment of this specification. Delivery services are widely used in scenarios such as online shopping, food delivery, and errand shopping. The delivery service scenario involves multi-party interactions between the service end, merchants, delivery capacity, and users. Among them, the service platform is equipped with a service end, and provides users with a user client. Users can use the services provided by the service platform through the user client. Different from the user client for users, the service platform also provides merchants with a merchant client for merchants. Merchants can use the services provided by the service platform through the merchant client. Delivery capacity refers to a party with delivery capabilities, including but not limited to delivery personnel, such as the so-called riders. Delivery capacity can communicate with the server through the delivery capacity client used for delivery capacity. In other examples, delivery capacity can also include unmanned delivery equipment, such as unmanned aerial vehicles, unmanned vehicles, etc. Among them, each user can trade with the merchant through the user client and can initiate delivery orders; the service party can allocate delivery capacity for the instant delivery order.

[0032] For example, a user selects a target product on a user client and places an order for the target product, generating a target order on the user client. The user client then sends the target order to the server, which can then send the target order to the merchant client so that the merchant client can prepare the product. Simultaneously, the server can send the target order to the delivery capacity client, which then receives the target order. If the delivery capacity wishes to deliver the target order, it can issue an order acceptance instruction, and the user client will detect the delivery capacity's order acceptance operation. Simultaneously, based on the delivery capacity's order acceptance operation, the server can obtain the delivery capacity's historical order delivery time, the current number of orders for the delivery capacity, and the delivery level data for the delivery capacity, and use this data to predict the delivery capacity's delivery time for the target order. The server can then send the delivery time to the user client, allowing the target user to obtain the delivery time for the target product they ordered on the user client. The server can also send the delivery time to the scheduling system, which can then reasonably assign tasks to the delivery capacity based on the delivery time to ensure a reasonable workload for the delivery capacity.

[0033] The delivery time prediction method provided in the embodiments of this specification can be executed by the above-mentioned server, which can be deployed in a server or a server cluster.

[0034] The following combination Figure 2 The delivery time prediction method provided in the embodiment of this specification is described in detail. Figure 2 As shown, the method may include the following steps:

[0035] S202: Obtain order information for a target order, the order information including a supply-demand ratio factor and delivery time-related data, wherein the supply-demand ratio factor is a ratio of the number of currently active delivery transport capacity in the business district where the target order is located to the current delivery efficiency of the delivery transport capacity that is undertaking the target order at the current time point;

[0036] In step S202, after the user places an order through the user client, the order information of the target order can be obtained. Among them, the order information may include the supply-demand ratio factor, and other data related to the delivery time, hereinafter referred to as delivery time-related data. Among them, the supply-demand ratio factor is the ratio of the currently active delivery capacity (RPH) of the business district where the target order is located to the current delivery efficiency (TPH*) of the delivery capacity that undertakes the target order at the current time node. The delivery time-related data can be various types of data that affect the delivery time, for example, the starting and ending locations of the target order, the delivery distance, road condition information, weather information, the historical delivery efficiency of the delivery capacity, the weight and volume of the delivered goods, etc.

[0037] S204: Determine a weight factor based on the delivery time-related data, where the weight factor is used to represent the impact of the delivery time-related data on the delivery time;

[0038] In step S204, a weight factor may be determined based on the delivery time-related data. The weight factor is used to characterize the impact of the delivery time-related data on the delivery time. For example, a neural network may be pre-trained and the weight factor may be determined based on the neural network.

[0039] S206: Determine a first delivery duration based on the supply-demand ratio factor and the weight factor, where the first delivery duration is positively correlated with the supply-demand ratio factor and the weight factor;

[0040] In step S206, after determining the weight factor, the first delivery time can be determined based on the supply-demand ratio factor and the weight factor, wherein the first delivery time is positively correlated with the supply-demand ratio factor and the weight factor, that is, the larger the supply-demand ratio factor and the weight factor, the longer the first delivery time.

[0041] S208: Determine a second delivery time based on the weight factor, where the second delivery time is positively correlated with the weight factor;

[0042] In step S208, the second delivery time may be determined based on the weight factor. Similarly, the second delivery time is positively correlated with the weight factor, that is, the larger the weight factor, the longer the second delivery time.

[0043] Among them, the first delivery time and the second delivery time can be predicted by a pre-trained neural network. For example, the neural network can be trained based on historical order data, and two different sub-networks of the neural network can respectively predict the first delivery time and the second delivery time.

[0044] S210: Determine a change in delivery time caused by the supply-demand ratio factor based on a difference between the first delivery time and the second delivery time.

[0045] In step S210, after determining the first delivery time and the second delivery time, the change in delivery time caused by the supply-demand ratio factor can be determined based on the difference between the two, and then the impact of the change in the supply-demand ratio on the delivery time can be intuitively understood based on the change, so as to provide an analytical basis for operational decisions, thereby better assisting operational decisions, profit sharing, etc.

[0046] In the related art, when training a delivery time prediction model, various data points that influence delivery time are typically input as features into the model, allowing the model to learn the relationship between these features and delivery time. However, during the training process, due to various factors such as insufficient sample coverage, the impact of some explicit features learned by the model on delivery time may not align with actual perception. For example, taking delivery distance as an example, based on service experience, when other influencing factors are generally constant, longer delivery distances should lead to longer delivery times. However, during training, the model may learn a non-monotonous relationship between delivery distance and delivery time. This can lead to situations where longer delivery distances may actually result in shorter delivery times, when other influencing factors remain constant. This clearly contradicts actual service logic, leading users to question the reliability and accuracy of the prediction results. For another example, taking the weight of a delivered item as an example, generally, the heavier the item, the greater the delivery difficulty. However, current models fail to capture the impact of weight on delivery difficulty when predicting delivery time. Based on this, in some embodiments, in order to allow the delivery time to better characterize the order difficulty, for some factors that are strictly monotonically affecting the order delivery difficulty, a monotonic embedding network can be used to constrain the relationship between these factors and the delivery time, so that the final predicted delivery time can more accurately characterize the delivery difficulty and be consistent with actual service experience.

[0047] For example, the first and second delivery times can be predicted using a pre-trained neural network. The neural network can be trained using historical order data. The neural network can include a monotonic embedding subnetwork. The delivery time-related data includes target data, where the target data refers to numerical data that has a monotonic relationship with the delivery time. For example, in some embodiments, the target data can include delivery distance, weight of the delivered item, volume of the delivered item, and so on. For target data that has a strictly monotonic relationship with the delivery time, when determining a weight factor representing its impact on the delivery time, the target data can be input into the monotonic embedding subnetwork. The monotonic embedding subnetwork then determines a weight factor corresponding to the target data, where the weight factor corresponding to the target data has a monotonic relationship with the target data. For example, if the target data is delivery distance, the longer the delivery distance, the larger the weight factor corresponding to the delivery distance. Using the monotonic embedding network, the monotonic relationship between the target data and the delivery time can be strictly constrained, ensuring that the output weight factor corresponding to the target data has a monotonic relationship with the target data. Consequently, the delivery time determined based on the weight factor also has a monotonic relationship with the target data.

[0048] In some embodiments, different monotonic embedding subnetworks can be configured for different types of target data to determine the weight factors corresponding to the target data. For example, a neural network may include monotonic embedding subnetwork 1 and monotonic embedding subnetwork 2. Monotonic embedding subnetwork 1 is used to determine the weight factors corresponding to the delivery distance, while monotonic embedding subnetwork 2 is used to determine the weight factors corresponding to the weight of the delivered goods.

[0049] In some embodiments, the target data may be data that is monotonically increasing with the delivery time, such as the delivery distance and the weight of the delivered goods. When determining the weight factor corresponding to the target data through the monotone embedding subnetwork, the target numerical node corresponding to the target data may be determined first, wherein the range of target data that the order can cover is discretized into multiple numerical nodes. Since the target data is numerical data and the numerical values of the target data are usually continuous, the numerical range that the order can cover may be discretized to obtain multiple numerical nodes, each of which may represent a numerical interval or category. The target numerical node may then be input into the monotone embedding subnetwork so that the monotone embedding subnetwork determines the target numerical node and the corresponding embedding representations of all numerical nodes that are smaller than the target numerical node, and performs a Relu operation on each embedding representation, and performs accumulation processing on each embedding representation after the Relu operation to obtain the weight factor corresponding to the target data.

[0050] For example, taking delivery distance as the target data, given that delivery distance is a continuous value, to facilitate processing of delivery distance and reduce model complexity, the delivery distance range covered by an order can be discretized to obtain multiple distance nodes, each of which can represent a distance interval or category. For example, in the field of instant delivery, the delivery distance covered by an order typically does not exceed 20 km. Therefore, the delivery distance range can be discretized into multiple distance nodes such as 1 km, 2 km, 3 km, ..., 20 km, where all distances greater than 20 km are uniformly treated as 20 km. When determining the distance weight factor corresponding to the delivery distance based on a pre-trained monotonic embedding network, the target distance node corresponding to the delivery distance can be determined first. For example, for a delivery distance of 2.2 km, the corresponding distance node can be 2 km. This target distance node can then be input into the monotonic embedding subnetwork, which determines the embedding representations corresponding to the target distance node and all distance nodes smaller than the target distance node. A ReLU operation is performed on each embedding representation, and the resulting embedding representations are accumulated to obtain the weight factor corresponding to the delivery distance.

[0051] In order to ensure that the weight factor predicted by the monotone embedding sub-network is in a strictly monotonically increasing relationship with the delivery distance, the monotone embedding sub-network can be used to learn the embedding representation of each distance node, that is, to map the low-dimensional data to a high-dimensional space. Considering that the embedding representation learned by the monotone embedding sub-network may not be in a strictly monotonically increasing relationship with the delivery distance, in order to ensure monotonicity, such as Figure 3 As shown, ReLU operations and Cusum operators can be introduced into the monotone embedding sub-network.

[0052] Relu (Rectified Linear Unit) is a commonly used activation function that is widely used in deep learning models, especially in the hidden layers of neural networks. The mathematical expression of the Relu function is very simple:

[0053] Relu(x)=max(0,x)

[0054] Its function is to set all negative values in the input value x to 0, while leaving positive values unchanged. Considering that the longer the delivery distance, the longer the delivery time, that is, the impact of delivery distance on delivery time is non-negative, to ensure that the monotone embedding sub-network learns a non-negative embedding representation, you can first perform a ReLU operation on the embedding representation output by the monotone embedding sub-network to ensure that the embedding representation is non-negative.

[0055] However, after the Relu operation, it cannot be guaranteed that the weight factor and the delivery distance are in a strictly monotonically increasing relationship. In order to ensure a strict monotonic relationship between the two, the embodiment of this specification further introduces the Cusum operator (cumulative summation) in the monotonic embedding subnetwork, which can perform cumulative summation processing on the various embedded representations after Relu to obtain the weight factors corresponding to each delivery distance. Since the weight factor of each distance node is obtained by summing the embedded representations corresponding to the distance node and all distance nodes smaller than the distance node, it can be ensured that the larger the distance node, the larger the corresponding distance weight factor.

[0056] For example, assume that the embeddings corresponding to nodes at distances of 1km, 2km, 3km, ... 20km are represented as e1, e2, e3, ... e20. After performing the Relu operation on each embedding, we obtain Re(e1), Re(e2), Re(e3), ... Re(e20). Among them, the distance weight factor corresponding to the node 1km away is Re(e1), the distance weight factor corresponding to the node 2km away is Re(e1) + Re(e2), the distance weight factor corresponding to the node 3km away is Re(e1) + Re(e2) + Re(e3), and the distance weight factor corresponding to the node 20km away is Re(e1) + Re(e2) + Re(e3) + ... + Re(e20). Since the embeddings after the Relu operation are non-negative numbers, it can be ensured that the weight factor of the node with a greater distance is greater.

[0057] For target data such as the weight of delivered goods or other features that are monotonically increasing with the delivery time, a similar method can be used to determine the weight factor corresponding to the target data to ensure that the weight factor is strictly monotonically increasing with the target data.

[0058] In some embodiments, as Figure 4 As shown, the delivery time-related data also includes other data in addition to the above-mentioned target data, such as traffic conditions, weather conditions, etc. The neural network also includes a first delivery time prediction subnetwork and a second delivery time prediction subnetwork. When using the neural network to determine the first delivery time and the second delivery time, the other data, the supply-demand ratio factor, and the weight factor corresponding to the target data can be input into the first delivery time prediction subnetwork, so that the first delivery time prediction subnetwork determines the weight factor corresponding to the other data, and determines the first delivery time based on the weight factor corresponding to the other data, the supply-demand ratio factor, and the weight influence factor corresponding to the target data. Furthermore, the other data and the weight factor corresponding to the target data can be input into the second delivery time prediction subnetwork, so that the second delivery time prediction subnetwork determines the weight factor corresponding to the other data, and determines the second delivery time based on the weight factor corresponding to the other data and the weight factor corresponding to the target data. For example, in some embodiments, the weight factors corresponding to the other data, the supply-demand ratio factor, and the weight factor corresponding to the target data are W, P, and M, respectively. The first delivery time is: W*P+W*M, and the second delivery time is: W*M. By using two sub-networks to predict delivery times with and without considering the supply-demand ratio, we can intuitively understand the impact of changes in the supply-demand ratio on delivery time, improve the interpretability of the model, and provide a basis for operational decision-making.

[0059] Taking into account that the delivery efficiency of the delivery capacity changes in real time over different time periods, in order to more accurately determine the delivery efficiency of the delivery capacity at the current time node, in some embodiments, the first delivery time and the second delivery time can be predicted by a pre-trained neural network, and the neural network includes a sequence prediction subnetwork, so that the sequence prediction subnetwork can be used to predict the current delivery efficiency of the delivery capacity at the current time node. For example, a historical delivery efficiency sequence of the delivery capacity that undertakes the target order can be obtained, and the historical delivery efficiency sequence includes the delivery efficiency of the delivery capacity at multiple historical time nodes before the current time node. Then, the historical delivery efficiency sequence can be input into the sequence prediction subnetwork to predict the current delivery efficiency through the sequence prediction subnetwork.

[0060] For example, we can collect the historical delivery efficiency series of the delivery capacity. For example, the delivery efficiency of the delivery capacity per hour in the past day is as follows:

[0061] 2025-04-01 07:00—08:00 3 orders

[0062] 2025-04-01 08:00—09:00 3 orders

[0063] 2025-04-01 09:00—10:00 4 orders

[0064] 2025-04-01 10:00—11:00 5 orders

[0065] 2025-04-01 11:00—12:00 6 orders

[0066] 2025-04-01 12:00—13:00 6 orders

[0067] 2025-04-01 13:00—14:00 4 orders

[0068] The above historical delivery efficiency sequence can be input into the sequence prediction subnetwork, which can output the predicted delivery efficiency at the current time node (2024-04-01 14:00-15:00), for example, 3 orders.

[0069] The sequence prediction sub-network may be an N-BEATS network, or other neural networks suitable for predicting sequence data, which is not limited in the embodiments of this specification.

[0070] In some embodiments, the first and second delivery times can be predicted by a pre-trained neural network. The neural network can be trained based on pre-constructed training samples, where each training sample includes order information for a historical order and a label corresponding to the order information for the historical order, wherein the label indicates the delivery time corresponding to the historical order. In related art, when determining the label corresponding to each historical order, a wave duration is typically simply divided equally among all orders completed within the wave duration. In logistics delivery scenarios, delivery capacity can deliver multiple orders simultaneously. The transition from a state of no orders to a state of completing all deliveries after receiving an order and then returning to a state of no orders is considered a wave, and the total duration is the wave duration. For example, assuming a wave duration of 20 minutes, if the delivery capacity only completes the delivery of one order within the wave duration, the delivery time for that order is 20 minutes. If the delivery capacity completes the delivery of two orders within the wave duration, the delivery time for each of the two orders is 10 minutes. Obviously, this method of determining labels causes large fluctuations in labels. For example, orders with the same distance may have very different labels (i.e., delivery times) due to different order splitting methods and waves. As a result, the prediction results of the model trained based on these labels also fluctuate greatly.

[0071] In order to obtain a more stable label, in some embodiments, such as Figure 5 As shown, to determine the label corresponding to each historical order, historical order data can be obtained. This historical order data includes order information for multiple historical orders. These multiple historical orders can then be clustered, grouping historical orders with the same delivery origin (i.e., merchant point: O) and delivery destination (user point: D) into one category. For the multiple historical orders within each clustered category, the average of the order splitting times for these multiple historical orders is used as the label for the historical orders in that category. Considering that the same delivery origin and destination means that two orders have the same journey, the delivery times for orders with the same journey should generally be relatively close. Therefore, orders with the same delivery origin and destination can be clustered together, and the average of the order splitting times for these orders can be used as the label for each order. This ensures more consistent labels for orders with the same journey. The order splitting time refers to the delivery time for each order after splitting orders within a wave duration. For example, a wave duration can be evenly divided among the orders within that wave duration to obtain the order splitting time for each order.

[0072] In some embodiments, to more accurately measure the relationship between delivery time and distance, when determining the splitting time for each historical order, the ratio of the delivery distance of each historical order to the total delivery distance of the multiple historical orders within a delivery wave can be determined. The splitting time for each historical order is then determined based on this distance ratio, where the ratio of the splitting time to the wave duration is equal to the distance ratio. That is, when determining the delivery time for each order, orders with longer delivery distances will have longer delivery times, which can more accurately and objectively characterize the delivery difficulty.

[0073] For example, suppose there is a wave containing 3 orders, with the starting and ending points being:

[0074] Order A: starting point A1, end point B1

[0075] Order B: starting point A2, end point B2

[0076] Order C: Starting point A3, end point B3

[0077] The total duration of a wave is 60 minutes, and the distance proportions of orders A, B, and C are 30%, 40%, and 30% respectively. Then:

[0078] The splitting time for order A is 60 × 30% = 18 minutes

[0079] The splitting time for order B is 60 × 40% = 24 minutes

[0080] The splitting time for order C is 60 × 30% = 18 minutes

[0081] Next, aggregate by OD (where O orders only the starting point and D orders only the end point):

[0082] The label for the OD pair (A1, B1) is the splitting time for order A, which is 18 minutes.

[0083] The label for the OD pair (A2, B2) is the splitting time for order B, which is 24 minutes.

[0084] The label for the OD pair (A3, B3) is the splitting time for order C, which is 18 minutes.

[0085] If within 30 days, the average splitting time for OD pair (A1, B1) is 17 minutes, the average splitting time for OD pair (A2, B2) is 23 minutes, and the average splitting time for OD pair (A3, B3) is 19 minutes, then these average values will be backfilled into the corresponding orders as the final labels.

[0086] Among them, when collecting training data, in order to ensure the accuracy and objectivity of the training data, some special orders can be removed. For example, pre-orders, retail orders, abnormality reporting orders, etc. can be removed from the training data.

[0087] To ensure that the predicted first and second delivery times are more consistent with actual service experience, in some embodiments, after determining the first and second delivery times, the first and / or second delivery times may be corrected based on pre-set correction rules. These correction rules may be determined based on prior knowledge in the field of logistics and delivery, ensuring that the predicted delivery times are consistent with this prior knowledge. After the delivery times are corrected, the variation may be determined based on the corrected first and second delivery times to more accurately characterize the variation.

[0088] In some embodiments, taking into account that as the delivery efficiency of the delivery capacity increases, the delivery time should be shortened, that is, the delivery time and the delivery efficiency of the delivery capacity should be in a monotonically decreasing relationship. Therefore, when correcting the first delivery time or the second delivery time based on the correction rule, the delivery efficiency of the delivery capacity at the previous time node of the current time node can be obtained, and the first delivery time can be adjusted based on the difference between the current delivery efficiency of the delivery capacity at the current time node and the delivery efficiency of the delivery capacity at the previous time node of the current time node, so that the first delivery time and the delivery efficiency of the delivery capacity are in a monotonically decreasing relationship. The first delivery time can then be used to make operational decisions, such as pricing, task scheduling, or sending it to the user client for display to the user, etc.

[0089] In some embodiments, taking into account that the difficulty of delivery for orders with a long distance is usually greatly increased, in order to more accurately characterize the difficulty of such remote orders, the predicted delivery time can be corrected. For example, if the delivery distance is greater than a preset distance threshold (for example, 3km), a third delivery time can be determined based on the delivery distance, wherein the third delivery time increases exponentially with the increase of the delivery distance, so as to better characterize the impact of the delivery distance on the delivery difficulty. If the third delivery time is greater than the first delivery time / the second delivery time, the third delivery time is used to replace the first delivery time / the second delivery time; if it is less than, it is not replaced. That is, the larger of the third delivery time and the predicted delivery time determined based on pre-set rules is selected as the final output for subsequent operational decisions. In some embodiments, the relationship between the third delivery time and the delivery distance is as follows:

[0090]

[0091] Among them, y is the third delivery time, X is the predicted delivery time (the first delivery time or the second delivery time), and a, b, and c are fixed parameters.

[0092] In some embodiments, the first and second delivery times are predicted by a pre-trained neural network. The neural network includes multiple parallel network layers, each with the same structure but different network parameters. The different network layers can be trained using different historical order data. When using the neural network to predict the first and second delivery times, multiple copies of the target order's order information can be copied and then input into the multiple parallel network layers of the neural network. Each network layer then determines a weighting factor based on the delivery time-related data, determines a first predicted delivery time based on the supply-demand ratio factor and the weighting factor, and determines a second predicted delivery time based on the weighting factor. The average of the first predicted delivery times predicted by the multiple network layers can then be used as the first delivery time, and the average of the second predicted delivery times predicted by the multiple network layers can be used as the second delivery time. By processing the order information in parallel through multiple parallel network layers, outputting prediction results, and combining the prediction results of the multiple parallel network layers to obtain a final prediction result, the accuracy of the prediction results can be greatly improved.

[0093] The following describes the delivery time prediction method provided in the embodiments of this specification in conjunction with a specific embodiment.

[0094] 1. Construction of training data

[0095] When constructing training data, in order to obtain labels that are more stable, less volatile, and more accurately depict order difficulty, the following method can be used to determine the label of each historical order:

[0096] like Figure 5 and Figure 6 As shown, for historical orders within each wave duration, the order splitting time can be determined based on the ratio of each historical order's delivery distance to the total distance of all historical top orders within that wave duration, where the ratio of order splitting time to wave duration is equal to the distance ratio. For example, assuming a wave duration of t, the orders delivered within that wave duration include Order A, Order B, and Order C, with delivery distances of d1, d2, and d3, respectively. The order splitting time for Order A is: d1*t / (d1+d2+d3), the order splitting time for Order B is: d2*t / (d1+d2+d3), and the order splitting time for Order C is: d3*t / (d1+d2+d3).

[0097] For historical orders within a period of time (for example, 30 days), historical orders can be aggregated based on the OD (order start and end point) dimension, and historical orders with the same OD can be grouped into one category to obtain multiple categories. Then, the average of the order splitting time of historical orders with the same OD is used as the label of the historical orders in this category to train the delivery time prediction neural network.

[0098] 2. Use the training data to train the neural network to obtain a neural network for predicting delivery time. The structure of the neural network is as follows: Figure 7 As shown, the neural network includes multiple parallel network layers. Each network layer includes a sequence prediction subnetwork (N-BEATS), a monotonic embedding subnetwork (Isotonic), a first delivery time prediction subnetwork (Main-Block), a second delivery time prediction subnetwork (Bench-Block), an embedding subnetwork (Embedding Layer), and a correction subnetwork (Corrected Layer). During the training process, different training data can be used to train different network layers. As a result, the resulting multiple parallel network layers have the same network structure but different network parameters.

[0099] The structure and function of each sub-network are as follows:

[0100] (1) Sequence prediction subnetwork (N-BEATS):

[0101] This subnetwork is used to predict the delivery efficiency of the delivery capacity at the current time node. The input of this subnetwork is the historical delivery efficiency sequence (TPH) of the delivery capacity at multiple historical time nodes before the current time node, and the output is the delivery efficiency (TPH*) of the delivery capacity at the current time point.

[0102] The N-BEATS network is divided into M stacks, each with two output values: one forward and one backward. Ultimately, the sum of the forward values from each stack serves as the model's overall output. At this point, the output of each stack can be considered the time series forecast for that stack. Furthermore, each stack consists of multiple blocks, connected via residual connections. Each block utilizes a four-layer FC stack, with the final layer using two FC layers to construct the forward prediction parameters and the backward residual adjustment parameters.

[0103] (2) Monotone Embedding Subnetwork (Isotonic)

[0104] For some input features M that are monotonically related to the delivery time (for example, delivery distance, weight of delivered goods, etc.), after Embedding, we hope to learn a high-dimensional representation of the input features (i.e., embedded representation). In high-dimensional space, it can better characterize the relationship between the features than the original input, and it is also conducive to model learning. However, during the training process, affected by the overall gradient descent, the learned Embedding may deviate from cognition. For example, taking the delivery distance as an example, since the labels of some training samples are not monotonically related to the delivery distance, and there are fewer long-distance samples, the Embedding learned on the delivery distance is not monotonically related. However, cognitively, the longer the delivery distance, the longer the delivery time, and the larger the Embedding should be. In order to ensure that the predicted delivery time is strictly monotonically increasing with the delivery distance, the Relu function and Cusum operator can be introduced in the monotone embedding subnetwork. Relu can ensure that the output is non-negative. By accumulating the Embedding after non-negative processing, it can be ensured that the weight factor output by the final monotone embedding subnetwork is strictly monotonically increasing with the delivery distance. Figure 8 As shown in Figure 2, after passing through the Isotonic Attention Layer, the non-monotonic part (red) is corrected to a completely monotonic weight factor.

[0105] (3) Embedding Layer

[0106] The embedding subnetwork is used to determine the embedding representation of other delivery time-related data (i.e., X in the figure), in addition to delivery distance, supply-demand ratio factors, and other delivery time-related data that have a monotonically related relationship with delivery time. X can be factors that affect delivery time, such as traffic conditions, weather conditions, order starting point, and end point.

[0107] (4) First delivery time prediction subnetwork (Main-Block)

[0108] The Main-Block contains three modules. One is the basic Backbone module, which can be any neural network structure. There is also a hidden layer in the middle. The hidden layer inputs the final monotonic layer, the Mono Layer, which ensures the monotonicity of the features by taking the absolute value non-negative processing.

[0109] The Main-Block needs to process two features that are monotonically correlated with the delivery time: the weight factor corresponding to the delivery distance (i.e., the output obtained after the delivery distance is processed by the monotonic embedding subnetwork) and the supply-demand ratio factor P = RPH / TPH*, where RPH represents the number of riders within a unit wave duration, and TPH* represents the number of orders within a unit wave duration on the day. The weight factor corresponding to the delivery distance and the supply-demand ratio factor both increase monotonically with the predicted delivery time.

[0110] As shown in the figure, M represents features that are monotonically related to delivery time, such as delivery distance or product weight. X represents other data related to delivery time, such as traffic conditions, weather, order start and end points, etc.

[0111] The M input can be monotonically embedded into the sub-network to obtain the weight factor corresponding to the delivery distance, and then the weight factor can be input into the Mono Layer of the Main-block.

[0112] Input X into the embedding layer to obtain the corresponding embedding representation, and then input it into the Main-block. Since the Backbone layer and hidden layer of the Main-block are processed, the processing results of the hidden layer are input into the Mono Layer.

[0113] The historical delivery efficiency sequence TPH of the delivery capacity is input into the sequence prediction subnetwork, which outputs the current delivery efficiency (TPH*) of the delivery capacity, and then determines the supply-demand ratio factor P = RPH / TPH*, and then inputs P into the Mono Layer.

[0114] Among them, the predicted delivery time out output by Main-Block main_block for:

[0115] out main_block =(W M *X M +b M )+(W P *X P +b P )

[0116] in,

[0117] W M =abs(FC(backbone(x))); W P =abs(FC(backbone(x)))

[0118] Among them, X M is the output of the monotone embedding sub-network, X P is the supply-demand ratio factor.M 、W P It refers to the result of embedding other influencing factors X after being processed by Backbone, Hidden Layer, and Mono Layer of Main-Block. M 、b P is the default parameter.

[0119] (4) Second delivery time prediction subnetwork (Bench-Block)

[0120] The structure of Bench-Block is similar to that of Main-Block. The difference is that in the last Mono Layer, only one feature is processed that is monotonically related to the delivery time, namely the weight factor corresponding to the distance M. The supply-demand ratio factor P is not input, that is, the output is the predicted delivery time of the average supply-demand ratio factor P*.

[0121] Bench-Block output delivery time out bench_block for:

[0122] out bench_block =W M *X M +b M

[0123] in,

[0124] W M =abs(FC(backbone(x)))

[0125] Among them, X M is the output of the monotone embedding sub-network. M It refers to the result of embedding other influencing factors X after being processed by the Backbone, Hidden Layer, and Mono Layer of the Main-Block. M , are the default parameters.

[0126] (5) Corrected Layer

[0127] The predicted first and second delivery times can be corrected based on some prior knowledge. For example, TPH and delivery time in a given business district typically decrease monotonically. Therefore, the current delivery efficiency TPH* predicted for the current time point (for example, today) can be compared with the delivery efficiency from the previous day. The result can be used as input to the Correct Layer to correct the delivery time, ensuring a monotonically decreasing relationship between the predicted delivery time and delivery efficiency.

[0128] For example, for long-distance orders with a delivery distance greater than the preset distance (3km), the index score can be used to correct the delivery time and take the larger value.

[0129] Corresponding to the method embodiments provided in the embodiments of this specification, the embodiments of this specification also provide a computer program product, including a computer program, which implements the method mentioned in any of the above embodiments when executed by a processor.

[0130] This embodiment of the present invention also provides an electronic device, such as Figure 9 The figure is a schematic diagram of the structure of the electronic device according to the embodiment of this specification, except Figure 9 In addition to the processor 92 and memory 94 shown, the device may also typically include other hardware, such as a forwarding chip responsible for message processing. From a hardware perspective, the device may also be distributed, potentially including multiple interface cards to enable hardware-level expansion of message processing. The memory 94 stores computer instructions, and when the processor 92 executes these computer instructions, it implements the method described in any of the above embodiments.

[0131] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0132] Since the portion of the embodiment of this specification that contributes to the prior art or the entire or partial technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium and includes a number of instructions for causing a terminal device to execute all or part of the steps of each method of the embodiment of this specification. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.

[0133] The above description is only a preferred embodiment of the embodiments of this specification and is not intended to limit the embodiments of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of this specification should be included in the scope of protection of the embodiments of this specification.

Claims

1. A method for predicting delivery time, comprising: Obtaining order information for a target order, including a supply-demand ratio factor and delivery time-related data. The supply-demand ratio factor is the ratio of the number of currently active delivery transport capacity in the business district where the target order is located to the current delivery efficiency of the delivery transport capacity that is currently accepting the target order at the current time point. Determining a weight factor based on the delivery time-related data, wherein the weight factor is used to represent the impact of the delivery time-related data on the delivery time; determining a first delivery duration based on the supply-demand ratio factor and the weight factor, wherein the first delivery duration is positively correlated with the supply-demand ratio factor and the weight factor; determining a second delivery duration based on the weight factor, wherein the second delivery duration is positively correlated with the weight factor; A change in delivery time caused by the supply-demand ratio factor is determined based on a difference between the first delivery time and the second delivery time.

2. The method according to claim 1, wherein the first delivery time and the second delivery time are predicted by a pre-trained neural network, the neural network is trained based on historical order data, the neural network includes a monotonic embedding subnetwork, the delivery time-related data includes target data, the target data is numerical data that has a monotonic relationship with the delivery time, and the weight factor corresponding to the target data is determined based on the following method: The target data is input into a pre-trained monotone embedding sub-network to determine a weight factor corresponding to the target data through the monotone embedding sub-network, wherein: The weight factor corresponding to the target data is monotonically related to the target data, and different types of target data correspond to different monotonically embedded sub-networks.

3. The method according to claim 2, wherein the target data and the delivery time are in a monotonically increasing relationship, and determining the weight factor corresponding to the target data by using the monotonically embedded subnetwork comprises: Determining a target numerical node corresponding to the target data, wherein a range of the target data that can be covered by the order is discretized into a plurality of numerical nodes; The target numerical node is input into the monotone embedding network so that the monotone embedding network determines the target numerical node and the embedding representations corresponding to all numerical nodes smaller than the target numerical node, performs a Relu operation on each embedding representation, and accumulates the embedding representations after the Relu operation to obtain a weight factor corresponding to the target data.

4. According to the method of claim 2, the target data includes one or more of the following: the delivery distance corresponding to the target order, the weight of the goods corresponding to the target order, and the volume of the goods corresponding to the target order.

5. The method according to claim 2, wherein the delivery time-related data further includes other data in addition to the target data, and the neural network further includes a first delivery time prediction subnetwork and a second delivery time prediction subnetwork, and the method comprises: Inputting the other data, the supply-demand ratio factor, and the weight factor corresponding to the target data into a first delivery time prediction subnetwork, so that the first delivery time prediction subnetwork determines the weight factor corresponding to the other data, and determines the first delivery time based on the weight factor corresponding to the other data, the supply-demand ratio factor, and the weight factor corresponding to the target data; The other data and the weight factors corresponding to the target data are input into the second delivery time prediction subnetwork so that the second delivery time prediction subnetwork determines the weight factors corresponding to the other data, and determines the second delivery time based on the weight factors corresponding to the other data and the weight factors corresponding to the target data.

6. The method according to any one of claims 1-5, wherein the first delivery time and the second delivery time are predicted by a pre-trained neural network, the neural network is trained based on historical order data, the neural network includes a sequence prediction subnetwork, and the current delivery efficiency is determined based on the following method: Obtaining a historical delivery efficiency sequence of the delivery capacity, wherein the historical delivery efficiency sequence includes the delivery efficiency of the delivery capacity at multiple historical time nodes; The historical delivery efficiency sequence is input into the sequence prediction subnetwork to predict the current delivery efficiency through the sequence prediction subnetwork.

7. The method according to any one of claims 1-5, wherein the first delivery time and the second delivery time are predicted by a pre-trained neural network, wherein the neural network is trained based on pre-constructed training samples, each training sample including order information of a historical order and a label corresponding to the order information of the historical order, wherein the label is used to indicate the delivery time corresponding to the historical order, and the label is determined based on the following method: Acquire historical order data, where the historical order data includes order information of multiple historical orders; Clustering the multiple historical orders, and grouping historical orders with the same delivery starting point and delivery destination into one category; For the multiple historical orders in each category obtained by clustering, the average of the splitting time of the multiple historical orders is used as the label of the historical orders in this category.

8. According to the method of claim 7, the splitting time of each historical order is determined based on the following method: For multiple historical orders within a delivery wave; Determining a distance ratio of the delivery distance of each historical order in the plurality of historical orders to the total delivery distance of the plurality of historical orders; The splitting time of each historical order is determined based on the distance ratio, and the ratio of the splitting time to the wave time is equal to the distance ratio.

9. The method according to claim 1, after determining the first delivery time and the second delivery time, the method further comprises: Correcting the first delivery time and / or the second delivery time based on a preset correction rule, wherein the correction rule is determined based on prior knowledge in the field of logistics and delivery; The change amount is determined based on the corrected first delivery duration and the corrected second delivery duration.

10. The method according to claim 9, wherein the correction processing of the first delivery time and / or the second delivery time based on a preset correction rule comprises one or more of the following: The first delivery time is adjusted based on the difference between the current delivery efficiency of the delivery capacity at the current time node and the delivery efficiency of the delivery capacity at the previous time node of the current time node, so that the first delivery time is in a monotonically decreasing relationship with the delivery efficiency of the delivery capacity, wherein, The adjusted first delivery time is used for operational decision-making; and / or, The delivery time-related data includes the delivery distance. If the delivery distance is greater than a preset distance threshold, a third delivery time is determined based on the delivery distance. If the third delivery time is greater than the first delivery time / second delivery time, the third delivery time is used to replace the first delivery time / second delivery time; wherein, the third delivery time increases exponentially with an increase in the delivery distance.