Logistics prediction method, medium, computer equipment and program product
By constructing a spatiotemporal graph data structure and a global perspective prediction model, the high cost problem caused by modeling logistics nodes individually was solved, and efficient and low-cost prediction of the number of parcels at multiple nodes was achieved.
Patent Information
- Application Number
- CN202511318225.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2026-02-06
AI Technical Summary
In existing technologies, separate prediction models are built for each logistics node to predict the number of parcels, resulting in high development and maintenance costs.
A spatiotemporal graph data structure is constructed to integrate the historical logistics time information of each node and its delivery route in the logistics system into a unified data framework. A prediction model is used to learn the parcel flow pattern from a global perspective, and a single model is used to predict the parcel quantity of multiple logistics nodes.
It significantly reduces development and maintenance costs, improves forecast accuracy and efficiency, and can cover parcel quantity forecasting needs across multiple logistics nodes.
Smart Images

Figure CN121481376A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of logistics technology, and in particular to a logistics forecasting method, medium, computer equipment, and program product. Background Technology
[0002] In today's booming e-commerce landscape, the logistics system handles a massive volume of parcels. Each logistics node, such as distribution centers and delivery stations, urgently needs accurate parcel quantity forecasting data to rationally allocate human and material resources and ensure efficient logistics operations. Current technologies typically involve building separate forecasting models for each logistics node, using these models to predict the parcel quantity for that node. However, this approach requires developing and maintaining separate forecasting models for each node, resulting in high development and maintenance costs. Summary of the Invention
[0003] In a first aspect, embodiments of this application provide a logistics forecasting method, the method comprising: Determine the total number of parcels from the origin to the destination within the predicted time period; Acquire spatiotemporal graph data, which includes multiple data nodes and edges connecting the multiple data nodes. The multiple data nodes correspond to multiple logistics nodes in the logistics system. The edges between data nodes are used to represent the delivery path between the logistics nodes corresponding to the data nodes. The information of the data nodes includes the historical logistics time information of the logistics nodes corresponding to the data nodes. The information of the edges includes the historical logistics time information on the delivery path corresponding to the edges. The spatiotemporal map data is input into a pre-trained prediction model so that the prediction model can predict the probability distribution of the time when the package arrives at the target logistics node based on the spatiotemporal map data. The target logistics node includes at least one logistics node on the delivery path from the logistics origin to the logistics destination. Based on the probability distribution, the total number is sampled to obtain the number of packages arriving at the target logistics node within the time period to be predicted.
[0004] Secondly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods described in any embodiment of this application.
[0005] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any embodiment of this application.
[0006] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in any embodiment of this application.
[0007] This application embodiment integrates historical logistics time information of each node and its delivery route in the logistics system by constructing a spatiotemporal graph data structure, forming a unified data framework. Using this framework, the prediction model can learn the flow patterns of packages across various logistics nodes in the logistics system from a global perspective, rather than modeling each node individually. This allows a single prediction model to predict the number of packages across multiple logistics nodes, significantly reducing development and maintenance costs.
[0008] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description
[0009] The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments consistent with this application and, together with the description, serve to explain the technical solutions of this application.
[0010] Figure 1 This is a schematic diagram of a logistics scenario according to an embodiment of this application.
[0011] Figure 2 This is a flowchart of the logistics forecasting method according to an embodiment of this application.
[0012] Figure 3 This is a schematic diagram of the spatiotemporal graph data in an embodiment of this application.
[0013] Figure 4 This is a system architecture diagram of an embodiment of this application.
[0014] Figure 5 This is a general flowchart of an embodiment of this application.
[0015] Figure 6 This is a schematic diagram of a computer device according to an embodiment of this application. Detailed Implementation
[0016] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0017] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items. Additionally, the term “at least one” herein means any combination of at least two of any one or more of a plurality.
[0018] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0019] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0020] Figure 1 The diagram illustrates a logistics scenario in several embodiments, involving a buyer terminal 102, an e-commerce platform server 104, a seller terminal 106, and a logistics platform server 108. In this scenario, a buyer places an order on the e-commerce platform through the buyer terminal 102 (e.g., a mobile phone or computer). The e-commerce platform server 104 receives the order information and sends it to the seller terminal 106. Upon receiving the order information, the seller terminal accepts the order, arranges shipment, and uploads package information (e.g., the package's tracking number) to the e-commerce platform server 104. The logistics delivery process may involve multiple logistics nodes. After the seller ships the package, it may first be delivered from the warehouse to the first logistics station, then to a distribution center, and so on, until it finally reaches its destination. The logistics platform server 108 can record and update logistics information, such as the arrival and departure times of the package at each logistics node, and can also update the logistics information to the e-commerce platform server 104. The e-commerce platform server 104 can update the logistics information obtained from the logistics platform server 108 to the buyer terminal 102 and the seller terminal 106 for viewing.
[0021] To rationally allocate human and material resources and ensure efficient logistics operations, it is necessary to predict the number of packages at each logistics node. In related technologies, a separate prediction model is typically built for each logistics node, and the number of packages at each node is predicted independently. This approach requires the separate development and maintenance of prediction models for each logistics node, resulting in high development and maintenance costs.
[0022] Based on this, this application proposes a logistics forecasting method, see [link to relevant documentation]. Figure 2 The method includes: Step S12: Determine the total number of parcels from the origin to the destination within the predicted time period; Step S14: Obtain spatiotemporal graph data, which includes multiple data nodes and edges connecting the multiple data nodes. The multiple data nodes correspond to multiple logistics nodes in the logistics system. The edges between data nodes are used to represent the delivery path between the logistics nodes corresponding to the data nodes. The information of the data nodes includes the historical logistics time information of the logistics nodes corresponding to the data nodes, and the information of the edges includes the historical logistics time information on the delivery path corresponding to the edges. Step S16: Input the spatiotemporal map data into a pre-trained prediction model so that the prediction model can predict the probability distribution of the time when the package arrives at the target logistics node based on the spatiotemporal map data. The target logistics node includes at least one logistics node on the delivery path from the logistics origin to the logistics destination. Step S18: Sample the total number based on the probability distribution to obtain the number of packages arriving at the target logistics node within the time period to be predicted.
[0023] This application integrates historical logistics time information of each node and its delivery route in the logistics system into a unified spatiotemporal graph data structure. This allows the prediction model to learn the flow patterns of packages at each logistics node from a global perspective, thereby enabling the prediction of the number of packages at multiple logistics nodes using a single prediction model, significantly reducing development and maintenance costs. The specific implementation details of this application embodiment are illustrated below.
[0024] In step S12, the total number of packages from the logistics origin to the logistics destination within the predicted time period can be determined. The predicted time period refers to the period after the current time (i.e., the time point for logistics forecasting), i.e., the future time period. The predicted time period can be input by the user, or a default value can be used (e.g., the 3rd day after the current time). The logistics origin is the starting point for the package's logistics delivery. For a package that has not yet been shipped, the logistics origin usually refers to the seller's warehouse or shipping point, which is where the package is expected to begin logistics delivery. For a package that has been shipped and has reached an intermediate logistics node, the logistics origin refers to the previous node in the current delivery path, such as a distribution center or transit point. The logistics destination is the final point for the package's logistics delivery.
[0025] In some embodiments, parcels from the origin to the destination within the predicted time period include parcels in transit. Parcels in transit refer to parcels generated in the logistics system before the current moment, i.e., parcels actually existing in the logistics system. The origin and destination of parcels in transit can be determined based on logistics information (such as shipping and receiving addresses) recorded in the logistics system. Furthermore, parcels from the origin to the destination may also include virtual parcels, which are parcels not yet generated in the logistics system as of the current moment, i.e., parcels that do not actually exist in the logistics system but are expected to be generated soon.
[0026] In the example where the parcels include parcels in transit and virtual parcels, a first number of virtual parcels from the logistics origin to the logistics destination and a second number of parcels in transit from the logistics origin to the logistics destination within the predicted time period can be determined, and the sum of the first number and the second number can be determined as the total number of parcels from the logistics origin to the logistics destination within the predicted time period.
[0027] Among them, parcels in transit are parcels that have already been generated, and their logistics information is recorded in the logistics system. Therefore, the second quantity of parcels in transit can be directly read from the logistics system. The following mainly illustrates the method for determining the first quantity of virtual parcels.
[0028] In some embodiments, the number of virtual packages can be predicted based on the sales information of the product. A package will be generated after a buyer places an order for the product; for ease of description, the package generated after an order is placed will be referred to as the package corresponding to that product. Assuming the virtual package is the package corresponding to the target product, the predicted sales information of the target product within the predicted time period can be obtained, and a first quantity of virtual packages within the predicted time period can be determined based on the predicted sales information.
[0029] In some embodiments, the predicted sales volume information of the target product within the predicted time period can be obtained based on the product information of the target product, which can be information representing the user's demand for the target product. For example, product information may include, but is not limited to, at least one of the following: product review information, user interaction information, and time information related to sales volume. The quality of product reviews directly affects users' willingness to buy; positive reviews can increase product sales, while negative reviews may lead to a decline in product sales. User interaction data, such as browsing, adding to cart, and favorites, can reflect the intensity of buyers' interest and demand for the product; products with more user interaction data often have higher sales. Time information includes, but is not limited to, holiday information, promotional day information, etc., which can reflect the fluctuation pattern of sales volume from the perspective of historical sales trends and cyclical changes such as seasonality and promotional periods.
[0030] Product features can be extracted from product information to obtain the target product's features. When product information includes product reviews, which are typically text-based, semantic encoding can be performed to obtain the first feature. When product information includes user interaction information, feature engineering can be performed on this user interaction information to obtain the second feature. When product information includes time information related to sales volume, feature extraction can be performed on this time information to obtain the third feature. Then, the first, second, and third features can be fused to obtain the target product's features. After feature extraction, the predicted sales volume of the target product within the predicted time period can be determined based on these features.
[0031] In some embodiments, the time when packages are generated can also be predicted (hereinafter referred to as package generation time). Since the predicted packages are virtual packages, meaning the time when the packages are generated is later than the time when the prediction is made (i.e., the current time), after predicting the number of virtual packages, the number of virtual packages whose generation time is no earlier than the current time can be further filtered based on the predicted package generation time. For example, assuming the predicted number of virtual packages is 20, and it is predicted that the generation time of 3 of these packages is earlier than the current time, then the final determined first number of virtual packages needs to be subtracted from 20, i.e., the first number is 17.
[0032] Furthermore, the predicted sales information can be further refined into predicted sales information for the target product from the logistics origin point to the logistics destination point. The logistics origin point and logistics destination point of the target product can be determined based on the shipping address and delivery address in the historical order information, respectively. Assuming that the total sales volume of the target product is X within a preset historical time period, and the ratio of the sales volume of the target product from the logistics origin point A to the logistics destination point B to the total sales volume is r, then the predicted sales volume information X_AB of the target product from the logistics origin point A to the logistics destination point B within the preset historical time period can be determined based on the product of the total sales volume X of the target product and the aforementioned ratio r, denoted as X_AB = X*r.
[0033] After obtaining the predicted sales volume information of the target product from the logistics origin to the logistics destination within the predicted time period, the aforementioned first quantity can be determined based on the predicted sales volume information. For example, if the product delivery mode is fixed, such as single-item single-package delivery, the predicted sales volume can be directly determined as the aforementioned first quantity. Alternatively, in complex scenarios, delivery unit coefficients can be established using historical data in conjunction with product delivery rules, and the product of the predicted sales volume information and the delivery unit coefficient can be used to determine the aforementioned first quantity. The delivery unit coefficient represents the ratio of the number of packages to the number of products; for example, assuming two products are packaged into one package, the delivery unit coefficient is 0.5.
[0034] In step S14, spatiotemporal graph data can be acquired. This data reflects the flow of packages along delivery paths between logistics nodes in the logistics system at different times. The spatiotemporal graph data may include multiple data nodes and edges connecting them. Here, data nodes represent logistics nodes in the logistics system, and edges represent delivery paths between corresponding logistics nodes. Figure 3 The diagram illustrates spatiotemporal graph data from several embodiments. This data includes four data nodes, corresponding to four logistics nodes: Station 1, Station 2, Distribution Center 1, and Station 3. The edge between the data node corresponding to Station 1 and the data node corresponding to Station 2 corresponds to Road 1; the edge between the data node corresponding to Station 2 and the data node corresponding to Distribution Center 1 corresponds to Road 2; and the edge between the data node corresponding to Distribution Center 1 and the data node corresponding to Station 3 corresponds to Road 3. The connections between nodes and edges clearly reflect the network structure of the logistics system, facilitating the determination of the logistics nodes traversed from the logistics origin to the logistics destination.
[0035] In addition to recording the connections between data nodes, spatiotemporal graph data can also record information about data nodes and edges. Data node information includes historical logistics time information for the corresponding logistics nodes, such as the arrival time of a single historical package, the departure time of a single historical package, the average arrival time of multiple historical packages, and / or the average departure time of multiple historical packages. Based on this historical logistics time information, the package flow rate and parcel velocity of the logistics node can be determined. The package flow rate of a logistics node refers to the total number of packages passing through (entering or leaving) the node within a specific time period, reflecting the node's throughput. The parcel velocity is the average dwell time of packages at the logistics node or the efficiency of processing packages per unit time, reflecting the node's processing speed. Furthermore, the historical logistics time information can be used to determine the anomaly index of the logistics node. The anomaly index measures the deviation of the logistics node's package processing time from the expected value, reflecting whether the logistics node is operating abnormally. Edge information can include historical logistics time information for the delivery path corresponding to the edge, such as the arrival time of a single historical package on the delivery path, the departure time of a single historical package on the delivery path, the average arrival time of multiple historical packages on the delivery path, and / or the average departure time of multiple historical packages on the delivery path. In addition, the edge information may also include the length of the corresponding delivery path. Based on the historical logistics time information and the length of the delivery path, information such as the maximum delivery speed, average delivery speed, and historical delivery time on the delivery path can be determined. In some embodiments, information about data nodes and edges at multiple different times (such as T1 / T2 / T3 in the figure) can be recorded in the spatiotemporal graph.
[0036] In some embodiments, trajectory data of historical packages (i.e., packages generated within a past period) in the logistics system can be acquired (hereinafter referred to as historical trajectory data), and spatiotemporal graph data can be generated based on the historical trajectory data. Specifically, the trajectory data of each historical package includes the logistics nodes (such as stations, distribution centers, etc.) that the historical package passed through at different points in time, as well as the movement path between each logistics node. Logistics nodes can be extracted from these trajectories as data nodes in the spatiotemporal graph data, and then the edges of the spatiotemporal graph data can be determined according to the path of the package moving from one logistics node to another. For example, if multiple historical packages move from station A to station B, an edge can be created between station A and station B. At the same time, information about individual data nodes and edges can also be recorded, such as the dwell time of the historical package at the logistics node corresponding to the data node and the transportation time on the delivery path corresponding to the edge. By integrating the trajectory data of all historical packages, a complete spatiotemporal graph data can be constructed, which not only shows the spatial structure of the logistics system but also reflects the temporal characteristics of the logistics delivery process.
[0037] In step S16, spatiotemporal map data can be input into the prediction model to predict the probability distribution of the time when the package arrives at the target logistics node. The target logistics node can include at least one logistics node on the delivery path from the logistics origin to the logistics destination. The target logistics node can be a user-selected logistics node or a default logistics node. The probability distribution of the time when the package arrives at the target logistics node refers to the probability that the package will arrive at the target logistics node at a specified time. For example, the probability that the package will arrive at the target logistics node in the next 3 hours is 80%, and the probability that the package will arrive at the target logistics node in the next 5 hours is 90%, etc.
[0038] In some embodiments, the prediction model includes a temporal feature extraction module, a spatial feature extraction module, and a prediction module. The temporal feature extraction module extracts features from the spatiotemporal map data to obtain the temporal features corresponding to the spatiotemporal map data. The spatial feature extraction module extracts features from the spatiotemporal map data to obtain the spatial features corresponding to the spatiotemporal map data. The prediction module predicts the probability distribution of the time when the package arrives at the target logistics node based on the temporal and spatial features. The prediction model in this embodiment uses a multi-task learning approach for prediction. The temporal feature extraction module focuses on extracting temporal features, while the spatial feature extraction module focuses on extracting spatial features. This allows for more accurate capture and utilization of information from different dimensions, reduces interference between features, and improves the accuracy and representativeness of feature representation. The fused features are more comprehensive, simultaneously considering the influence of time and space factors, making the prediction results more consistent with reality, thereby obtaining more accurate prediction results.
[0039] In some embodiments, the prediction model can output prediction results not only based on spatiotemporal graph data but also by combining logistics context information. Specifically, spatiotemporal graph data and logistics context information can be input into a pre-trained prediction model, enabling the model to predict the probability distribution of the time when a package arrives at the target logistics node based on the spatiotemporal graph data and logistics context information. The logistics context information includes at least one of the following: weather information, holiday information, and event information. Weather information, such as extreme weather like heavy rain or snow, can directly affect the efficiency of road and air transport, leading to package delays. Holiday information, such as during the Spring Festival, causes a surge in package volume, limiting the processing capacity of logistics nodes and potentially causing package backlogs and delays. Events, such as traffic accidents, traffic control, or logistics node failures, are highly random and can suddenly change the transportation routes and times of packages. Combining this context information with spatiotemporal graph data helps the prediction model more comprehensively capture uncertainties in the logistics process, learn the correlation between these factors and transportation time, and thus dynamically adjust the prediction results in the face of complex and ever-changing logistics environments, improving the accuracy and generalization ability of the predictions.
[0040] In step S18, the total number of packages can be sampled (e.g., randomly sampled) based on the probability distribution output by the prediction model to obtain the number of packages arriving at the target logistics node within the predicted time period. For example, assuming the total number of packages is 1000 and the probability of a package arriving at the target logistics node in the next 3 hours is 80%, then the number of packages arriving at the target logistics node in the next 3 hours can be determined to be 800.
[0041] The overall process of the embodiments of this application will be illustrated below.
[0042] Logistics forecasting drives resource optimization and cost control, avoiding idleness or shortages of key resources such as transportation capacity and manpower; it ensures operational efficiency and network resilience, guaranteeing the efficient flow of goods like a precision instrument, and is the solid foundation for fulfilling timeliness promises and improving customer experience. On the other hand, the entire express delivery network comprises many logistics links, all of which require forecasting (distribution, transportation, stations, etc.). Developing a separate forecasting model for each scenario would result in enormous software development, data, and maintenance costs. To address these issues, this application uses a forecasting scheme that models packages at a granular level. This scheme combines visual language algorithm models with spatiotemporal graph algorithm models, achieving a single algorithm framework covering multiple application scenarios. This scheme is not only highly accurate but also low-cost.
[0043] Figure 4 A schematic diagram of the system architecture according to an embodiment of this application is shown. The system architecture includes a data management module, an algorithm module, and an application module.
[0044] The data management module stores data from the logistics system, user configuration data, system input data, and product information. Data from the logistics system can include order fulfillment data and parcel handling data. Order fulfillment data primarily records the order processing from placement to confirmation, and can be measured in minutes, including order receipt, confirmation, allocation time, and status changes, used for real-time monitoring of order processing efficiency and problem identification. Parcel handling data records the actual operations of parcels at logistics nodes, summarized hourly, covering sorting, loading / unloading, and transit dwell time, used to summarize logistics node operational efficiency and assist in process optimization and bottleneck identification. User configuration data includes holiday data and promotional calendars. System input data includes weather forecasts and system anomaly events. Product information includes product descriptions (text and images), marketing data, and user behavior data (such as favorites and adding to cart).
[0045] The algorithm module can perform demand forecasting, as well as routing and lead time prediction. For example... Figure 5 As shown, the specific steps of this module are as follows: Step S22: Perform demand forecasting. The main function of demand forecasting is to predict which packages users have not yet placed orders for (i.e., virtual packages, as shown in packages A and B in the figure). This module can deploy multimodal language models, such as visual language models (VLMs), to extract features from the input product information (such as unstructured data like product image and text descriptions and product review information). For example, semantic encoding of product image and text descriptions and product review information can generate embedded vectors (i.e., the first feature). Then, automated feature engineering methods can be used to perform time-series representation of some numerical features, such as product collection and shopping cart data (i.e., the second feature). In addition, the framework also supports automated processing of calendar information features such as holidays and promotions that can be customized (i.e., the third feature). Finally, these features are summarized to predict the number of virtual packages (i.e., the first number in the aforementioned embodiment), and combined with the number of packages that have actually been generated in the logistics system (i.e., packages in transit, as shown in packages C and D in the figure) (i.e., the second number in the aforementioned embodiment), the total number of packages is predicted.
[0046] Step S24: Perform routing and timeliness prediction. Routing and timeliness prediction can use historical package trajectory information to construct spatiotemporal graph data, which serves as input for predictive models such as Spatio-Temporal Graph Neural Network (STGNN). STGNN not only aggregates node information through a spatial feature extraction module but also models the changes in features on each graph node over time using a temporal feature extraction module. Finally, it fuses spatial and temporal feature information to obtain the final prediction target. Since the spatiotemporal graph data integrates the temporal and spatial features of multiple nodes, the prediction target can simultaneously include data from one or more target nodes, i.e., the probability distribution of the time when a package arrives at a target logistics node (which may include any one or more logistics nodes that a package arrives at throughout its entire lifecycle). This framework can automatically predict and extrapolate the number of packages in the entire logistics system at regular intervals (e.g., every hour), driving resource optimization while ensuring operational efficiency. It provides the logistics industry with a one-stop end-to-end prediction solution; that is, a single prediction model can predict the probability distribution of the time when a package arrives at multiple target logistics nodes.
[0047] In addition, the prediction model can also incorporate weather forecasts, real-world emergencies, and user-configured holiday and promotional data. The overall prediction model can utilize the STGNN framework, which can simultaneously learn temporal and spatial data features. The temporal feature extraction module can employ algorithms such as GRU, TCN, and Transformer, while the spatial feature extraction module can use algorithms such as GCN and GAT. Finally, in the output section, the prediction model supports multi-task optimization. For route prediction, a sequence generation model based on a Transformer decoder can be used. For time-sensitive prediction, the model outputs a probability distribution (obtained from the final time-sensitive sample).
[0048] Step S26: After obtaining the two algorithm modules from steps S22 and S24, virtual packages can be generated. Then, the packages that have been shipped and are in transit in the current system can be obtained, and their routing and delivery time prediction can be performed. Next, based on the application scenario, the volume prediction of any caliber can be obtained by upward aggregation, such as the volume of packages to be distributed and put into storage in the future or the volume of packages to be put into storage at the site.
[0049] This application has the following technical advantages: (1) The algorithm framework of this application not only combines the visual language large model to obtain more feature inputs, but also uses the spatiotemporal graph algorithm model to learn the spatiotemporal characteristics of the logistics system.
[0050] (2) The process scheme of this application is a combination of black-box and white-box schemes. It is not only highly interpretable, but also one model can cover multiple application scenarios. There is no need to build a new algorithm model for each scenario, which reduces the development and maintenance costs of the algorithm.
[0051] This application also provides a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the methods described in any of the foregoing embodiments.
[0052] Figure 6 This illustration shows a more specific hardware structure diagram of a computer device provided in an embodiment of this application. The device may include: a processor 202, a memory 204, an input / output interface 206, a communication interface 208, and a bus 210. The processor 202, memory 204, input / output interface 206, and communication interface 208 are interconnected internally via the bus 210.
[0053] The processor 202 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The processor 202 may also include a graphics card, such as an Nvidia Titan X graphics card or a 1080Ti graphics card.
[0054] The memory 204 can be implemented in the form of read-only memory (ROM), random access memory (RAM), static storage device, dynamic storage device, etc. The memory 204 can store the operating system and other applications. When the technical solutions provided in the embodiments of this application are implemented by software or firmware, the relevant program code is stored in the memory 204 and is called and executed by the processor 202.
[0055] Input / output interface 206 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0056] The communication interface 208 is used to connect the communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, Wi-Fi, Bluetooth, etc.).
[0057] Bus 210 includes a pathway for transmitting information between various components of the device, such as processor 202, memory 204, input / output interface 206, and communication interface 208.
[0058] It should be noted that although the above-described device only shows the processor 202, memory 204, input / output interface 206, communication interface 208, and bus 210, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this application, and not necessarily all the components shown in the figures.
[0059] This application provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in any embodiment of this application.
[0060] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the methods described in any of the foregoing embodiments.
[0061] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by computer devices. As defined herein, computer-readable media does not include transient media, such as modulated data signals and carrier waves.
[0062] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. When implementing the embodiments of this application, the functions of each module can be implemented in one or more software and / or hardware. Alternatively, some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0063] The above description is merely a specific implementation of the embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles of the embodiments of this application, and these improvements and modifications should also be considered within the protection scope of the embodiments of this application.
Claims
1. A logistics prediction method, the method comprising: determining a total number of packages from a logistics starting location to a logistics destination in a to-be-predicted time period; obtaining spatio-temporal graph data, the spatio-temporal graph data comprising a plurality of data nodes and edges connecting the plurality of data nodes, the plurality of data nodes corresponding to a plurality of logistics nodes of a logistics system, the edges between data nodes representing delivery paths between the logistics nodes corresponding to the data nodes, and information of a data node comprising historical logistics time information of the logistics node corresponding to the data node, and information of an edge comprising historical logistics time information on the delivery path corresponding to the edge; inputting the spatio-temporal graph data into a pre-trained prediction model to cause the prediction model to predict a probability distribution of a time of a package arriving at a target logistics node based on the spatio-temporal graph data, the target logistics node comprising at least one logistics node on a delivery path from the logistics starting location to the logistics destination; sampling the total number based on the probability distribution to obtain a number of packages arriving at the target logistics node in the to-be-predicted time period.
2. The method of claim 1, the packages from the logistics starting location to the logistics destination comprising virtual packages and in-transit packages, the virtual packages being packages that have not been generated in the logistics system as of a current time, and the in-transit packages being packages that have been generated in the logistics system before the current time; and the determining the total number of packages from the logistics starting location to the logistics destination in the to-be-predicted time period comprising: determining a first number of the virtual packages from the logistics starting location to the logistics destination in the to-be-predicted time period and a second number of the in-transit packages from the logistics starting location to the logistics destination in the to-be-predicted time period; and determining a sum of the first number and the second number as the total number of packages from the logistics starting location to the logistics destination in the to-be-predicted time period.
3. The method of claim 2, the virtual packages being packages corresponding to a target commodity; and the determining the first number of the virtual packages in the to-be-predicted time period comprising: obtaining predicted sales information of the target commodity in the to-be-predicted time period; and determining the first number of the virtual packages in the to-be-predicted time period based on the predicted sales information.
4. The method of claim 3, the obtaining the predicted sales information of the target commodity in the to-be-predicted time period comprising: obtaining commodity information of the target commodity, the commodity information being used to represent a demand of the target commodity by a user; extracting features from the commodity information to obtain commodity features of the target commodity; determining the predicted sales information of the target commodity in the to-be-predicted time period based on the commodity features. 5.The method of claim 4, wherein the item information comprises item review information, user interaction information, and time information related to sales. The extracting features from the commodity information to obtain the commodity features of the target commodity comprising: performing semantic encoding on the commodity evaluation information to obtain first features; performing feature engineering on the user interaction information to obtain second features; and extracting features from the time information to obtain third features. The first feature, the second feature and the third feature are fused to obtain the commodity feature of the target commodity. 6.The method of claim 1, further comprising: obtaining trajectory data of historical packages in the logistics system; generating spatio-temporal graph data based on the trajectory data of the historical packages. 7.The method of claim 1, wherein the prediction model comprises a time feature extraction module, a space feature extraction module and a prediction module, the time feature extraction module is configured to extract features from the spatio-temporal graph data to obtain time features corresponding to the spatio-temporal graph data, the space feature extraction module is configured to extract features from the spatio-temporal graph data to obtain space features corresponding to the spatio-temporal graph data, and the prediction module is configured to predict a probability distribution of a time when a package arrives at a target logistics node based on the time features and the space features. 8.The method of claim 1, wherein the inputting the spatio-temporal graph data into a pre-trained prediction model to cause the prediction model to predict a probability distribution of a time when a package arrives at a target logistics node based on the spatio-temporal graph data comprises: inputting the spatio-temporal graph data and logistics context information into a pre-trained prediction model to cause the prediction model to predict a probability distribution of a time when a package arrives at a target logistics node based on the spatio-temporal graph data and the logistics context information, wherein the logistics context information comprises at least one of weather information, holiday information and emergency information. 9.A computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method of any one of claims 1 to 8. 10.A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 8 when executing the computer program. 11.A computer program product comprising a computer program, the computer program being executed by a processor to implement the method of any one of claims 1 to 8.