Method and device for predicting logistics arrival time, electronic equipment, medium and product
By splitting delivery time into micro and macro perspectives, multi-dimensional time loss information is constructed to optimize the parameters of the logistics prediction model, solving the problems of low iteration update efficiency and poor reusability in existing technologies, and achieving higher prediction accuracy and adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING YOUZHUJU NETWORK TECH CO LTD
- Filing Date
- 2026-01-21
- Publication Date
- 2026-04-14
AI Technical Summary
Existing logistics delivery time prediction models suffer from low iteration update efficiency and poor reusability. In particular, graph neural network-based models are difficult to directly migrate and reuse when business scenarios or data patterns change, and the complexity of the model structure leads to a mismatch between industrial deployment and agile iteration requirements.
By breaking down delivery time into a micro-perspective of the time from the current logistics node to the next node and a macro-perspective of the time to the logistics destination, multi-dimensional time loss information is constructed. This information is independent of the specific model architecture, optimizes and updates the parameters of the logistics prediction model, and adapts to different business scenarios.
It improves the prediction accuracy and robustness of logistics forecasting models in different business scenarios, solves the problems of low iteration update efficiency and poor reusability, and adapts to the needs of industrial deployment and agile iteration.
Smart Images

Figure CN121860518A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of goods transportation and computer technology, specifically to methods, apparatus, electronic equipment, media, and products for predicting logistics delivery times. Background Technology
[0002] In the process of goods transportation, prediction models trained using deep learning are mainly used to analyze massive amounts of historical goods trajectory data to obtain the corresponding delivery time. In order to provide users with accurate delivery time prediction results, the current common approach is to follow a model architecture-centric technical path, which improves prediction accuracy by designing complex model architectures. However, complex model architectures suffer from problems such as poor reusability and slow iteration update efficiency, resulting in poor accuracy in predicting goods delivery time. Summary of the Invention
[0003] This disclosure provides a method, apparatus, electronic device, medium, and product for predicting logistics delivery time, in order to solve the problem of poor accuracy in predicting the delivery time of goods.
[0004] In a first aspect, this disclosure provides a method for predicting logistics delivery time, including: acquiring the logistics trajectory of an item and the current logistics node where the item is located, the logistics trajectory including multiple logistics nodes; acquiring a first predicted delivery time from the current logistics node to the next logistics node, and a second predicted delivery time from the current logistics node to the logistics destination; constructing multi-dimensional time loss information based on the first and second predicted delivery times; and updating the model parameters of the logistics prediction model based on the multi-dimensional time loss information, so as to obtain the logistics delivery time of the item using the updated logistics prediction model.
[0005] Secondly, this disclosure provides a device for predicting logistics delivery time, comprising: a logistics node acquisition module for acquiring the logistics trajectory of an item and the current logistics node where the item is located, the logistics trajectory including multiple logistics nodes; a prediction time acquisition module for acquiring a first predicted delivery time from the current logistics node to the next logistics node, and a second predicted delivery time from the current logistics node to the logistics destination; a loss information construction module for constructing multi-dimensional time loss information based on the first and second predicted delivery times; and a time prediction module for updating the model parameters of a logistics prediction model based on the multi-dimensional time loss information, so as to obtain the logistics delivery time of the item using the updated logistics prediction model.
[0006] Thirdly, this disclosure provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the logistics delivery time prediction method of the first aspect or any corresponding embodiment described above.
[0007] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to execute the logistics delivery time prediction method of the first aspect or any corresponding embodiment described above.
[0008] Fifthly, this disclosure provides a computer program product, including computer instructions for causing a computer to execute the logistics delivery time prediction method of the first aspect or any corresponding embodiment described above.
[0009] The logistics delivery time prediction method, apparatus, electronic device, medium, and product disclosed herein acquire the logistics trajectory of an item and its current logistics node, and then obtains the next logistics node corresponding to the current logistics node based on the logistics trajectory. Subsequently, by acquiring the first predicted delivery time from the current logistics node to the next logistics node and the second predicted delivery time from the current logistics node to the logistics destination, and constructing multi-dimensional time loss information based on the first and second predicted delivery times, the model parameters of the logistics prediction model can be optimized and updated using this multi-dimensional time loss information. Here, based on the data structure characteristics of delivery time, the delivery time is broken down into a micro-perspective of the time required from the current logistics node to the next logistics node and a macro-perspective of the time required from the current logistics node to the logistics destination for iterative updates of model parameters. This avoids changes in model complexity, solving the problem of slow iterative update efficiency caused by complex model structures; moreover, it is independent of specific model architectures and can adapt to model structures in different business scenarios, accurately solving the problem of poor model reusability in different business scenarios. Therefore, it effectively improves the accuracy of logistics prediction models in predicting item delivery times under different business scenarios. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this disclosure; Figure 2 This is a schematic flowchart of a first method for predicting logistics delivery time according to an embodiment of the present disclosure; Figure 3 This is a second flowchart illustrating a method for predicting logistics delivery time according to an embodiment of the present disclosure; Figure 4 This is a schematic diagram of a third method for predicting logistics delivery time according to an embodiment of the present disclosure; Figure 5 This is a structural block diagram of a logistics delivery time prediction device according to an embodiment of the present disclosure; Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0013] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0014] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0015] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0016] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0017] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0018] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise expressly specified.
[0019] During the transportation of goods, prediction models trained using deep learning are primarily used to analyze massive amounts of historical goods trajectory data to obtain the corresponding delivery times. Specifically, the relevant technical solutions include: (1) Sequence network-based models: This type of approach uses recurrent neural networks (RNN), long short-term memory networks (LSTM), or attention networks to model the logistics trajectory of a package as a time series. By capturing the temporal dependencies of events at each logistics node in the sequence, future delivery times can be predicted.
[0020] (2) Graph Neural Network-based Model: This type of approach expands the perspective of the problem from the trajectory of a single package to the entire logistics network. It models entities such as cities and distribution centers in the logistics network as nodes of a graph, models transportation routes as edges of a graph, and uses graph neural networks to learn the propagation patterns of packages in the entire network topology in order to gain a deeper understanding of spatial dependencies.
[0021] However, the aforementioned model-architecture-centric technical approach, while pursuing prediction accuracy, also introduces the following drawbacks: (1) The strong coupling between the model and the data structure leads to poor portability, especially for models based on graph neural networks, whose architecture design is highly bound to specific logistics network topology and data characteristics. Once the business scenario or data pattern changes, the model is difficult to migrate and reuse directly, and a lot of data reconstruction work must be carried out.
[0022] (2) The complexity and integrity of the model structure lead to low iteration efficiency. In order to pursue performance, these models are usually integrated and highly customized, which makes it extremely difficult to integrate new technical ideas or perform local optimization on existing models, thus severely restricting the iteration speed of the model.
[0023] (3) The industrial deployment of models does not match the need for agile iteration. The complex models mentioned above usually contain a large number of parameters, and their training, debugging and maintenance require huge computing resources and time costs, which contradicts the requirement that models can be updated at low cost and high frequency to adapt to the needs of dynamic industrial deployment.
[0024] Based on this, the technical solution disclosed herein departs from the model structure-centric approach. Instead, it breaks down delivery time into a micro-perspective—the time required from the current logistics node to the next node—and a macro-perspective—the time required from the current node to final delivery—based on the characteristics of the delivery time data structure. A multi-dimensional time loss information constraint is designed to iteratively update model parameters. This multi-dimensional time loss information is independent of the specific model architecture and is plug-and-play. Without increasing model complexity and inference overhead, it systematically improves the prediction accuracy and robustness of various model structures, precisely addressing the problems of poor reusability and low iterative update efficiency. This facilitates industrial deployment and agile iteration of the model.
[0025] As one optional application scenario of this disclosure embodiment, such as Figure 1 As shown, this application scenario may include at least one electronic device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the electronic devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 via a network 110.
[0026] Specifically, electronic devices can be smartphones, tablets, laptops, PDAs, desktop computers, game consoles, smart TVs, smart wearable devices, in-vehicle terminals, VR (Virtual Reality) devices, AR (Augmented Reality) devices, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranets, local area networks, wide area networks, mobile communication networks, and combinations thereof.
[0027] It should be noted that, Figure 1 This is merely an example of an application scenario and does not limit the scope of protection of this disclosure. The embodiments of this disclosure will be described below with reference to the accompanying drawings, primarily focusing on electronic devices.
[0028] According to an embodiment of this disclosure, a method for predicting logistics delivery time is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] This embodiment provides a method for predicting logistics delivery time, which can be used in the aforementioned electronic devices, such as computers. Figure 2This is a flowchart of a logistics delivery time prediction method according to an embodiment of the present disclosure, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the logistics trajectory of the item and the current logistics node where the item is located. The logistics trajectory includes multiple logistics nodes.
[0030] A logistics trajectory is the path that goods take during transportation. Specifically, the logistics trajectory consists of a path formed between multiple logistics nodes, which cover the logistics origin, logistics destination, and logistics transfer point.
[0031] For each item in the transportation process, its logistics trajectory and current logistics node can be obtained through the logistics information system, or by tracking the item's status and location during transportation. No specific limitation is made on the method of obtaining the logistics trajectory here.
[0032] Step S202: Obtain the first predicted delivery time from the current logistics node to the next logistics node, and the second predicted delivery time from the current logistics node to the logistics destination.
[0033] The logistics nodes on the logistics track have a continuous sequence. Accordingly, based on the continuous sequence between the logistics nodes and the current logistics node where the item is located, the next logistics node to which the item will be transferred can be obtained.
[0034] The first predicted delivery time represents the time required for the current logistics node to reach the next logistics node from a micro perspective; the second predicted delivery time represents the time required for the current logistics node to reach the logistics destination from a macro perspective. The micro perspective focuses on breaking down the delivery time into the time required for the goods to move between adjacent logistics nodes, while the macro perspective focuses on the time required for the goods to finally reach the logistics destination.
[0035] Specifically, the first predicted delivery time is predicted by the logistics prediction model based on information such as the distance between the current logistics node and the next logistics node, current environmental information, and historical delivery times from the current logistics node to the next logistics node.
[0036] Similarly, the second predicted delivery time is predicted by the logistics prediction model based on information such as the distance between the current logistics node and the logistics destination, current environmental information, and historical delivery time from the current logistics node to the logistics destination.
[0037] In a specific example, the logistics trajectory from the logistics origin to the logistics destination is A-a1-a2-b1-b2-B. If the current logistics node of the item is a2, then the next logistics node is b1, and the logistics destination is B. The first predicted delivery time is the time required from a2 to b1; the second predicted delivery time is the time required from a2 to B.
[0038] Step S203: Construct multi-dimensional time loss information based on the first predicted delivery time and the second predicted delivery time.
[0039] Multidimensional time loss information is time loss information in different dimensions, used to assess the difference between predicted delivery time and actual delivery time from different perspectives.
[0040] As described above, the first predicted delivery time is predicted from a microscopic perspective, while the second predicted delivery time is predicted from a macroscopic perspective. Based on the first predicted delivery time and its corresponding actual delivery time, time loss information is constructed from the microscopic perspective; based on the second predicted delivery time and its corresponding actual delivery time, time loss information is constructed from the macroscopic perspective; and based on both the first and second predicted delivery times, time loss information is constructed across both perspectives, ensuring consistency in delivery time between the microscopic and macroscopic perspectives.
[0041] Step S204: Based on multi-dimensional time loss information, update the model parameters of the logistics prediction model to obtain the delivery time of the goods using the updated logistics prediction model.
[0042] The logistics forecasting model is used to predict the delivery time of goods. This logistics forecasting model can be based on sequence networks or graph neural networks. The specific model architecture of the logistics forecasting model is not limited here.
[0043] Multi-dimensional time loss information is weighted and fused according to corresponding weights to obtain composite loss information that includes multi-dimensional time loss data. This composite loss information is then used to guide the optimization of the logistics forecasting model parameters, resulting in an optimized logistics forecasting model. Subsequently, this logistics forecasting model can accurately predict delivery times based on the tracked location of items.
[0044] The logistics delivery time prediction method provided in this embodiment obtains the logistics trajectory of the item and its current logistics node, and then determines the next logistics node corresponding to the current logistics node based on the logistics trajectory. Subsequently, it obtains the first predicted delivery time from the current logistics node to the next logistics node and the second predicted delivery time from the current logistics node to the logistics destination. Based on the first and second predicted delivery times, it constructs multi-dimensional time loss information, which is then used to optimize and update the model parameters of the logistics prediction model. Here, based on the data structure characteristics of delivery time, the delivery time is broken down into a micro-perspective of the time required from the current logistics node to the next logistics node and a macro-perspective of the time required from the current logistics node to the logistics destination for iterative updates of model parameters. This avoids changes in model complexity, solving the problem of slow iterative update efficiency caused by complex model structures. Moreover, it is independent of specific model architectures and can adapt to model structures in different business scenarios, accurately solving the problem of poor model reusability in different business scenarios. Therefore, it effectively improves the accuracy of the logistics prediction model in predicting item delivery times in different business scenarios.
[0045] This embodiment provides a method for predicting logistics delivery time, which can be used in the aforementioned electronic devices, such as computers. Figure 3 This is a flowchart of a logistics delivery time prediction method according to an embodiment of the present disclosure, such as... Figure 3 As shown, the process includes the following steps: Step S301: Obtain the logistics trajectory of the item and the current logistics node where the item is located. The logistics trajectory includes multiple logistics nodes. For details, please refer to the relevant descriptions of the corresponding steps in the above embodiments, which will not be repeated here.
[0046] Step S302: Obtain the first predicted delivery time from the current logistics node to the next logistics node, and the second predicted delivery time from the current logistics node to the logistics destination. For details, please refer to the relevant descriptions of the steps in the embodiments shown above, which will not be repeated here.
[0047] Step S303: Construct multi-dimensional time loss information based on the first predicted delivery time and the second predicted delivery time.
[0048] Specifically, step S303 includes: Step S3031: Obtain the first actual delivery time corresponding to the first predicted delivery time, and the second actual delivery time corresponding to the second predicted delivery time.
[0049] The first true delivery time is the actual transit time of the goods from the current logistics node to the next logistics node; the second true delivery time is the actual transit time of the goods from the current logistics node to the final logistics destination. Specifically, the first and second true delivery times can be collected from the logistics information system.
[0050] Step S3032: Construct multi-dimensional time loss information based on the first real delivery time and the second real delivery time.
[0051] At any current logistics node, time loss information under the time interval classification dimension is constructed based on the difference between the first predicted delivery time and its actual delivery time, and the difference between the second predicted delivery time and its actual delivery time.
[0052] Based on the difference between the expected value of the first predicted delivery time and its actual delivery time, and the difference between the expected value of the second predicted delivery time and its actual delivery time, time loss information under the regression dimension is constructed.
[0053] Meanwhile, the second predicted delivery time obtained from the macro perspective should be consistent with the cumulative time of the first predicted delivery time of all future logistics nodes predicted from the micro perspective. By combining the difference between the second predicted delivery time and the cumulative time, consistent time loss information across perspectives can be constructed.
[0054] In some optional implementations, the multi-dimensional temporal loss information includes classification loss information; accordingly, step S3032 above includes: Step a1: Obtain multiple first time intervals at the first granularity and multiple second time intervals at the second granularity, where the first granularity is smaller than the second granularity.
[0055] Both the first and second granularities are time-based granularities, with the first granularity being smaller than the second. For example, the first granularity might be 1 hour, 2 hours, etc., while the second granularity might be 1 day, etc.
[0056] Accordingly, the first time interval is the time interval divided according to the first granularity.
[0057] In a specific example, if the first granularity is 1 hour, then 1 day (24 hours) can be divided into multiple first time intervals as follows: [0,1], (1,2], (2,3], (3,4], (4,5], (5,6], (6,7], (7,8], (8,9], (9,10], (11,12], (12,13], (13,14], (14,15], (15,16], (16,17], (17,18], (18,19], (19,20], (21,22], (22,23], and (23,24). Different first time intervals have corresponding identifier numbers, such as 01 to 24.
[0058] In another specific example, if the first granularity is 2 hours, then one day (24 hours) can be divided into multiple first time intervals as follows: [0,2], (2,4], (4,6], (6,8], (8,10], (10,12], (12,14], (14,16], (16,18], (18,20], (20,22], and (22,24). Different first time intervals have corresponding identifier numbers, such as 01 to 12.
[0059] Accordingly, the second time interval is the time interval formed according to the second granularity.
[0060] In a specific example, if the second granularity is 1 day, then the second time interval can be: [0,1], (1,2], (2,3], (3,4], (4,5], etc. Different second time intervals have corresponding identifier numbers, such as D1, D2, D3, D4, D5, etc.
[0061] Step a2: Obtain the first predicted probability distribution corresponding to the first predicted delivery time and the second predicted probability distribution corresponding to the second predicted delivery time.
[0062] The first prediction probability distribution represents the probability that the first predicted delivery time is of different durations from a micro perspective, such as the probability that the first predicted delivery time is 1 hour, 2 hours, 3 hours, etc.
[0063] The second prediction probability distribution represents the probability that the second predicted delivery time will be of different durations from a macro perspective, such as the probability that the second predicted delivery time will be 1 day, 1.5 days, 2 days, etc.
[0064] The probability of the first predicted delivery time taking different durations is obtained by using a logistics prediction model, and the corresponding first prediction probability distribution is output. The probability of the second predicted delivery time taking different durations is also obtained by using the logistics prediction model, and the corresponding second prediction probability distribution is output.
[0065] In some alternative implementations, a2 above includes: Step a21: Predict the first probability that the first predicted delivery time falls into each of the first time intervals, and predict the second probability that the second predicted delivery time falls into each of the second time intervals.
[0066] The probability of the first predicted delivery time falling into each first time interval is predicted using a logistics forecasting model, thus obtaining the corresponding first probability. For example, the first probability of the first predicted delivery time falling into (1,2) is 20%, the first probability of falling into (2,3) is 30%, and the first probability of falling into (3,4) is 50%.
[0067] Similarly, the probability of the second predicted delivery time falling into each second time interval is predicted using a logistics prediction model, thus obtaining the corresponding second probability. For example, the second probability of the second predicted delivery time falling into (0,1) is 10%, the second probability of falling into (1,2) is 30%, the second probability of falling into (2,3) is 40%, and the second probability of falling into (3,4) is 20%.
[0068] Step a22: Based on each first probability, obtain the first predicted probability distribution.
[0069] Step a23: Based on each second probability, obtain the second predicted probability distribution.
[0070] Using the first predicted delivery time as a random variable, a discrete first prediction probability distribution is formed based on all possible durations corresponding to the first predicted delivery time and the first probability corresponding to each possible duration. Similarly, using the second predicted delivery time as a random variable, a discrete second prediction probability distribution is formed based on all possible durations corresponding to the second predicted delivery time and the second probability corresponding to each possible duration.
[0071] By setting time intervals with different granularities, the first predicted probability distribution corresponding to the first predicted delivery time and the second predicted probability distribution corresponding to the second predicted delivery time are obtained, thereby improving the accurate representation of the first predicted delivery time and the second predicted delivery time.
[0072] Step a3: Compare the first actual delivery time with each first time interval, and compare the second actual delivery time with each second time interval to obtain the first target time interval in which the first actual delivery time is located, and the second target time interval in which the second actual delivery time is located.
[0073] The first actual delivery time is compared with each pre-divided first time interval, and the first target time interval in which the first actual delivery time falls is selected from each first time interval. Simultaneously, the second actual delivery time is compared with each pre-divided second time interval, and the second target time interval in which the second actual delivery time falls is selected from each second time interval.
[0074] Step a4: Obtain the first loss information based on the difference between the first predicted probability distribution and the first target time interval.
[0075] By comparing each first time interval on the first predicted probability distribution with the first target time interval, and using the cross-entropy loss function, the difference between each first time interval on the first predicted probability distribution and the first target time interval is calculated to obtain the corresponding first loss information.
[0076] Step a5: Obtain the second loss information based on the difference between the second predicted probability distribution and the second target time interval.
[0077] By comparing each second time interval on the second predicted probability distribution with the second target time interval, and using the cross-entropy loss function, the difference between each second time interval on the second predicted probability distribution and the second target time interval is calculated to obtain the corresponding second loss information.
[0078] Step a6: Based on the weighted result of the first loss information and the second loss information, the classification loss information is obtained.
[0079] Based on the model structure of the logistics prediction model, hyperparameters corresponding to the first and second loss information are set, and the first and second loss information are weighted and summed to obtain the classification loss information under the classification dimension.
[0080] By calculating the difference between the first predicted probability distribution and the first target time interval from a micro perspective, and the difference between the second predicted probability distribution and the second target time interval from a macro perspective, and then summing the two by weight, the corresponding classification loss information is obtained, ensuring the robustness and stability of the model parameters of the logistics prediction model during the iterative update process.
[0081] In some optional implementations, the multi-dimensional temporal loss information includes regression loss information, and accordingly, step S3032 above includes: Step c1: Based on the first predicted probability distribution, obtain the first time expectation from the current logistics node to the next logistics node.
[0082] Based on the first predicted probability distribution, obtain each first time interval and its corresponding probability. Multiply the identifier corresponding to each first time interval with its corresponding probability and then add them together to obtain the first expected time for the item to be transported from the current logistics node to the next logistics node.
[0083] Step c2: Based on the second predicted probability distribution, obtain the second time expectation from the current logistics node to the logistics destination.
[0084] Based on the second predicted probability distribution, obtain each second time interval and its corresponding probability. Multiply the identifier corresponding to each second time interval with its corresponding probability and then add them together to obtain the second expected time for the item to be transported from the current logistics node to the logistics destination.
[0085] Step c3: Based on the difference between the expected delivery time and the actual delivery time, obtain the third loss information.
[0086] By using regression loss functions such as mean squared error, the difference between the expected delivery time and the actual delivery time is obtained, and the corresponding third loss information is obtained based on this difference.
[0087] Step c4: Based on the difference between the second expected time and the second actual delivery time, obtain the fourth loss information.
[0088] By using regression loss functions such as mean squared error, the difference between the second expected delivery time and the second actual delivery time is obtained, and based on this difference, the corresponding fourth loss information is obtained.
[0089] Step c5: Based on the fusion of the third and fourth loss information, regression loss information is obtained.
[0090] In a specific example, the third loss information and the fourth loss information are superimposed to achieve the fusion of the third loss information and the fourth loss information, so as to obtain the regression loss information in the regression dimension.
[0091] In another specific example, based on the model structure of the logistics prediction model, hyperparameters corresponding to the third and fourth loss information are set, and the third and fourth loss information are weighted and summed to obtain the regression loss information under the regression dimension.
[0092] By determining the difference between the first expected delivery time and the first actual delivery time, as well as the difference between the second expected delivery time and the second actual delivery time, corresponding regression loss information is constructed. This regression loss information is then used as an additional supervision signal during the iterative update of model parameters, enabling the model parameters to converge quickly to a better performance level. This effectively reduces the computational resources and time costs required for model iteration updates, and greatly improves the efficiency of model iteration updates.
[0093] In some alternative implementations, the expected time value and the actual delivery time value are logarithmically transformed before calculating the regression loss information to improve the training stability of the logistics prediction model.
[0094] In some optional implementations, the multi-dimensional time loss information includes consistency loss information, and accordingly, step S3032 above includes: Step d1: Sum the first actual delivery times of all subsequent logistics nodes to obtain the target actual delivery time.
[0095] Step d2: Based on the difference between the total time expectation and the second time expectation corresponding to the second predicted probability distribution, the consistency loss information is obtained.
[0096] As described above, the delivery time predicted from a macro perspective at any current logistics node should be consistent with the sum of the delivery times predicted from a micro perspective for all future logistics nodes. Specifically, at any current logistics node, the target true delivery time is obtained by superimposing all the first true delivery times after that current logistics node.
[0097] Using the target's real time as the self-supervised macroscopic target value, the mean square error is used to obtain the difference between the second time expectation and the target's real time, forming consistency loss information across perspective dimensions. This consistency loss information is then used to constrain the consistency between microscopic and macroscopic perspective predictions.
[0098] By constructing consistency loss information and using it as a self-supervised signal, the logistics forecasting model is forced to learn the intrinsic relationship between the microscopic perspective of the time required from the current logistics node to the next logistics node and the macroscopic perspective of the time required from the current logistics node to the logistics destination. Utilizing consistency loss, combined with the multi-dimensional supervision provided by classification loss and regression loss, enables the logistics forecasting model to generate more robust and accurate time representations.
[0099] Step S304: Based on multi-dimensional time loss information, update the model parameters of the logistics prediction model to obtain the delivery time of the goods using the updated logistics prediction model. For details, please refer to the relevant descriptions of the corresponding steps in the above embodiments, which will not be repeated here.
[0100] The logistics delivery time prediction method provided in this embodiment combines the first actual delivery time corresponding to the first predicted delivery time and the second actual delivery time corresponding to the second predicted delivery time to construct time loss information in different dimensions. This enables the logistics prediction model to use multi-dimensional time loss information as a supervision signal to iteratively update the model parameters, effectively accelerating the convergence of the model parameters.
[0101] This embodiment provides a method for predicting logistics delivery time, which can be used in the aforementioned electronic devices, such as computers. Figure 4 This is a flowchart of a logistics delivery time prediction method according to an embodiment of the present disclosure, such as... Figure 4 As shown, the process includes the following steps: Step S401: Obtain the logistics trajectory of the item and the current logistics node where the item is located. The logistics trajectory includes multiple logistics nodes. For details, please refer to the relevant descriptions of the corresponding steps in the above embodiments, which will not be repeated here.
[0102] Step S402: Obtain the first predicted delivery time from the current logistics node to the next logistics node, and the second predicted delivery time from the current logistics node to the logistics destination. For details, please refer to the relevant descriptions of the steps in the embodiments shown above, which will not be repeated here.
[0103] Step S403: Construct multi-dimensional time loss information based on the first predicted delivery time and the second predicted delivery time. For details, please refer to the relevant descriptions of the corresponding steps in the embodiments shown above; they will not be repeated here.
[0104] Step S404: Based on multi-dimensional time loss information, update the model parameters of the logistics prediction model to obtain the delivery time of the goods using the updated logistics prediction model.
[0105] Specifically, step S404 includes: Step S4041: Obtain the average time loss of time loss information for each dimension.
[0106] Different items possess corresponding multi-dimensional time loss information. For each dimension, the time loss information for each item is averaged to obtain the mean time loss for that dimension. In a specific example, the mean time loss for each dimension is obtained using the exponential moving average method.
[0107] Step S4042: Based on the mean of time loss in each dimension, dynamically update the weights of time loss information in each dimension.
[0108] Based on the mean time loss under different dimensions, the weights of time loss information in different dimensions are dynamically calculated. These weights are used to balance the contributions of multi-dimensional time loss information in the training process of logistics prediction models.
[0109] In some optional implementations, step S4042 above includes: Step e1: Obtain the magnitude of time loss corresponding to the mean time loss.
[0110] Step e2: In response to the different magnitudes of time loss, the weights of time loss information in each dimension are updated to obtain the updated weights.
[0111] The updated weights are used to adjust the time loss magnitude to the baseline magnitude.
[0112] The magnitude of time loss refers to the numerical magnitude of the time loss value. Specifically, by comparing the time loss values under each dimension, the magnitude of time loss corresponding to the time loss value in each dimension is obtained.
[0113] The magnitudes of time loss across different dimensions are compared to determine if they are the same. If the magnitudes of time loss differ across dimensions, the weights corresponding to the time loss information in each dimension are adaptively updated to obtain the updated weights.
[0114] By adjusting the time loss magnitude of all dimensions to the baseline level through the updated weights, it is ensured that time loss information of different magnitudes can effectively contribute to the optimization of the logistics prediction model at different training stages, thereby accelerating the convergence speed and improving the prediction performance of the logistics prediction model.
[0115] In some optional implementations, the baseline magnitude is the temporal loss magnitude corresponding to the classification loss information. As described above, the multi-dimensional temporal loss information includes classification loss information, regression loss information, and consistency loss information. Here, the temporal loss magnitude corresponding to the classification loss information can be used as the baseline magnitude, and the weights of the regression loss information and consistency loss information can be adjusted to bring the temporal loss information of each dimension to the same magnitude.
[0116] Step S4043: Based on the weights of the time loss information in each dimension, the time loss information in each dimension is weighted and fused to obtain composite loss information.
[0117] The time loss information from each dimension is weighted according to its corresponding weight to merge the time loss information from each dimension and obtain the corresponding composite loss information.
[0118] Step S4044: Update the model parameters of the logistics forecasting model using composite loss information.
[0119] By utilizing composite loss information, the training process of the logistics forecasting model is guided from multiple dimensions. The model parameters in the logistics forecasting model are updated using methods such as gradient descent to obtain updated model parameters, so that the logistics forecasting model with updated model parameters has higher time prediction accuracy.
[0120] The logistics delivery time prediction method provided in this embodiment dynamically updates the weights of time loss information in each dimension to achieve adaptive optimization of these weights. The model parameters are updated according to the composite loss information obtained by weighted fusion of time loss information from each dimension, ensuring the model has a faster loss reduction speed and can converge to a better performance level. Simultaneously, updating model parameters using composite loss information eliminates the need for complex modifications to the model structure, solving the problem of strong coupling between the model and data structure and difficulty in reusability. This significantly reduces the cost and cycle of migrating and adapting the model across different business scenarios, perfectly matching the agile iteration requirements of industrial applications.
[0121] As a specific application embodiment of this disclosure, the model parameters of the logistics prediction model in the logistics commodity business scenario are iteratively updated using the above method, and the logistics prediction model after iteratively updating the model parameters is updated to the logistics information system. The logistics information system can then perform delivery time prediction of logistics commodities according to the logistics prediction model.
[0122] This embodiment also provides a logistics delivery time prediction device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0123] This embodiment provides a device for predicting logistics delivery time, such as... Figure 5 As shown, it includes: The logistics node acquisition module 501 is used to acquire the logistics trajectory of the item and the current logistics node where the item is located. The logistics trajectory includes multiple logistics nodes.
[0124] The prediction time acquisition module 502 is used to acquire the first predicted delivery time from the current logistics node to the next logistics node, and the second predicted delivery time from the current logistics node to the logistics destination.
[0125] The loss information construction module 503 is used to construct multi-dimensional time loss information based on the first predicted delivery time and the second predicted delivery time.
[0126] The time prediction module 504 is used to update the model parameters of the logistics prediction model based on multi-dimensional time loss information, so as to obtain the logistics delivery time of the goods using the updated logistics prediction model.
[0127] In some alternative implementations, the loss information construction module 503 includes: The time acquisition unit is used to acquire the first actual delivery time corresponding to the first predicted delivery time, and the second actual delivery time corresponding to the second predicted delivery time.
[0128] The time loss construction unit is used to construct the multi-dimensional time loss information based on the first real delivery time and the second real delivery time.
[0129] In some optional implementations, the multi-dimensional time loss information includes classification loss information, and accordingly, the time loss construction unit includes: The time interval acquisition sub-unit is used to acquire multiple first time intervals at a first granularity and multiple second time intervals at a second granularity, where the first granularity is smaller than the second granularity.
[0130] The probability distribution acquisition subunit is used to acquire the first predicted probability distribution corresponding to the first predicted delivery time and the second predicted probability distribution corresponding to the second predicted delivery time.
[0131] The target interval determination sub-unit is used to compare the first actual delivery time with each first time interval and the second actual delivery time with each second time interval to obtain the first target time interval in which the first actual delivery time is located and the second target time interval in which the second actual delivery time is located.
[0132] The first loss construction sub-unit is used to obtain the first loss information based on the difference between the first predicted probability distribution and the first target time interval.
[0133] The second loss construction subunit is used to obtain the second loss information based on the difference between the second predicted probability distribution and the second target time interval.
[0134] The first fusion subunit is used to obtain classification loss information based on the weighted result of the first loss information and the second loss information.
[0135] In some optional implementations, the probability distribution acquisition subunit is used to predict a first probability that the first predicted delivery time falls into each of the first time intervals, and to predict a second probability that the second predicted delivery time falls into each of the second time intervals; to obtain a first predicted probability distribution based on each of the first probabilities; and to obtain a second predicted probability distribution based on each of the second probabilities.
[0136] In some optional implementations, the multi-dimensional time loss information includes regression loss information, and accordingly, the time loss construction unit includes: The first expectation determination sub-unit is used to obtain the first time expectation from the current logistics node to the next logistics node based on the first prediction probability distribution.
[0137] The second expectation determination sub-unit is used to obtain the second time expectation from the current logistics node to the logistics destination based on the second prediction probability distribution.
[0138] The third loss construction sub-unit is used to obtain third loss information based on the difference between the expected first time and the actual first delivery time.
[0139] The fourth loss construction sub-unit is used to obtain fourth loss information based on the difference between the second expected time and the second actual delivery time.
[0140] The second fusion subunit is used to fuse the third and fourth loss information to obtain regression loss information.
[0141] In some optional implementations, the multi-dimensional time loss information includes consistency loss information, and accordingly, the time loss construction unit includes: The accumulation sub-unit is used to accumulate all first-time expectations after the current logistics node based on the first prediction probability distribution to obtain the total time expectation.
[0142] The fifth loss construction sub-unit is used to obtain consistency loss information based on the difference between the total time expectation and the second time expectation corresponding to the second prediction probability distribution.
[0143] In some alternative implementations, the time prediction module 504 includes: The loss mean acquisition unit is used to obtain the time loss mean of time loss information in each dimension.
[0144] The weight update unit is used to dynamically update the weights of time loss information in each dimension based on the mean of time loss in each dimension.
[0145] The composite loss determination unit is used to perform weighted fusion of time loss information in each dimension according to the weight of time loss information in each dimension to obtain composite loss information.
[0146] The parameter update unit is used to update the model parameters of the logistics forecasting model using composite loss information.
[0147] In some optional implementations, the weight update unit includes: The magnitude acquisition sub-unit is used to obtain the magnitude of time loss corresponding to the mean time loss in each dimension.
[0148] The update sub-unit is used to update the weights of time loss information in each dimension in response to different time loss magnitudes, resulting in updated weights. The updated weights are used to adjust the time loss magnitude to the baseline magnitude.
[0149] The logistics delivery time prediction device provided in this disclosure can execute the logistics delivery time prediction method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method. It obtains the logistics trajectory of the item and the current logistics node where the item is located, and then obtains the next logistics node corresponding to the current logistics node based on the logistics trajectory. Subsequently, it obtains the first predicted delivery time from the current logistics node to the next logistics node and the second predicted delivery time from the current logistics node to the logistics destination, and constructs multi-dimensional time loss information based on the first and second predicted delivery times. This multi-dimensional time loss information is then used to optimize and update the model parameters of the logistics prediction model. Here, based on the data structure characteristics of delivery time, the delivery time is divided into a micro-perspective of the time required from the current logistics node to the next logistics node and a macro-perspective of the time required from the current logistics node to the logistics destination for iterative updating of model parameters. This does not involve changes in model complexity, solving the problem of slow iterative update efficiency caused by complex model structures; moreover, it is independent of specific model architectures and can adapt to model structures in different business scenarios, accurately solving the problem of poor model reusability in different business scenarios. This effectively improves the accuracy of logistics forecasting models in predicting the delivery time of goods in different business scenarios.
[0150] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0151] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.
[0152] The following is a detailed reference. Figure 6 This diagram illustrates a suitable structural schematic for implementing an electronic device according to embodiments of the present disclosure. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 601, which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 602 or a program loaded from memory 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the electronic device. The processor 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0153] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0154] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a memory 608, or installed from a ROM 602. When the computer program is executed by the processor 601, it performs the functions defined in the logistics delivery time prediction method of embodiments of this disclosure.
[0155] Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0156] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the logistics delivery time prediction method shown in the above embodiments.
[0157] A portion of this disclosure can be applied to computer program products, such as computer program instructions, which, when executed by a computer, can invoke or provide methods and / or technical solutions according to this disclosure through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, and installation package files. Accordingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0158] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for predicting logistics delivery time, comprising: Obtain the logistics trajectory of the item and the current logistics node where the item is located. The logistics trajectory includes multiple logistics nodes. Obtain the first predicted delivery time from the current logistics node to the next logistics node, and the second predicted delivery time from the current logistics node to the logistics destination; Based on the first predicted delivery time and the second predicted delivery time, construct multi-dimensional time loss information; Based on the multi-dimensional time loss information, the model parameters of the logistics prediction model are updated so as to obtain the logistics delivery time of the item using the updated logistics prediction model.
2. The method according to claim 1, wherein constructing multi-dimensional time loss information based on the first predicted delivery time and the second predicted delivery time includes: Obtain the first actual delivery time corresponding to the first predicted delivery time, and the second actual delivery time corresponding to the second predicted delivery time; Based on the first actual delivery time and the second actual delivery time, the multi-dimensional time loss information is constructed.
3. The method according to claim 2, wherein the multi-dimensional time loss information includes classification loss information, and the step of constructing the multi-dimensional time loss information based on the first actual delivery time and the second actual delivery time includes: Obtain multiple first time intervals at a first granularity and multiple second time intervals at a second granularity, wherein the first granularity is smaller than the second granularity; Obtain the first predicted probability distribution corresponding to the first predicted delivery time, and the second predicted probability distribution corresponding to the second predicted delivery time; The first actual delivery time is compared with each of the first time intervals, and the second actual delivery time is compared with each of the second time intervals to obtain the first target time interval in which the first actual delivery time is located, and the second target time interval in which the second actual delivery time is located. The first loss information is obtained based on the difference between the first predicted probability distribution and the first target time interval; The second loss information is obtained based on the difference between the second predicted probability distribution and the second target time interval; The classification loss information is obtained based on the weighted result of the first loss information and the second loss information.
4. The method according to claim 3, wherein obtaining the first predicted probability distribution corresponding to the first predicted delivery time and the second predicted probability distribution corresponding to the second predicted delivery time comprises: Predict the first probability that the first predicted delivery time falls into each of the first time intervals, and predict the second probability that the second predicted delivery time falls into each of the second time intervals; Based on each of the first probabilities, the first predicted probability distribution is obtained; The second predicted probability distribution is obtained based on each of the second probabilities.
5. The method according to claim 3, wherein the multi-dimensional time loss information includes regression loss information, and the step of constructing the multi-dimensional time loss information based on the first actual delivery time and the second actual delivery time includes: Based on the first predicted probability distribution, the first expected time from the current logistics node to the next logistics node is obtained; Based on the second predicted probability distribution, a second time expectation from the current logistics node to the logistics destination is obtained; Based on the difference between the first expected delivery time and the first actual delivery time, the third loss information is obtained; The fourth loss information is obtained based on the difference between the second expected time and the second actual delivery time; The regression loss information is obtained by fusing the third loss information and the fourth loss information.
6. The method according to claim 3, wherein the multi-dimensional time loss information includes consistency loss information, and the step of constructing the multi-dimensional time loss information based on the first true delivery time and the second true delivery time includes: The target real time is obtained by summing up all the first real delivery times after the current logistics node; The consistency loss information is obtained based on the difference between the actual target time and the second time expectation corresponding to the second predicted probability distribution.
7. The method according to any one of claims 1 to 6, wherein updating the model parameters of the logistics prediction model based on the multi-dimensional time loss information comprises: Obtain the mean time loss of the time loss information in each dimension; Based on the mean time loss of each dimension, the weights of the time loss information of each dimension are dynamically updated. Based on the weights of the time loss information in each dimension, the time loss information in each dimension is weighted and fused to obtain composite loss information. The model parameters of the logistics prediction model are updated using the composite loss information.
8. The method according to claim 7, wherein dynamically updating the weights of the time loss information in each dimension based on the mean of the time loss in each dimension includes: Obtain the magnitude of time loss corresponding to the mean time loss for each dimension; In response to the different magnitudes of time loss, the weights of the time loss information in each dimension are updated to obtain the updated weights. The updated weights are used to adjust the time loss magnitude to the baseline magnitude.
9. A device for predicting logistics delivery time, comprising: The logistics node acquisition module is used to acquire the logistics trajectory of the item and the current logistics node where the item is located. The logistics trajectory includes multiple logistics nodes. The predicted delivery time acquisition module is used to acquire the first predicted delivery time from the current logistics node to the next logistics node, and the second predicted delivery time from the current logistics node to the logistics destination. The loss information construction module is used to construct multi-dimensional time loss information based on the first predicted delivery time and the second predicted delivery time. The time prediction module is used to update the model parameters of the logistics prediction model based on the multi-dimensional time loss information, so as to obtain the logistics delivery time of the item using the updated logistics prediction model.
10. An electronic device, comprising: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the logistics delivery time prediction method according to any one of claims 1 to 8.
11. A computer-readable storage medium storing computer instructions for causing a computer to perform the logistics delivery time prediction method according to any one of claims 1 to 8.
12. A computer program product comprising computer instructions for causing a computer to execute the logistics delivery time prediction method according to any one of claims 1 to 8.