Logistics information prediction method, electronic device, storage medium, and program product

By using a lightweight gradient boosting machine model with caching and distributed deployment, the problem of high-concurrency, low-latency logistics information prediction for e-commerce platforms was solved, achieving efficient and accurate logistics information prediction and improving user experience.

CN122155571APending Publication Date: 2026-06-05SHANGHAI DEWU INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI DEWU INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-03-04
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing logistics information forecasting methods are insufficient to meet the high-concurrency, low-latency real-time query requirements of e-commerce platforms. In particular, due to the different logistics network structures and data openness of third-party carriers, the forecast response latency is relatively high, making it difficult to meet users' real-time query needs.

Method used

A lightweight gradient booster classification model and a lightweight gradient booster regression sub-model are adopted. The prediction of the next station information is stored through a caching middleware, and the arrival time prediction request is routed to the distributed deployment of the regression sub-model for online prediction. By combining the sharded model file and the prediction model markup language file, a hybrid offline and online prediction method is realized, which is suitable for the low latency requirements of high concurrency scenarios.

Benefits of technology

It significantly improves response efficiency, reduces single-node load, enhances service disaster recovery capabilities, meets the high-concurrency, low-latency real-time query needs of e-commerce platforms, decouples predictive capabilities from carrier data, and improves the transparency of logistics trajectories and the certainty of delivery timeliness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155571A_ABST
    Figure CN122155571A_ABST
Patent Text Reader

Abstract

The application provides a logistics information prediction method, an electronic device, a storage medium and a program product, and relates to the technical field of computers. The method can realize prediction in an offline and online mixed manner through a light gradient boosting machine classification model and a light gradient boosting machine regression sub-model, can achieve a balance between predicted response load and disaster tolerance, and can meet the real-time query requirements of high concurrency and low delay of an e-commerce platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a logistics information prediction method, electronic device, storage medium, and program product. Background Technology

[0002] In today's highly developed e-commerce era, the real-time nature and predictability of logistics information have become key factors in enhancing user experience and platform competitiveness. For e-commerce platforms, clearly communicating the next destination and estimated arrival time of packages to users can effectively manage user expectations, enhance fulfillment credibility, and thus increase user stickiness and repurchase rates. However, for many platforms that rely on third-party carriers, obtaining accurate and timely next-stop information faces significant challenges. Due to the varying logistics network structures, operational rules (such as schedules and cut-off times) and data openness of different carriers, and the dynamic changes in transportation status, only a small number of stable routes can provide reliable next-stop information feedback, leaving a significant "information blind spot" for users regarding the transportation trajectory of a large number of packages.

[0003] To fill this gap, existing technologies primarily rely on deep learning to build predictive models. Deep learning-based methods typically model next-stop prediction as a sequence classification problem and timeliness prediction as a regression problem, using models such as convolutional neural networks, recurrent neural networks, or long short-term memory networks to automatically learn spatiotemporal patterns from historical trajectory data. Theoretically, these methods can capture more complex nonlinear relationships and have a certain tolerance for data sparsity. However, their model structures are usually quite complex, leading to significant computational and memory consumption during training and inference, resulting in high prediction response latency and making it difficult to meet the high-concurrency, low-latency real-time query requirements of e-commerce platforms. Summary of the Invention

[0004] The purpose of this application is to provide a logistics information prediction method, electronic device, storage medium, and program product to solve the problem that existing prediction methods are unable to meet the real-time query requirements of e-commerce platforms with high concurrency and low latency.

[0005] In a first aspect, embodiments of this application provide a logistics information prediction method, the method comprising: In response to a next-stop prediction request for a target order, the predicted next stop for the target order is obtained from the cache middleware. The predicted next stop is predicted by a lightweight gradient booster classification model based on the incremental logistics information of the order and stored in the cache middleware. In response to a prediction request for the arrival time of the next station for the target order, the arrival time prediction request is routed to a target computing node that has deployed a corresponding lightweight gradient booster regression sub-model, and the predicted arrival time of the next station is obtained from the target computing node. The lightweight gradient booster regression sub-model is used to predict the arrival time of the next station based on the current logistics information of the target order. The output includes the predicted next station and the predicted arrival time of the predicted next station.

[0006] In the above implementation process, the lightweight gradient boosting machine classification model predicts the next stop based on incremental logistics information and stores it in a cache middleware. When users query, they can directly retrieve the results from the cache quickly, avoiding the high latency of real-time calculation and adapting to the high-concurrency request scenarios during e-commerce platform promotions, significantly improving response efficiency. In addition, arrival time prediction requests are routed to the corresponding distributed regression sub-model for online prediction, which not only further reduces the load on a single node but also enhances service disaster recovery capabilities, effectively avoiding the risk of service interruption caused by single point of failure. Therefore, the lightweight gradient boosting machine classification model and the lightweight gradient boosting machine regression sub-model can achieve a hybrid offline and online prediction method, achieving a balance between prediction response load and disaster recovery, and meeting the high-concurrency, low-latency real-time query requirements of e-commerce platforms. At the same time, the entire process does not rely on the trajectory transmission of third-party carriers, realizing the decoupling of prediction capabilities from carrier data. This allows e-commerce platforms to independently and accurately provide users and merchants with next-stop and arrival time information, improving the transparency of logistics trajectories and the certainty of fulfillment timeliness, thereby optimizing the user experience.

[0007] Optionally, multiple lightweight gradient booster regression sub-models are distributed across various computing nodes in the form of sharded model files, wherein the sharded model files are prediction model markup language files.

[0008] In the above implementation process, the lightweight gradient boosting machine regression sub-model is deployed in a distributed manner as PMML shard files. This not only leverages the cross-platform nature of PMML to achieve seamless migration of the Python-trained model to online platforms such as Java, reducing the technical threshold and compatibility risks of model deployment, but also reduces the size of individual model files through sharding design, improving the response speed of prediction calculations and adapting to the low-latency requirements of high-concurrency logistics prediction scenarios. At the same time, the distributed deployment mode achieves load balancing, avoiding the resource pressure of a single machine bearing all prediction requests, and the failure of a single computing node only affects the prediction service of the corresponding shard, without causing global service interruption, thus enhancing the disaster recovery capability and stability of the service.

[0009] Optionally, routing the arrival time prediction request to the target computation node that has deployed the corresponding lightweight gradient boosting machine regression sub-model includes: Determine the target computation node where the lightweight gradient booster regression sub-model associated with the current logistics information of the target order is located; The arrival time prediction request is routed to the target computing node.

[0010] In the above implementation process, by routing requests, it is ensured that requests can accurately match the sharded regression sub-model trained to adapt to specific logistics scenarios (such as specific regions, carriers, and transportation distance ranges), avoiding the decrease in prediction accuracy caused by invalid distribution, and reducing redundant transmission and invalid processing of requests between multiple nodes, thereby improving the prediction response speed to adapt to high concurrency requirements.

[0011] Optionally, each prediction information for the next predicted site stored in the cache middleware is configured with a dynamic expiration time, which is determined based on the distance between the current site of the target order and the predicted next site.

[0012] In the above implementation process, by setting a dynamic expiration time based on the distance between the current station of the target order and the predicted next station, it ensures that the life cycle of the predicted information in the cache is accurately matched with the actual logistics transportation cycle. In short-distance transportation scenarios, data is cleaned up in a timely manner to avoid invalid occupation of cache resources, and in long-distance transportation scenarios, sufficient time is retained to ensure the validity of queries, thus achieving efficient utilization of cache resources. At the same time, it can automatically eliminate outdated data that has been transported or has exceeded the reasonable time limit, preventing users from obtaining invalid prediction results and ensuring the timeliness and accuracy of prediction information.

[0013] Optionally, retrieving the predicted next site for the target order from the cache middleware includes: The predicted next station of the target order is obtained by querying the cache middleware based on the current logistics information of the target order. The current logistics information includes the tracking number, current station and departure time of the target order. The cache middleware stores the correspondence between each piece of logistics information and the predicted next station.

[0014] In the above implementation process, the current logistics information consisting of the tracking number, current station, and departure time of the target order is used as the query basis. Combined with the "logistics information - predicted next station" correspondence pre-stored in the cache middleware, the accurate matching of the prediction results corresponding to the target order is achieved, which effectively avoids result confusion or misquery caused by fuzzy query dimensions and ensures the accuracy of prediction information.

[0015] Optionally, the lightweight gradient booster classification model predicts the next station by: Retrieve incremental logistics information for orders within the most recent preset time period; For the incremental logistics information that has entered a certain station but has not left, multiple departure times within a preset time range are added to the logistics information to form expanded logistics information; The amplified logistics information and the unamplified incremental logistics information are input into the lightweight gradient lift classification model for prediction, so as to obtain the predicted next station for each logistics information.

[0016] In the above implementation process, by acquiring the incremental logistics information of the most recent preset time period, the timeliness of the model input data is ensured, laying the foundation for accurate prediction. For the information of incremental logistics that has entered the station but has not yet left the station, multiple preset departure times are added to form augmented data, which not only effectively makes up for the data loss caused by upstream data transmission delays or failure to promptly return departure information, but also enriches the sample dimensions of the prediction and improves the prediction accuracy.

[0017] Optionally, the lightweight gradient booster regression sub-model is trained in the following manner: Obtain historical logistics trajectory data, which includes carrier information, transit station information, and time information for each station for each order; The historical logistics trajectory data is spliced ​​together according to the current station and the arrival at the next station, and the time interval between the two stations is marked to construct the first training set; Based on the similarity between the training data in the first training set, the first training set is divided into multiple fragmented training sets. For each training set segment, a lightweight gradient booster regression model is trained to obtain the corresponding lightweight gradient booster regression sub-model.

[0018] In the above implementation process, after sharding the training data based on similarity, the data features within each shard training set are highly consistent, enabling the lightweight gradient boosting machine to accurately learn the transportation timeliness patterns in specific scenarios. This effectively avoids the pattern confusion problem caused by training with the full dataset and improves prediction accuracy. At the same time, the independent regression sub-models generated by shard training not only reduce the training cost, resource consumption, and deployment difficulty of a single model by leveraging the characteristics of the lightweight gradient boosting machine algorithm, avoiding the drawbacks of bloated and overfitting full models, but also provide flexible support for subsequent distributed deployment, allowing prediction requests to be targeted to match the corresponding scenario sub-models, further optimizing response efficiency.

[0019] Optionally, the step of dividing the first training set into multiple fragmented training sets based on the similarity between the training data in the first training set includes: Based on the similarity of the current site location of each training data in the first training set, the first training set is divided into multiple fragmented training sets.

[0020] In the above implementation process, logistics stations in the same area are highly similar in core business characteristics such as carrier schedules, cut-off times, transportation route planning, and regional transit rules. Based on this, sharding can make the data features in each shard training set highly correlated, enabling the lightweight gradient boosting regression model to accurately learn the transportation timeliness patterns of specific areas, effectively avoiding the model fitting bias caused by the mixture of logistics patterns in different areas when training with full data, and improving the accuracy of timeliness prediction.

[0021] Optionally, the step of dividing the first training set into multiple fragmented training sets based on the similarity between the training data in the first training set includes: Based on the similarity between the training data in the first training set and the size of the preset training set, the first training set is divided into multiple training sets.

[0022] In the above implementation process, a dual-dimensional partitioning is performed, combining the similarity between data within the first training set and the preset size of the training set. This ensures high consistency of training data features within each partition based on data similarity, enabling the lightweight gradient boosting regression model to accurately learn the transportation timeliness patterns under specific logistics scenarios and effectively avoid fitting bias caused by mixed patterns during full-scale data training. Furthermore, the preset partition size controls the sample size of each partition, maintaining a relatively balanced sample size across partitions. This provides good adaptability for the distributed deployment of subsequent regression sub-models, making the load on each computing node more even and preventing a single node from bearing too many prediction requests due to excessively large partition sample sizes, thereby improving the overall operational stability of the timeliness prediction service.

[0023] Optionally, the lightweight gradient boosting machine classification model is trained in the following manner: Obtain historical logistics trajectory data, which includes carrier information, transit station information, time information of each station, and delivery code information of each order; The historical logistics trajectory data is spliced ​​together according to the current station and the arrival at the next station, and the time interval between the two stations is marked to construct a second training set; The lightweight gradient booster classification model is trained using the second training set to obtain the trained lightweight gradient booster classification model.

[0024] In the above implementation process, the delivery code, a core identifier of logistics and delivery, is introduced during training. Combined with information such as carrier, transit stations, and time at each station, the feature dimensions of historical logistics trajectory data are more comprehensive and closely match the actual logistics business scenario. This can fully capture the core correlation between delivery nodes and transportation links, laying a solid data foundation for accurate model training.

[0025] Optionally, the lightweight gradient booster classification model and the lightweight gradient booster regression sub-model are LightGBM models. The lightweight gradient booster classification model is trained using a logarithmic loss function, and the lightweight gradient booster regression sub-model is trained using a quantile loss function corrected by L1 normalization.

[0026] In the above implementation process, relying on the lightweight and efficient algorithm characteristics of the LightGBM model, the efficiency of model training and inference is balanced, resource consumption is reduced, and it is adapted to the high-concurrency and low-latency requirements of logistics prediction scenarios. Among them, the lightweight gradient booster classification model is trained with a log loss function. This function is accurately adapted to the core requirements of the next-station multi-classification task, and can effectively measure the deviation between the model's predicted probability of each station category and the true label. It guides the model to efficiently learn the mapping rules between features and the next station, and improves the accuracy and confidence of the next-station classification prediction. The lightweight gradient booster regression sub-model is trained with a quantile loss function corrected by L1 normalization. The quantile loss function can accurately fit the quantile value rules of logistics transportation timeliness, adapting to the actual business situation where logistics timeliness is affected by multiple factors and has natural fluctuations. Compared with the traditional mean square error, it is more in line with the practical needs of timeliness prediction. The superimposed L1 normalization can effectively penalize the model's excessively large parameter values, suppress the model's overfitting to noisy training data, and significantly improve the generalization ability of timeliness regression prediction.

[0027] Secondly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the method provided in the first aspect above are performed.

[0028] Thirdly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method provided in the first aspect above.

[0029] Fourthly, embodiments of this application provide a computer program product, including computer program instructions, which, when read and executed by a processor, perform the steps of the method provided in the first aspect above.

[0030] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of this application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 A flowchart of a logistics information prediction method provided in this application embodiment; Figure 2 This application provides a schematic diagram of a distributed layout of a model. Figure 3 A flowchart illustrating the implementation of joint offline and online prediction is provided in this application embodiment; Figure 4 A structural block diagram of a logistics information prediction device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device for performing a logistics information prediction method, provided as an embodiment of this application. Detailed Implementation

[0033] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0034] It should be noted that the terms "system" and "network" in the embodiments of this invention can be used interchangeably. "Multiple" refers to two or more; therefore, in the embodiments of this invention, "multiple" can also be understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / ", unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0035] It should also be noted that all actions involving the acquisition of signals, information, or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located, and with the authorization granted by the owner of the relevant device.

[0036] This application provides a logistics information prediction method. This method utilizes a lightweight gradient booster classification model and a lightweight gradient booster regression sub-model to achieve a hybrid offline and online prediction approach. It balances prediction response load and disaster recovery, meeting the high-concurrency, low-latency real-time query requirements of e-commerce platforms. Furthermore, the entire process does not rely on third-party carrier tracking data, decoupling prediction capabilities from carrier data. This allows e-commerce platforms to independently and accurately provide users and merchants with next-stop and arrival time information, improving logistics tracking transparency and delivery time certainty, thereby optimizing user experience.

[0037] Please refer to Figure 1 , Figure 1 A flowchart of a logistics information prediction method provided in this application embodiment is included, the method comprising the following steps: Step S110: In response to the next station prediction request for the target order, query the cache middleware to obtain the predicted next station for the target order.

[0038] The lightweight gradient booster classification model and lightweight gradient booster regression sub-model in this solution can be implemented using the LightGBM model, or alternatively using XGBoost, CatBoost, or other similar models. This solution uses the LightGBM model as an example, which is a decision tree model optimized based on gradient boosting trees. It features fast prediction speed, low resource consumption, and mature deployment, making it suitable for high-concurrency logistics prediction scenarios.

[0039] The Lightweight Gradient Boosting Machine (LGBM) classification model is a multi-classification model trained on LightGBM. It is used to predict the next destination of an order. The predicted next destination is obtained by the Lightweight Gradient Boosting Machine classification model based on the incremental logistics information of the order and stored in the cache middleware.

[0040] The caching middleware can be a Redis server, a high-performance key-value pair caching service that supports fast data matching and storage. Redis is a caching middleware service that can quickly match the content corresponding to a request; writing the prediction results to Redis can achieve business effects similar to real-time prediction.

[0041] When a user initiates a request to predict the next destination for a target order X, the system first responds by retrieving the predicted next destination from the Redis cache using the order's tracking number as the search key. This predicted next destination is not calculated in real-time, but rather predicted by a lightweight gradient boosting machine classification model based on incremental logistics information. For example, the system automatically parses newly added logistics trajectory data every hour, predicts the next destination, and stores the key-value pair of "order logistics information - predicted next destination" in Redis.

[0042] In some implementations, the predicted next station of the target order can be obtained by querying the cache middleware based on the current logistics information of the target order. The current logistics information includes the tracking number, current station and departure time of the target order. The cache middleware stores the correspondence between each piece of logistics information and the predicted next station.

[0043] Current logistics information refers to key information that uniquely identifies the logistics status of a target order. This information may include the waybill number (a unique identifier for the parcel), the current location (the current logistics distribution center or delivery station where the parcel is located), the departure time (the time the parcel leaves the current station, including the actual departure time and a hypothetical extended departure time), carrier information, and the three-segment code on the waybill (a number on the courier's label indicating the final distribution center, delivery station, and courier; for example, 320-C673 for a certain courier, where 320 represents the prefecture-level city / final distribution center, C6 represents the delivery station, and 73 represents the courier). The current logistics information for the target order can be proactively sent to the system by the carrier, or the system can proactively obtain incremental information from standardized data interfaces provided by various carriers through polling or listening to message queues. Upon receiving the current logistics information for the target order, the system can trigger a next-station trigger request.

[0044] The system first extracts the current logistics information of the target order (such as waybill number, current station, and departure time), and uses "waybill number + current station + departure time" as the search key to perform an exact match query in the Redis caching middleware. Since the cache has already stored the correspondence between the composite key and the predicted next station, the system can quickly read the matching result and return it.

[0045] Understandably, if the predicted next station for the target order is not found in the cache middleware, the current request and subsequent arrival time prediction requests can be ignored, or the user can be informed that the next station could not be found. This might be because the lightweight gradient boosting machine classification model has not yet predicted the next station for the target order's current logistics information. The system can wait a certain period and then trigger both requests again, for example, automatically triggering a request at regular intervals, until the predicted next station for the target order is found in the cache middleware. Alternatively, it can wait for the user to manually trigger the request again later.

[0046] By using the current logistics information, consisting of the tracking number, current station, and departure time of the target order, as the query basis, and combining the "logistics information - predicted next station" correspondence pre-stored in the cache middleware, the prediction results corresponding to the target order are accurately matched, effectively avoiding result confusion or misjudgment caused by fuzzy query dimensions, and ensuring the accuracy of prediction information.

[0047] Step S120: In response to the arrival time prediction request for the next station of the target order, the arrival time prediction request is routed to the target computing node that has deployed the corresponding lightweight gradient boosting machine regression sub-model, and the predicted arrival time of the next station is obtained from the target computing node.

[0048] Understandably, the next-stop prediction request and the arrival time prediction request are linked. The user can trigger the next-stop prediction request first, and after the system responds to the request, it will automatically trigger the arrival time prediction request. Alternatively, the user can manually trigger the arrival time prediction request. If the system only receives the arrival time prediction request, it can trigger and respond to the next-stop prediction request first, and then respond to the arrival time prediction request.

[0049] The Lightweight Gradient Boosting Machine (LGBM) regression sub-model can be a regression model trained on LightGBM slices to predict the time to reach the next station. Each sub-model can be deployed on different computing nodes.

[0050] The lightweight gradient booster regression sub-model is used to predict the arrival time of the next station based on the current logistics information of the target order.

[0051] In some implementations, multiple lightweight gradient booster regression sub-models are distributed across various computing nodes in the form of sharded model files, which are prediction model markup language files.

[0052] Among them, the segmented model file is a model file obtained by splitting the full training data according to preset rules and training independently based on each segment of data. Each file only covers the prediction task of a specific data scenario.

[0053] Predictive Model Markup Language (PMML) files are a platform-independent model representation language that enables seamless migration of LightGBM models trained in Python to online platforms such as Java, ensuring cross-platform scheduling availability.

[0054] A computing node refers to a server or server cluster that deploys model shards and undertakes prediction computing tasks. Multiple computing nodes work together to form a distributed computing architecture.

[0055] The prediction system can be a distributed architecture consisting of a central control cluster and multiple computing node clusters. The central control cluster is responsible for request routing and node scheduling, while the computing node clusters are used to deploy PMML sharded models (corresponding to a lightweight gradient boosting machine regression sub-model), such as... Figure 2 As shown. For example, PMML shard 1 (corresponding to the site's location in region D1) is deployed to compute node cluster 1, PMML shard 2 (corresponding to the site's location in region D2) is deployed to compute node cluster 2, PMML shard 3 (corresponding to the site's location in region D3) is deployed to compute node cluster 3, and the remaining shards are deployed sequentially to subsequent compute node clusters, achieving a deployment mode of "one PMML shard corresponding to one compute node cluster". Of course, multiple shard model files can also be deployed in one compute node cluster. This deployment method avoids the problem of excessive load in single-machine deployment and improves disaster recovery capabilities through multi-node redundancy. If compute node cluster 2 (corresponding to the site's location in region D2) fails, only the timely prediction requests of "the current site's location in region D2" are affected, and the prediction services corresponding to other regions are not affected, thus not causing a global service interruption.

[0056] After receiving an arrival time prediction request, the system can route the request to the corresponding target computing node. Once the target computing node receives the arrival time prediction request, it can use the lightweight gradient boosting machine regression sub-model deployed therein to predict the arrival time of the next station based on the current logistics information of the target order.

[0057] Specifically, the central control cluster can first determine the target computing node where the lightweight gradient boosting machine regression sub-model associated with the current logistics information of the target order is located, and then route the arrival time prediction request to that target computing node.

[0058] The target computing node refers to a server or server cluster that has deployed LightGBM regression sub-model shards associated with "predicting the next site". Multiple computing nodes work together through a distributed architecture.

[0059] Before receiving a request for arrival time prediction for a target order, the system has already retrieved the predicted next station for the target order from the cache middleware. The system can then extract key correlation features from the target order's current logistics information, including the city where the current station is located (this feature is the basis for sharding the LightGBM regression sub-model). For example, if the target order's current station is distribution center A, and its city is Shanghai, then the corresponding LightGBM regression sub-model sharding is the "Shanghai sharding." This sharding model can be trained and generated based on all historical transportation trajectory data with Shanghai as the current station, specifically adapted to the timeliness prediction scenario for shipments from Shanghai to various next stations.

[0060] The central control cluster pre-stores mapping relationships such as "sharding basis (city where the current station is located) - compute node" or "sharding basis - regression sub-model - compute node" and "sharding basis - regression sub-model, regression sub-model - compute node" (e.g., Shanghai sharding corresponds to compute node 1, Hangzhou sharding corresponds to compute node 2, etc.). By querying this mapping relationship, the target compute node associated with "Shanghai sharding" is determined to be node 1 (this cluster has already deployed the PMML model file corresponding to Shanghai sharding). Subsequently, the central control cluster routes the arrival time prediction request to compute node 1, ensuring that the request accurately matches the corresponding regression sub-model sharding. After receiving the request, compute node 1 extracts the current logistics features of the target order (including carrier, carrier product, departure time from the current station, current station province / city, predicted next station, etc.) and inputs these features into the Shanghai sharding PMML regression sub-model deployed on this node.

[0061] This sub-model uses historical transportation time data from "Shanghai area station to distribution center A" (such as the average time for this product from this carrier on this route over the past 30 days, and the time fluctuation range during the departure period) and combines it with the current logistics characteristics of the input to make predictions and output the predicted arrival time. Finally, the target computing node returns the predicted arrival time to the requesting end, completing the entire routing and processing flow.

[0062] Step S130: Output a response result including the predicted next station and the predicted arrival time of the predicted next station.

[0063] After receiving the predicted arrival time returned by the target computing node, the system integrates the predicted next station (such as distribution center B) queried in step S110 and the predicted arrival time (such as T1 point) obtained in step S120 to generate a standardized response result, such as "Your order (X) next station is distribution center B, and the estimated arrival time is today at T1 time". The system then outputs the result to the user query interface (such as the logistics details page of an e-commerce platform) or downstream related systems to complete the entire logistics information prediction response process.

[0064] In the above implementation process, the lightweight gradient boosting machine classification model predicts the next stop based on incremental logistics information and stores it in a cache middleware. When users query, they can directly retrieve the results from the cache quickly, avoiding the high latency of real-time calculation and adapting to the high-concurrency request scenarios during e-commerce platform promotions, significantly improving response efficiency. In addition, arrival time prediction requests are routed to the corresponding distributed regression sub-model for online prediction, which not only further reduces the load on a single node but also enhances service disaster recovery capabilities, effectively avoiding the risk of service interruption caused by single point of failure. Therefore, the lightweight gradient boosting machine classification model and the lightweight gradient boosting machine regression sub-model can achieve a hybrid offline and online prediction method, achieving a balance between prediction response load and disaster recovery, and meeting the high-concurrency, low-latency real-time query requirements of e-commerce platforms. At the same time, the entire process does not rely on the trajectory transmission of third-party carriers, realizing the decoupling of prediction capabilities from carrier data. This allows e-commerce platforms to independently and accurately provide users and merchants with next-stop and arrival time information, improving the transparency of logistics trajectories and the certainty of fulfillment timeliness, thereby optimizing the user experience.

[0065] Based on the above embodiments, the lightweight gradient booster classification model in this solution is implemented using an offline prediction method. The method for predicting the next station includes: obtaining incremental logistics information of orders within the most recent preset time point; for logistics information that has entered a certain station but has not left, adding multiple departure times within a preset time range to the logistics information to form augmented logistics information; and then inputting the augmented logistics information and the unaugmented incremental logistics information into the lightweight gradient booster classification model for prediction to obtain the predicted next station corresponding to each logistics information.

[0066] Offline forecasting refers to processing and predicting logistics data in advance, without relying on real-time user requests to trigger calculations. The forecast results are stored in advance to support subsequent quick queries.

[0067] Incremental logistics information refers to the newly added logistics trajectory data within the most recent preset time period (such as every hour), which includes key information such as the order's waybill number, carrier information, current station, time of entry into the current station, buyer's address, and three-segment code.

[0068] First, set the most recent preset time period to 1 hour (i.e., synchronizing new logistics tracks once per hour). The preset time range is 1-3 hours after the current time, and the departure time interval is 1 hour (e.g., if the current time is 10:00, assume the departure time is 11:00, 12:00, or 13:00). This ensures that the assumed times conform to the carrier's daily business and shift schedule, avoiding exceeding reasonable transportation scenarios. It should be understood that the most recent preset time period can be adjusted according to the actual data flow rate and business needs.

[0069] The system then initiates an incremental logistics information acquisition process, extracting newly generated logistics data from the logistics trajectory database within the past hour. This data includes the waybill number for each order, the carrier and its products, the current station name and corresponding province / city, the time of entry into the current station, the buyer's address province / city, and the original waybill three-segment code. The system then filters this data, separating trajectories that "have entered a station but have not left the station" (i.e., trajectories that have only completed inbound scanning and have not generated outbound scanning records, which can be called first logistics information) and trajectories that "have left the current station" (with actual outbound time, which do not require amplification and can be called second logistics information).

[0070] For the initial logistics information, the system performs augmentation processing: for each such trajectory, multiple hypothetical departure times are added within a preset time range, generating multiple augmented logistics information entries. For example, for an order with waybill number X1, carrier 'a', current station 'A', entry time '10:00' (not yet departed), and the original three-segment code 320-C673 aggregated to distribution station C6 in zone B, and the buyer's address city 'C', then three hypothetical departure times of 11:00, 12:00, and 13:00 are added, generating three augmented logistics information entries. Each entry retains the core features of the original trajectory, such as the carrier, the aggregated three-segment code, the current station, and the buyer's address, only updating the "hour of departure from the current station" feature (11:00, 12:00, and 13:00 respectively). The "week of departure from the current station" feature remains unchanged because it does not cross days (e.g., all are Mondays).

[0071] The system then integrates all augmented logistics information with unaugmented incremental logistics information (i.e., trajectory data that has left the current station and has a real departure time, i.e., the second logistics information mentioned above) to form a complete predictive input dataset, ensuring that no valid logistics trajectories within the current time period are missed.

[0072] Next, the integrated dataset is input into a pre-trained lightweight gradient boosting machine classification model for offline prediction. This model has been trained based on historical logistics data and, by reconstructing the carrier's logistics network, can accurately identify the next-stop patterns corresponding to different feature combinations.

[0073] Finally, after the prediction is completed, the system associates each piece of logistics information (including augmented and unaugmented items) with the corresponding predicted next station. The association key is set as "waybill number + current station + departure time (actual departure time or assumed departure time)". This association is then written in batches to the Redis cache middleware. The overall implementation process can be described as follows: Figure 3 As shown.

[0074] When querying the predicted next station in the Redis caching middleware, if the actual departure time has not been generated (e.g., the package has not yet left the current station), the predicted next station can still be obtained by querying the search key corresponding to the assumed extended departure time. This achieves low-latency response and avoids service unavailability issues caused by missing real-time data.

[0075] Understandably, the lightweight gradient booster classification model can also make predictions based on the incremental logistics information of orders within the most recent preset time period, and this approach does not require data augmentation.

[0076] In the above implementation process, by acquiring the incremental logistics information of the most recent preset time period, the timeliness of the model input data is ensured, laying the foundation for accurate prediction. For the information of incremental logistics that has entered the station but has not yet left the station, multiple preset departure times are added to form augmented data, which not only effectively makes up for the data loss caused by upstream data transmission delays or failure to promptly return departure information, but also enriches the sample dimensions of the prediction and improves the prediction accuracy.

[0077] Based on the above embodiments, considering that Redis service is a caching service and is not suitable for carrying the full amount of data, each prediction information for the next site stored in the caching middleware is configured with a dynamic expiration time, which is determined based on the distance between the current site of the target order and the predicted next site.

[0078] After the lightweight gradient booster classification model completes offline prediction, the system will trigger a dynamic expiration time calculation process for each prediction information (i.e., the associated data of "waybill number + current station + departure time - predicted next station").

[0079] Specifically, the system extracts the precise geographical coordinates (latitude and longitude) of the current station and the predicted next station of the target order from the logistics station geographic information database, and calculates the actual transportation distance between the two stations based on the transportation route distance calculation rules commonly used in the logistics industry (prioritizing matching the actual transportation route of the carrier, rather than the straight-line distance, to ensure distance accuracy).

[0080] Next, the basic expiration days are derived according to the preset calculation rules. For example, the result of "transportation distance between two stations ÷ N" (unit: km / day) is rounded down, where N can be 720. The value of 720 km / day is based on the assumption of the minimum daily mileage of express delivery. If the transportation is 30 km per hour and calculated in 24 hours a day, 30 × 24 = 720 km. This value is in line with the normal transportation efficiency of the logistics industry, ensuring that the expiration time matches the actual transportation cycle.

[0081] Subsequently, the following constraints are applied to the expiration days: To avoid the prediction results becoming invalid prematurely due to an excessively small basic expiration period (e.g., the cache is cleared before short-distance transportation is completed), or to avoid invalid data occupying cache resources due to an excessively large basic expiration period (e.g., data remains after long-distance transportation is completed), the minimum basic expiration period is set to N1 days (e.g., 1 day) and the maximum to N2 days (e.g., 4 days). That is, when the basic expiration period is less than N1, it is automatically set to N1 days; when the basic expiration period is greater than N2, it is automatically set to N2 days; when the basic expiration period is within the range of N1-N2 days, the basic expiration period is directly used.

[0082] For example, if the distance between two stations is 170 kilometers, the basic expiration days are 0, which are corrected to 1 day according to the rules; if the distance between two stations is 2100 kilometers, the basic expiration days are 2, which are directly set to 2 days.

[0083] Finally, the system binds the calculated and corrected dynamic expiration time with the corresponding prediction information and writes it together into the Redis cache middleware. Redis manages the data lifecycle according to the set expiration time. When data reaches its expiration time, it automatically triggers a cleanup mechanism to delete it from the cache, preventing invalid data from occupying storage resources for a long time. Through this process, it ensures that cached data is available during the order transportation cycle (meeting user query needs) and can promptly clean up invalid data that has been transported or has exceeded the reasonable transportation cycle, achieving efficient utilization of cache storage resources.

[0084] In the above implementation process, by setting a dynamic expiration time based on the distance between the current station of the target order and the predicted next station, it ensures that the life cycle of the predicted information in the cache is accurately matched with the actual logistics transportation cycle. In short-distance transportation scenarios, data is cleaned up in a timely manner to avoid invalid occupation of cache resources, and in long-distance transportation scenarios, sufficient time is retained to ensure the validity of queries, thus achieving efficient utilization of cache resources. At the same time, it can automatically eliminate outdated data that has been transported or has exceeded the reasonable time limit, preventing users from obtaining invalid prediction results and ensuring the timeliness and accuracy of prediction information.

[0085] The training process for the two models will be described below.

[0086] 1. The lightweight gradient boosting machine regression sub-model is trained in the following way: Historical logistics trajectory data is acquired, including carrier information, transit station information, and time information for each order. The historical logistics trajectory data is then concatenated according to the current station and the next station, and the time interval between the two stations is marked to construct the first training set. Based on the similarity between the training data in the first training set, the first training set is divided into multiple fragmented training sets. Then, a lightweight gradient booster regression model is trained for each fragmented training set to obtain the corresponding lightweight gradient booster regression sub-model.

[0087] Historical logistics trajectory data refers to the complete logistics records of all orders within a past period (such as the last 3 months), including key data such as carrier information, carrier products (such as standard express and special offer), information on stations along the route (name of each station and its province and city), and time information (time of arrival at each station and time of departure from each station).

[0088] The system can extract nearly three months of historical data from the logistics trajectory database, covering key information of a massive number of orders.

[0089] The first training set is a dataset formed by concatenating historical logistics trajectory data according to the "current station - next station" logic and labeling the transportation time interval between two stations. The fitting target is the transportation time between two stations. For each extracted historical logistics trajectory, data is concatenated according to the "current station - arrival at next station" logic. That is, each continuous two-station transportation process corresponds to one training sample, and the time interval between the two stations is calculated as the fitting target (transportation time). Specifically, the features of the training samples include: carrier, carrier product (e.g., standard express), current station name, province and city of the current station, weekday of departure from the current station (e.g., Monday), hour of departure from the current station (e.g., 10:00), next station name, and province and city of the next station; the fitting target is "arrival time at next station - departure time from current station". All concatenated samples are integrated to form the first training set containing a large amount of data. The weekday of departure and hour of departure from the current station are considered here to perceive the carrier's schedule, cut-off time, etc., which may reflect the different routes taken by the carrier during different time periods.

[0090] The training set is a sharded dataset formed by splitting the full dataset into multiple subsets based on the similarity of the training data in the first training set. Each subset contains data with high feature similarity and can be used to train the model independently.

[0091] In some implementations, the first training set can be segmented based on the similarity of the current station location of each training data point, resulting in multiple segmented training sets. Segmentation based on this principle ensures strong correlation of data features within each segmented training set, enabling the lightweight gradient boosting regression model to accurately learn the transportation timeliness patterns of specific regions. This effectively avoids model fitting bias caused by the mixing of logistics patterns from different regions during full-scale data training, thus improving the accuracy of timeliness prediction.

[0092] The similarity of data is determined by the "region (e.g., city) where the current station is located," because logistics stations in the same city have high consistency in carrier schedules, order cut-off times, and route selection, resulting in higher data feature similarity. First, each sample in the first training set is traversed, and it is assigned to the corresponding partition based on the "city where the current station is located." For example, all samples with the current station in city A are assigned to "partition A," and samples with the current station in city B are assigned to "partition B."

[0093] In some other implementations, other data dimensions can also be used as the basis for similarity, such as "carrier + carrier products", the administrative region / logistics network partition of the next station, the time period characteristics of leaving the current station, or the "transportation distance range between the current station and the next station".

[0094] In some other implementations, the first training set can be sharded using a clustering algorithm, which aggregates training data with high similarity into a single training set.

[0095] In some implementations, when splitting the first training set, the split size can also be considered. That is, the first training set is split according to the similarity between the training data in the first training set and the preset size of the split training set to obtain multiple split training sets.

[0096] The preset size of the training set is the maximum number of samples allowed in a single shard. It can be determined by considering the training efficiency of LightGBM, the size limit of PMML files, and the computing power of the computing nodes, such as setting it to 100,000 samples per shard. Understandably, the preset size of the training set can be a range, not a specific value, such as 80,000-100,000 samples per shard.

[0097] When performing sharding using a clustering algorithm, the entire set of samples is first initially clustered based on the selected similarity dimension to obtain initial cluster groups. Then, the initial cluster groups are split or merged according to the size of the preset sharding training set. The core rule is: if the sample size exceeds the preset sharding training set size, the samples are subdivided; if the sample size is too small, they are merged, and the sample similarity is maintained after subdivision or merging.

[0098] For example, the first training set Perform fragmentation, define For the first Each segment, The size of the training set. The size of the training set for each slice. The amount of data in Cannot exceed ,Right now Number of generated shards The theoretical value is:

[0099] It's important to note that LightGBM sharding aims to prevent excessively deep models trained on the full dataset from generating excessively large PMML files, leading to high latency during downstream consumption. Simultaneously, more shards may result in a loss in overall model performance. Therefore, this approach requires a trade-off between latency and accuracy when sharding. Furthermore, sharding does not involve random data extraction; rather, it prioritizes grouping similar data into the same shard according to a specific rule, such as similarity clustering or using the city where the current site is located as the basis for sharding.

[0100] Finally, all split / merged shards are validated: on the one hand, to confirm the consistency of core features of samples within each shard, avoiding feature mixing that could lead to model learning bias; on the other hand, to confirm that the number of samples in all shards is within a reasonable range of 80,000 to 100,000. After validation, a unique identifier is generated for each shard and stored separately for later retrieval for model training.

[0101] By combining the similarity between data within the first training set and the preset size of the training set shards, a dual-dimensional partitioning is achieved. This approach ensures high consistency of training data features across shards based on data similarity, enabling the lightweight gradient boosting regression model to accurately learn the transportation timeliness patterns in specific logistics scenarios and effectively avoid fitting bias caused by mixed patterns during full-scale data training. Furthermore, the preset shard size controls the sample size of each shard, maintaining a relatively balanced sample size across shards. This provides good adaptability for the distributed deployment of subsequent regression sub-models, evens out the load on each computing node, and prevents a single node from handling too many prediction requests due to excessively large shard sample sizes, thereby improving the overall operational stability of the timeliness prediction service.

[0102] Subsequently, a lightweight gradient boosting machine regression model is trained for each shard training set. Taking "Shard A" as an example, based on the training samples within this shard, the LightGBM training framework is input, and the model learns the mapping relationship between features such as carrier, departure time, and next-stop province / city and transportation time through iterative optimization of the gradient boosting tree. After training, the model corresponding to this shard is exported as a PMML file (e.g., "Shard A-PMML.model") to ensure that the model can be migrated across platforms to the online Java environment. Similarly, the training sets of other shards such as "Shard B" and "Shard C" are trained independently, ultimately resulting in multiple corresponding lightweight gradient boosting machine regression sub-models. Each sub-model is only suitable for logistics timeliness prediction from a specific city, which ensures prediction accuracy while reducing the resource consumption and prediction latency of a single model.

[0103] In the above implementation process, after sharding the training data based on similarity, the data features within each shard training set are highly consistent, enabling the lightweight gradient boosting machine to accurately learn the transportation timeliness patterns in specific scenarios. This effectively avoids the pattern confusion problem caused by training with the full dataset and improves prediction accuracy. At the same time, the independent regression sub-models generated by shard training not only reduce the training cost, resource consumption, and deployment difficulty of a single model by leveraging the characteristics of the lightweight gradient boosting machine algorithm, avoiding the drawbacks of bloated and overfitting full models, but also provide flexible support for subsequent distributed deployment, allowing prediction requests to be targeted to match the corresponding scenario sub-models, further optimizing response efficiency.

[0104] 2. The lightweight gradient boosting machine classification model is trained in the following way: Historical logistics trajectory data is obtained, including carrier information, transit station information, time information of each station, and delivery code information for each order. Then, the historical logistics trajectory data is concatenated according to the current station and the next station, and the time interval between the two stations is marked to construct a second training set. The lightweight gradient booster classification model is trained using the second training set to obtain the trained lightweight gradient booster classification model.

[0105] Historical logistics trajectory data refers to the complete order logistics records over a past period (such as the last 6 months), including carrier information, transit station information (name of each station, province and city, station level such as hub distribution center / city distribution station), time information of each station (precise time of arrival / departure from the station), and delivery code information (i.e., the three-segment code of the waybill, such as 320-C673, where 320 represents the last-level distribution center, C6 represents the delivery station, and 73 represents the courier, which is the core identifier of the delivery node).

[0106] For example, the system can extract nearly 6 months of historical data from the logistics trajectory database, covering orders from different carriers, different transportation routes, and different time periods, ensuring the comprehensiveness and representativeness of the data.

[0107] Then, each historical logistics trajectory is segmented into "current station - next station" segments, with each consecutive two-station transportation process corresponding to a classification training sample. Subsequently, the core features of each sample are extracted, including basic identifier features (carrier, delivery code), station features (current station name, province / city of the current station, current station level), and time features (week of departure from the current station, hour of departure from the current station, time interval between the two stations). The "next station name" is used as the fitting target (classification label). After completing the sample segmentation of all orders, the second training set can be preprocessed: missing values ​​are filled (e.g., missing departure hours are filled with the average departure hours of the same route), discrete features such as "carrier" and "station name" are categorically encoded, and continuous features such as "departure hour" and "time interval" are normalized to ensure the data meets the training requirements of the LightGBM model.

[0108] The inclusion of delivery code information helps the LightGBM model accurately predict the next stop when the buyer's address is nearby. Since different carriers use different methods to represent their three-segment codes, their aggregation methods also vary. This solution uses delivery stations as the clustering method; that is, the delivery code information in the second training set only needs to reflect the delivery station, and other information is not required.

[0109] The LightGBM model can then be trained using the second training set to obtain the trained lightweight gradient booster classification model.

[0110] The lightweight gradient boosting machine classification model trained does not generate PMML files for downstream applications. This is because, unlike regression problems, the number of leaf nodes in multi-class classification problems largely depends on the number of labels in the training set. Therefore, its model structure is typically more complex and deeper than that of regression problems. This also means that multi-class classification has limitations for high latency requirements in online environments. Therefore, this model can be deployed to designated computing nodes for subsequent offline prediction.

[0111] In some implementations, the second training set can be partitioned according to similarity (the partitioning method can be similar to that of the first training set), and then multiple lightweight gradient boosting machine classification models can be trained. These multiple classification models can be deployed on multiple computing nodes. Alternatively, a single trained lightweight gradient boosting machine classification model can be deployed on multiple computing nodes. If a computing node fails, the prediction service on the remaining computing nodes can still be used, demonstrating high tolerance for unexpected situations and good disaster recovery capabilities.

[0112] In the above implementation process, the delivery code, a core identifier of logistics and delivery, is introduced during training. Combined with information such as carrier, transit stations, and time at each station, the feature dimensions of historical logistics trajectory data are more comprehensive and closely match the actual logistics business scenario. This can fully capture the core correlation between delivery nodes and transportation links, laying a solid data foundation for accurate model training.

[0113] Based on the above embodiments, the Lightweight Gradient Boosting Machine (LGBM) classification model and the Lightweight Gradient Boosting Machine (LGBM) regression sub-model are LightGBM models. During the training process, the Lightweight Gradient Boosting Machine (LGBM) classification model is trained using the logarithmic loss function, and the Lightweight Gradient Boosting Machine (LGBM) regression sub-model is trained using the quantile loss function modified by L1 normalization.

[0114] The LightGBM model is a distributed gradient boosting framework based on gradient boosting decision trees. It features fast training speed, low memory usage, and adaptability to large-scale data, and can be flexibly adapted to both classification and regression tasks.

[0115] Log loss, also known as log likelihood loss, is the core loss function for multi-class classification tasks. It measures the deviation between the class probability predicted by the model and the true label (the smaller the value, the smaller the deviation), guiding the model to learn the mapping relationship between features and classification targets.

[0116] During the training of a lightweight gradient booster classification model, the log loss function calculates the deviation between the model's predicted probabilities and the true labels in each iteration: the log loss function is expressed by the formula... Calculate the loss value (where This serves as an indicator of whether sample i belongs to category k. The model predicts the probability that sample i belongs to class k. The LightGBM framework iteratively optimizes the split nodes of the decision tree based on the negative gradient of this loss value, updating the model parameters in each iteration and reducing the log loss value.

[0117] During training, the multi-class log loss on the validation set is monitored in real time. Training is stopped when the validation set loss does not decrease for 50 consecutive rounds to avoid overfitting. For example, after 800 rounds of training, if the validation set log loss decreases from the initial 3.2 to 0.35 and the multi-class accuracy on the test set reaches 96%, the model is considered successfully trained. If this is not achieved, the learning rate is adjusted (e.g., reduced to 0.05) and retraining is performed until the log loss and accuracy meet the requirements of the logistics scenario (log loss ≤ 0.4, accuracy ≥ 95%).

[0118] Quantile loss is a loss function used in regression tasks. Unlike mean squared error (MSE), which only fits the mean, quantile loss can accurately predict a specific quantile (such as the median or 90th quantile) of the target value, making it suitable for logistics timeliness scenarios that "fluctuate but need to cover different probability scenarios." L1 normalization correction refers to adding an L1 regularization term to the quantile loss function. By penalizing the absolute value of the model parameters, it limits the parameter size and avoids the model overfitting to noisy training data. In logistics timeliness prediction, the distribution of transportation time often has a long tail (abnormal delays in some orders). Using quantiles instead of the mean as the prediction target can effectively reduce the impact of extreme outliers, making the prediction results more robust and better reflecting the "typical" transportation time of most orders.

[0119] During the training of the Lightweight Gradient Boosting Machine (LGBM) regression sub-model, the core parameters of LightGBM regression are first configured: objective='quantile' (quantile regression task), alpha=0.5 (fitting median, i.e., the 50th quantile, a core reference value for logistics timeliness), metric='quantile' (quantile loss as the evaluation metric), and an L1 normalization correction term lambda_l1 = 0.1 (L1 regularization) is introduced. Simultaneously, learning_rate=0.08 and n_estimators=1200 are set. The formula for the L1 normalized quantile loss function is as follows: (in The core term for quantile loss, For the actual time spent, For model prediction time, The L1 regularization coefficients are... (For model parameters).

[0120] The LightGBM framework optimizes the decision tree based on this loss value, prioritizing the splitting of core features affecting time consumption, such as "departure hour = 10 o'clock" and "carrier product = standard express". The loss value is reduced with each iteration, while the L1 regularization term penalizes excessively large parameter values ​​to prevent the model from remembering outliers in the training set (e.g., if a sample takes 10 hours due to extreme weather, L1 regularization prevents the model from overfitting to this outlier). The above training process is executed independently for each training set segment. For example, when the "Shanghai segment" is trained for 1000 rounds, the validation set quantile loss decreases from the initial 1.2 to 0.28, and the mean absolute error of the time consumption prediction on the test set is ≤0.3 hours, meeting the accuracy requirements for logistics timeliness prediction. This finally generates the regression sub-model corresponding to this segment. The remaining segments are trained using the same logic, resulting in multiple regression sub-models adapted to different scenarios.

[0121] In the above implementation process, relying on the lightweight and efficient algorithm characteristics of the LightGBM model, the efficiency of model training and inference is balanced, resource consumption is reduced, and it is adapted to the high-concurrency and low-latency requirements of logistics prediction scenarios. Among them, the lightweight gradient booster classification model is trained with a log loss function. This function is accurately adapted to the core requirements of the next-station multi-classification task, and can effectively measure the deviation between the model's predicted probability of each station category and the true label. It guides the model to efficiently learn the mapping rules between features and the next station, and improves the accuracy and confidence of the next-station classification prediction. The lightweight gradient booster regression sub-model is trained with a quantile loss function corrected by L1 normalization. The quantile loss function can accurately fit the quantile value rules of logistics transportation timeliness, adapting to the actual business situation where logistics timeliness is affected by multiple factors and has natural fluctuations. Compared with the traditional mean square error, it is more in line with the practical needs of timeliness prediction. The superimposed L1 normalization can effectively penalize the model's excessively large parameter values, suppress the model's overfitting to noisy training data, and significantly improve the generalization ability of timeliness regression prediction.

[0122] Please refer to Figure 4 , Figure 4 This is a structural block diagram of a logistics information prediction device 200 provided in an embodiment of this application. The device 200 may be a module, program segment, or code on an electronic device. It should be understood that the device 200 corresponds to the above method embodiment and is capable of performing the various steps involved in the method embodiment. The specific functions of the device 200 can be found in the description above. To avoid repetition, detailed descriptions are appropriately omitted here.

[0123] Optionally, the device 200 includes: The first prediction module 210 is used to respond to a next-stop prediction request for a target order by querying the cache middleware to obtain the predicted next stop of the target order. The predicted next stop is predicted by a lightweight gradient booster classification model based on the incremental logistics information of the order and stored in the cache middleware. The second prediction module 220 is used to respond to the arrival time prediction request of the next station for the target order, route the arrival time prediction request to the target computing node that has deployed the corresponding lightweight gradient booster regression sub-model, and obtain the predicted arrival time of the next station returned by the target computing node. The lightweight gradient booster regression sub-model is used to predict the arrival time of the next station based on the current logistics information of the target order. The result output module 230 is used to output a response result including the predicted next station and the predicted arrival time of the predicted next station.

[0124] Optionally, multiple lightweight gradient booster regression sub-models are distributed across various computing nodes in the form of sharded model files, wherein the sharded model files are prediction model markup language files.

[0125] Optionally, the second prediction module 220 is used to determine the target computing node where the lightweight gradient booster regression sub-model associated with the current logistics information of the target order is located; and to route the arrival time prediction request to the target computing node.

[0126] Optionally, each prediction information for the next predicted site stored in the cache middleware is configured with a dynamic expiration time, which is determined based on the distance between the current site of the target order and the predicted next site.

[0127] Optionally, the first prediction module 210 is used to query the cache middleware to obtain the predicted next station of the target order based on the current logistics information of the target order. The current logistics information includes the waybill number, current station and departure time of the target order. The cache middleware stores the correspondence between each piece of logistics information and the predicted next station.

[0128] Optionally, the first prediction module 210 is used to obtain incremental logistics information of orders within the most recent preset time period; for logistics information that has entered a certain station but has not left, multiple departure times within a preset time range are added to the logistics information to form expanded logistics information; the expanded logistics information and the unexpanded incremental logistics information are input into the lightweight gradient booster classification model for prediction to obtain the predicted next station for each logistics information.

[0129] Optionally, the device 200 further includes: The first training module is used to acquire historical logistics trajectory data, which includes carrier information, transit station information, and time information of each station for each order; the historical logistics trajectory data is concatenated according to the current station and the arrival at the next station, and the time interval between the two stations is marked to construct a first training set; the first training set is divided into multiple fragmented training sets according to the similarity between the training data in the first training set; a lightweight gradient booster regression model is trained for each fragmented training set to obtain the corresponding lightweight gradient booster regression sub-model.

[0130] Optionally, the first training module is used to divide the first training set into multiple fragmented training sets based on the similarity of the current site location of each training data in the first training set.

[0131] Optionally, the first training module is used to divide the first training set into multiple fragmented training sets based on the similarity between the training data in the first training set and the size of a preset fragmented training set.

[0132] Optionally, the device 200 further includes: The second training module is used to acquire historical logistics trajectory data, which includes carrier information, transit station information, time information of each station, and delivery code information of each order. The historical logistics trajectory data is concatenated according to the current station and the arrival at the next station, and the time interval between the two stations is marked to construct a second training set. The lightweight gradient booster classification model is trained using the second training set to obtain the trained lightweight gradient booster classification model.

[0133] Optionally, the lightweight gradient booster classification model and the lightweight gradient booster regression sub-model are LightGBM models. The lightweight gradient booster classification model is trained using a logarithmic loss function, and the lightweight gradient booster regression sub-model is trained using a quantile loss function corrected by L1 normalization.

[0134] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0135] Please refer to Figure 5 , Figure 5 This is a schematic diagram of an electronic device for performing a logistics information prediction method, provided in an embodiment of this application. The electronic device may include: at least one processor 310, such as a CPU; at least one communication interface 320; at least one memory 330; and at least one communication bus 340. The communication bus 340 is used to establish communication between these components. In this embodiment, the communication interface 320 is used for signaling or data communication with other node devices. The memory 330 may be a high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 330 may also be at least one storage device located remotely from the aforementioned processor. The memory 330 stores computer-readable instructions, which, when executed by the processor 310, cause the electronic device to perform the aforementioned method process.

[0136] Understandable. Figure 5 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 5The more or fewer components shown, or having the same Figure 5 The different configurations shown. Figure 5 The components shown can be implemented using hardware, software, or a combination thereof.

[0137] This application provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it performs the method process executed by the electronic device in the above method embodiments.

[0138] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the methods provided in the above-described method embodiments, such as including: In response to a next-stop prediction request for a target order, the predicted next stop for the target order is obtained from the cache middleware. The predicted next stop is predicted by a lightweight gradient booster classification model based on the incremental logistics information of the order and stored in the cache middleware. In response to a prediction request for the arrival time of the next station for the target order, the arrival time prediction request is routed to a target computing node that has deployed a corresponding lightweight gradient booster regression sub-model, and the predicted arrival time of the next station is obtained from the target computing node. The lightweight gradient booster regression sub-model is used to predict the arrival time of the next station based on the current logistics information of the target order. The output includes the predicted next station and the predicted arrival time of the predicted next station.

[0139] In summary, the logistics information prediction method, electronic device, storage medium, and program product provided in this application embodiment can achieve prediction in a hybrid offline and online manner through a lightweight gradient booster classification model and a lightweight gradient booster regression sub-model. It can achieve a balance between prediction response load and disaster recovery, and can meet the real-time query requirements of e-commerce platforms with high concurrency and low latency.

[0140] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0141] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0142] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0143] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0144] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A logistics information forecasting method, characterized in that, The method includes: In response to a next-stop prediction request for a target order, the predicted next stop for the target order is obtained from the cache middleware. The predicted next stop is predicted by a lightweight gradient booster classification model based on the incremental logistics information of the order and stored in the cache middleware. In response to a prediction request for the arrival time of the next station for the target order, the arrival time prediction request is routed to a target computing node that has deployed a corresponding lightweight gradient booster regression sub-model, and the predicted arrival time of the next station is obtained from the target computing node. The lightweight gradient booster regression sub-model is used to predict the arrival time of the next station based on the current logistics information of the target order. The output includes the predicted next station and the predicted arrival time of the predicted next station.

2. The method according to claim 1, characterized in that, Multiple lightweight gradient booster regression sub-models are distributed across various computing nodes in the form of sharded model files, which are prediction model markup language files.

3. The method according to claim 2, characterized in that, The step of routing the arrival time prediction request to the target computation node that has deployed the corresponding lightweight gradient boosting machine regression sub-model includes: Determine the target computation node where the lightweight gradient booster regression sub-model associated with the current logistics information of the target order is located; The arrival time prediction request is routed to the target computing node.

4. The method according to claim 1, characterized in that, Each prediction information for the next predicted site stored in the cache middleware is configured with a dynamic expiration time, which is determined based on the distance between the current site of the target order and the predicted next site.

5. The method according to claim 1, characterized in that, The step of retrieving the predicted next site for the target order from the cache middleware includes: The predicted next station of the target order is obtained by querying the cache middleware based on the current logistics information of the target order. The current logistics information includes the tracking number, current station and departure time of the target order. The cache middleware stores the correspondence between each piece of logistics information and the predicted next station.

6. The method according to claim 5, characterized in that, The lightweight gradient booster classification model predicts the next station in the following way: Retrieve incremental logistics information for orders within the most recent preset time period; For the incremental logistics information that has entered a certain station but has not left, multiple departure times within a preset time range are added to the logistics information to form expanded logistics information; The amplified logistics information and the unamplified incremental logistics information are input into the lightweight gradient lift classification model for prediction, so as to obtain the predicted next station for each logistics information.

7. The method according to claim 1, characterized in that, The lightweight gradient booster regression sub-model is trained in the following manner: Obtain historical logistics trajectory data, which includes carrier information, transit station information, and time information for each station for each order; The historical logistics trajectory data is spliced ​​together according to the current station and the arrival at the next station, and the time interval between the two stations is marked to construct the first training set; Based on the similarity between the training data in the first training set, the first training set is divided into multiple fragmented training sets. For each training set segment, a lightweight gradient booster regression model is trained to obtain the corresponding lightweight gradient booster regression sub-model.

8. The method according to claim 7, characterized in that, The step of dividing the first training set into multiple fragmented training sets based on the similarity between the training data in the first training set includes: Based on the similarity of the current site location of each training data in the first training set, the first training set is divided into multiple fragmented training sets.

9. The method according to claim 7, characterized in that, The step of dividing the first training set into multiple fragmented training sets based on the similarity between the training data in the first training set includes: Based on the similarity between the training data in the first training set and the size of the preset training set, the first training set is divided into multiple training sets.

10. The method according to claim 1, characterized in that, The lightweight gradient booster classification model is trained in the following way: Obtain historical logistics trajectory data, which includes carrier information, transit station information, time information of each station, and delivery code information of each order; The historical logistics trajectory data is spliced ​​together according to the current station and the arrival at the next station, and the time interval between the two stations is marked to construct a second training set; The lightweight gradient booster classification model is trained using the second training set to obtain the trained lightweight gradient booster classification model.

11. The method according to claim 1, characterized in that, The Lightweight Gradient Boosting Machine (LGBM) classification model and the Lightweight Gradient Boosting Machine (LGBM) regression sub-model are LightGBM models. The Lightweight Gradient Boosting Machine (LGBM) classification model is trained using a logarithmic loss function, and the Lightweight Gradient Boosting Machine (LGBM) regression sub-model is trained using a quantile loss function corrected by L1 normalization.

12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the method as described in any one of claims 1-11.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1-11.

14. A computer program product, characterized in that, It includes computer program instructions, which, when read and executed by a processor, perform the method as described in any one of claims 1-11.