A method for determining delivery time and an electronic device
By combining probability statistics and Bayesian network models with dynamic programming algorithms, the problem of insufficient comprehensive consideration of factors in logistics delivery time prediction is solved, achieving accurate delivery time determination and improving delivery efficiency and service quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-03-13
AI Technical Summary
Existing methods for determining logistics delivery times fail to comprehensively consider various factors, such as weather, traffic accidents, and road construction, resulting in insufficient forecast accuracy and an inability to meet customers' precise delivery time requirements.
By using probabilistic statistical methods, historical data of the target delivery task is obtained, time windows are divided, Gaussian mixture models and Bayesian probabilistic networks are constructed, and Markov chain Monte Carlo methods and dynamic programming algorithms are combined to generate the final delivery time plan.
It improves the accuracy and efficiency of delivery time forecasting, ensuring timely and efficient delivery of goods and enhancing the operational efficiency and service quality of the logistics industry.
Smart Images

Figure CN121052730B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of logistics and distribution technology, and in particular to a method for determining delivery time and an electronic device. Background Technology
[0002] In today's rapidly evolving logistics industry, accurate delivery time determination is crucial. With the booming rise of e-commerce, consumers have increasingly stringent requirements for delivery speed. Delivery time not only directly impacts customer experience but is also closely linked to a company's operating costs and market competitiveness. However, determining logistics delivery times currently faces numerous challenges.
[0003] The factors influencing delivery processes are extremely complex and variable. Existing methods for determining delivery times fail to comprehensively consider the various factors affecting delivery time, such as weather, traffic accidents, and road construction. Even with the continuous development of big data and artificial intelligence technologies, although some logistics companies have begun to try to use data to optimize delivery times, existing methods still have shortcomings. Some methods simply perform statistical analysis on historical data without fully exploring the underlying patterns or effectively combining real-time environmental parameters. Other machine learning-based methods suffer from excessive model complexity, high computational costs, and are prone to overfitting, resulting in poor stability and reliability in practical applications.
[0004] Therefore, a method is needed that can comprehensively consider multiple factors and accurately determine delivery time. Summary of the Invention
[0005] To address at least one of the problems in the prior art, embodiments of the present invention provide a method and electronic device for determining delivery time, which intelligently determines delivery time through probability statistics.
[0006] To achieve the above objectives, on the one hand, a method for determining delivery time is provided, including:
[0007] Obtain historical delivery data for the target delivery task, including: actual travel time, weather conditions, traffic event type, and timestamp of at least one delivery segment related to the target delivery task;
[0008] Based on the timestamp and the time window corresponding to each predetermined cycle type, the historical delivery data is segmented to obtain the historical delivery data within each time window; wherein, the cycle type includes one or more of daily cycle, weekly cycle, and holiday cycle;
[0009] For each time window, based on historical delivery data within that time window, the average travel time and standard deviation of each delivery segment are determined. A Gaussian mixture model is then used to model the travel time distribution under different weather conditions within the same time window. The parameters of the Gaussian mixture model are associated with time window labels to generate an initial time distribution model. The time window labels are used to identify the time window corresponding to the Gaussian mixture model. The parameters of the Gaussian mixture model include: the average travel time and standard deviation of each delivery segment, and the weights of each Gaussian distribution.
[0010] Input the current real-time traffic event type and current weather conditions of the target delivery task into the Bayesian probability network pre-constructed for each delivery route, and calculate the conditional probability distribution of each delivery route.
[0011] The conditional probability distribution is fused with the initial time distribution model, and multiple candidate delivery time series are generated by simulating using the Markov chain Monte Carlo method.
[0012] Cluster analysis was performed on the multiple candidate delivery time series, and the cluster centers were extracted as candidate time nodes;
[0013] Based on the frequency of occurrence and time interval of the candidate time nodes, a probability density function is generated, and the confidence interval of the candidate time nodes is calculated.
[0014] The time allocation of delivery routes is optimized within the confidence interval using a dynamic programming algorithm to generate the final delivery time plan.
[0015] Preferably, the determining method further includes:
[0016] Based on the real-time environmental parameters of the target delivery task, time windows that match the real-time environmental parameters are selected from the initial time distribution model, and the average travel time and standard deviation corresponding to the selected time windows are extracted; wherein, the real-time environmental parameters include: the traffic event type and weather conditions of the time window to which the current time belongs.
[0017] Preferably, the determination method, which constructs a Bayesian probabilistic network, includes:
[0018] Define traffic event types as discrete nodes, weather conditions as continuous nodes, and delivery time delays as output nodes; where traffic event types include one or more of the following: traffic accidents and road construction; weather conditions include one or more of the following: temperature, humidity, and rainfall;
[0019] Calculate a joint probability table of traffic event types and weather conditions based on the historical delivery data;
[0020] Based on the joint probability table, the posterior probability distribution of delivery time delay is estimated using the Markov chain Monte Carlo method.
[0021] Preferably, the determination method, which fuses the conditional probability distribution with the initial time distribution model, includes:
[0022] Convert the conditional probability distribution output by the Bayesian probability network into a Gaussian distribution form;
[0023] The Gaussian mixture model in the initial time distribution model is weighted and fused to obtain the fused distribution parameters; wherein, the weights are determined based on the similarity between the current real-time environmental parameters of the target delivery task and the environmental parameters of the historical delivery data; wherein, the environmental parameters include: traffic event type and weather conditions;
[0024] The fused distribution parameters are optimized using the expectation-maximization algorithm.
[0025] Preferably, the determination method includes the step of generating multiple candidate delivery time series:
[0026] The fused distribution is randomly sampled N times, and each sampling generates a time series of a complete delivery route, where N is a predetermined first number;
[0027] Add a time window label to each time series and record the probability density value corresponding to that time series;
[0028] Time series with probability density values below a preset threshold are removed as abnormal time series, and the remaining time series are retained as candidate delivery time series.
[0029] Preferably, in the determination method, the cluster analysis includes:
[0030] The candidate delivery time series were clustered using the K-means algorithm, and the number of clusters was determined by the elbow rule.
[0031] For each cluster, calculate the mean and variance at each time point, and select the top M clusters with the smallest variance as the effective candidate set, where M is a predetermined second number;
[0032] The mean of the effective candidate set is arranged in chronological order to generate a candidate time node set.
[0033] Preferably, in the determination method, the step of generating the probability density function includes:
[0034] Kernel density estimation is performed on the candidate time node set, and the density distribution is calculated by selecting a Gaussian kernel function;
[0035] The time points corresponding to the peak values of the density distribution are extracted as high-probability time nodes;
[0036] Calculate the confidence interval for the high-probability time nodes, wherein the range of the confidence interval is adjusted according to the scaling factor of the standard deviation of the density distribution.
[0037] Preferably, in the determination method, the step of optimizing the time allocation of the delivery route includes:
[0038] Map the candidate time nodes within the confidence interval to the time constraints of the delivery route;
[0039] Construct a time allocation cost function, where the cost includes time deviation penalty and path conflict penalty;
[0040] The optimal time allocation solution is output by minimizing the total cost under the time constraint using a dynamic programming algorithm.
[0041] The total cost function is:
[0042]
[0043] Where C represents the total cost; The weighting coefficient of the time deviation penalty reflects the degree of importance attached to time deviation; L: the time deviation penalty term, calculated using the following formula. ;in For the actual allocated time, Let N be the desired time, and N be the number of time points. : The weighting coefficient of the path conflict penalty, reflecting the degree of importance attached to path conflicts; M: The path conflict penalty term. When two adjacent time nodes overlap, M is the square of the conflict duration; when there is no conflict... .
[0044] Preferably, in the determination method, the step of generating the final delivery time plan includes:
[0045] Arrange the time nodes in the optimal solution in path order to generate a time schedule table;
[0046] The generated time schedule is checked for time conflicts, and the confidence interval range is readjusted when conflicts exist.
[0047] Output the conflict-free final delivery time plan and the corresponding probability confidence level.
[0048] On the other hand, an electronic device is provided, including a memory and a processor, the memory storing at least one program, the at least one program being executed by the processor to implement the method for determining delivery time as described in any of the above.
[0049] The above technical solution has the following technical effects:
[0050] This invention acquires historical delivery data for a target delivery task, divides this data into multiple time windows, and generates an initial time distribution model by calculating the average travel time and standard deviation within different time windows. This accurately depicts the distribution pattern of delivery time from both macroscopic and microscopic perspectives. Furthermore, by constructing a Bayesian probabilistic network, the impact of real-time traffic event types and weather conditions on delivery time is considered, ensuring that the prediction fully takes into account the changing factors in the actual scenario. Compared to traditional methods, this invention's solution considers the impact of weather conditions, traffic events, and different time cycle patterns on delivery, significantly improving the accuracy of delivery time prediction.
[0051] Furthermore, the technical solution of this invention optimizes the time allocation of delivery routes through a series of operations such as cluster analysis, generation of probability density functions, and dynamic programming algorithms. By finding the optimal time allocation scheme based on various constraints, delivery efficiency is further improved, ensuring that goods can be delivered to their destination on time and efficiently, thus providing strong support for the efficient development of the logistics industry. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating a method for determining delivery time according to an embodiment of the present invention.
[0053] Figure 2 This is a schematic diagram of the process of dividing historical delivery data into time windows in one embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram of the process for generating the initial time distribution model in one embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram illustrating the process of generating and filtering candidate delivery time series in one embodiment of the present invention. Detailed Implementation
[0056] To further illustrate the various embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, primarily used to illustrate the embodiments and to explain the operating principles of the embodiments in conjunction with the relevant descriptions in the specification. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention. Components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0057] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.
[0058] During their research on methods for determining delivery time, the inventors of this invention discovered that:
[0059] Traditional methods for determining delivery times are often overly simplistic, relying heavily on experience or fixed delivery durations. For example, in same-city delivery, methods might simply divide delivery times into fixed intervals based on distance, completely ignoring the complexities of the actual delivery process. This approach has significant errors in practice and fails to meet customers' demands for precise delivery times. In cities with complex traffic conditions, especially during rush hour when road congestion is severe, traditionally estimated delivery times can lead to delays and customer dissatisfaction.
[0060] The factors influencing the delivery process are extremely complex and variable. Weather conditions have a significant impact on delivery time; rain and snow make roads slippery, reducing vehicle speed and thus extending delivery times. Traffic incidents are also a significant concern; accidents, road construction, and other unforeseen events can cause traffic congestion, disrupting original delivery plans. Traffic flow and delivery demand also vary considerably across different time periods, such as weekdays, weekends, and holidays. However, existing methods for determining delivery times struggle to comprehensively consider these factors, leading to a substantial reduction in the accuracy of delivery time predictions. During holidays, delivery demand increases dramatically, and road traffic volume rises, but traditional methods fail to adjust delivery time predictions to these changes, resulting in low delivery efficiency.
[0061] To address one or more problems existing in the prior art, this invention proposes a method for intelligently determining delivery time based on probability statistics.
[0062] Example 1:
[0063] Figure 1 This is a flowchart illustrating a method for determining delivery time according to an embodiment of the present invention. Figure 1 The method for determining delivery time in this embodiment includes the following steps:
[0064] Obtain historical delivery data for the target delivery task. The historical delivery data includes: the actual travel time, weather conditions, traffic event type, and timestamp of at least one delivery segment related to the target delivery task.
[0065] Based on the timestamp and the time window corresponding to each predetermined cycle type, the historical delivery data is segmented to obtain the historical delivery data within each time window; the cycle type includes one or more of daily cycle, weekly cycle, and holiday cycle;
[0066] For each time window, based on historical delivery data within that time window, the average travel time and standard deviation of each delivery segment are determined. A Gaussian mixture model is then used to model the travel time distribution under different weather conditions within the same time window. The parameters of the Gaussian mixture model are associated with the time window labels to generate an initial time distribution model. The time window labels are used to identify the time window corresponding to the Gaussian mixture model. The parameters of the Gaussian mixture model include: the average travel time and standard deviation of each delivery segment, and the weights of each Gaussian distribution.
[0067] Gaussian mixture models are used to model the distribution of driving time under different weather conditions within the same time window. Their probability density function is:
[0068] in : Probability density when the travel time is x For the set of model parameters; K: the number of Gaussian distributions (corresponding to sub-distributions for different weather conditions); The weights of the k-th Gaussian distribution satisfy the following conditions: This is used to represent the percentage of travel time under this weather condition; : The probability density function of the k-th Gaussian distribution, where: x: random variable, representing the travel time of the delivery route; : The mean of the k-th Gaussian distribution, corresponding to the average travel time of this road segment under certain weather conditions; The square root of the variance of the k-th Gaussian distribution. The standard deviation represents the degree of fluctuation in travel time under those weather conditions.
[0069] Input the current real-time traffic event type and current weather conditions of the target delivery task into the Bayesian probability network pre-built for each delivery route, and calculate the conditional probability distribution of each delivery route.
[0070] The conditional probability distribution is fused with the initial time distribution model, and multiple candidate delivery time series are generated by simulating using the Markov chain Monte Carlo method.
[0071] Cluster analysis was performed on multiple candidate delivery time series, and the cluster centers were extracted as candidate time nodes;
[0072] Based on the frequency and time interval of the candidate time nodes, a probability density function is generated, and the confidence interval of the candidate time nodes is calculated.
[0073] The time allocation of delivery routes is optimized within the confidence interval using a dynamic programming algorithm to generate the final delivery time plan.
[0074] Example 2:
[0075] Figure 2 This is a schematic diagram of the process of dividing historical delivery data into time windows in one embodiment of the present invention; Figure 3 This is a schematic diagram of the process for generating the initial time distribution model in this embodiment; Figure 4 This is a schematic diagram illustrating the process of generating and filtering candidate delivery time series in this embodiment.
[0076] The following is combined with Figures 2-4 The specific implementation of the delivery time determination method in this embodiment of the present invention will be described.
[0077] The method in this embodiment includes:
[0078] Obtain historical delivery data for the target delivery task: Collect information such as actual travel time, weather conditions, traffic event types, and timestamps for at least one delivery segment. This data forms the basis for subsequent analysis, such as extracting delivery history records for specific regions and business types from the logistics and delivery system's database.
[0079] Divide the time window: Based on the periodic characteristics in the timestamps, such as daily cycle, weekly cycle and holiday cycle, the historical delivery data is divided into multiple time windows, each time window corresponding to a time cycle pattern.
[0080] Generate an initial time distribution model: For historical data within each time window, calculate the average travel time and standard deviation of each delivery segment to generate an initial time distribution model, which is used to describe the basic characteristics of the travel time of delivery segments under different time windows.
[0081] Filtering and matching time windows and extracting data: Combining the real-time environmental parameters of the target delivery task, such as real-time weather conditions and the current time period, the time window that matches the target delivery task is selected from the initial time distribution model, and the corresponding average driving time and standard deviation are extracted to provide more targeted data for subsequent analysis.
[0082] Construct a Bayesian probability network and calculate the conditional probability distribution: Construct a Bayesian probability network for each delivery segment, input real-time traffic event types and weather conditions, and calculate the conditional probability distribution for each segment, taking into account the impact of real-time factors on delivery time.
[0083] Fusion and generation of candidate delivery time series: The conditional probability distribution is fused with the initial time distribution model, and multiple candidate delivery time series are generated through Monte Carlo simulation, increasing the diversity and rationality of delivery time prediction.
[0084] Cluster analysis and extraction of candidate time nodes: Cluster analysis is performed on the candidate delivery time series to extract the cluster centers as candidate time nodes, so as to select more representative time nodes in the subsequent screening.
[0085] Generate probability density function and calculate confidence interval: Based on the frequency of occurrence and time interval of candidate time nodes, generate probability density function and calculate its confidence interval to evaluate the reliability range of delivery time.
[0086] Optimize delivery route time allocation and generate final plan: Utilize dynamic programming algorithm to optimize the time allocation of delivery routes within confidence intervals, and finally generate a reasonable delivery time plan to achieve intelligent determination of delivery time.
[0087] In practical implementation, when processing historical delivery data, the first step is to identify the periodic characteristics in the timestamps. A timestamp is an identifier that records the time when delivery data is generated. In one implementation, the timestamp represents the order placement time. The daily cycle refers to the periodic changes within a 24-hour day, the weekly cycle is the cyclical changes of a 7-day week, and the holiday cycle is a set of specific holiday dates. In one implementation, the daily cycle includes morning, noon, and evening; the weekly cycle includes weekdays and rest days. Taking delivery data from a certain city as an example, on weekdays, travel time on delivery routes is usually longer during morning and evening rush hours, reflecting the daily cycle characteristic; compared to weekdays, delivery demand and traffic conditions differ on weekends, reflecting the weekly cycle characteristic; and during holidays such as National Day and Spring Festival, delivery volume and traffic rules change, forming a unique holiday cycle.
[0088] Next, the time window length is defined for each cycle type. In one specific implementation, the daily cycle window is set to 24 hours, which can fully cover the delivery situation at different times of the day. The weekly cycle window is 7 days, which can comprehensively reflect the changing patterns within a week. The holiday cycle window is determined according to the specific holiday dates; for example, the time window for National Day might be from October 1st to October 7th.
[0089] Finally, the historical data is segmented according to the aforementioned time window lengths, and each time window is labeled with a period type tag. Assuming the historical data includes one month of delivery records, dividing it into daily period windows yields 30 24-hour time windows; dividing it into weekly period windows yields 4 7-day time windows. When labeling the period type, it is crucial to specify whether each time window belongs to a weekday, weekend, or holiday, to facilitate subsequent data analysis for different period types.
[0090] Dividing time windows in this way allows for a more detailed analysis of the characteristics of delivery data under different cycle patterns, providing a more accurate data foundation for generating the initial time distribution model and thus improving the accuracy of delivery time determination. For example, when analyzing delivery times for a certain road segment, the average travel time and standard deviation can be calculated separately for time windows of different cycle types, allowing for a more accurate understanding of the travel time variation patterns of that road segment across different time periods.
[0091] In the specific implementation, during the generation of the initial time distribution model, the mean and standard deviation of the actual travel time are calculated for each delivery segment within each time window. The mean reflects the average level of travel time for that segment within a specific time window, while the standard deviation reflects the degree of fluctuation in travel time. Assuming there are 100 delivery records for a certain delivery segment within a weekly time window, the average travel time for that segment within that week is obtained by calculating the average of these 100 travel times, while the standard deviation measures the degree of deviation of each travel time from the average time.
[0092] A Gaussian mixture model (GMM) is used to model the distribution of travel time under different weather conditions within the same time window. In one specific implementation, the mean and standard deviation of the actual travel time obtained for each delivery segment within the time window are used to initialize the GMM. A GMM is a commonly used probabilistic model that represents a weighted sum of multiple Gaussian distributions. In delivery scenarios, different weather conditions, such as sunny, rainy, and snowy days, have different impacts on travel time. For example, on sunny days, road conditions are better, and travel time is relatively stable; on rainy days, the road surface may be slippery, increasing travel time and causing greater fluctuations. By fitting the travel time data under different weather conditions using a GMM, the distribution of travel time can be described more accurately. Assuming that within a daily time window, the travel time of a certain segment follows one Gaussian distribution on sunny days and another on rainy days within a different Gaussian distribution, the GMM can combine these two distributions to more comprehensively represent the travel time distribution of that segment under different weather conditions.
[0093] The parameters of the Gaussian mixture model are associated with time window labels to form an initial time distribution model. These parameters include the mean, standard deviation, and weights of each Gaussian distribution. The time window labels indicate which time window the model corresponds to in terms of travel time distribution. This allows for quick identification of the corresponding initial time distribution model based on real-time environmental parameters such as the current time window, traffic event type, and weather conditions. The relevant average travel time and standard deviation can then be extracted, providing crucial information for determining delivery times. For example, when determining the time of a current delivery task, the parameters can be retrieved from the initial time distribution model based on the current time window and weather conditions, leading to a more accurate prediction of the delivery time.
[0094] In one specific implementation, when constructing a Bayesian probabilistic network, the nodes in the network are first defined. Traffic event types are set as discrete nodes because traffic events such as traffic accidents and road construction are different states that can be clearly classified; weather conditions are set as continuous nodes, as weather conditions such as temperature, humidity, and rainfall are continuously changing values; delivery time delay is set as an output node, which is the variable of interest, and it is affected by traffic event types and weather conditions.
[0095] A joint probability table of traffic event types and weather conditions is calculated based on historical delivery data. This table records the probability of different traffic event types and weather conditions occurring simultaneously. For example, the ratio of the number of times a traffic accident occurred in rainy weather to the total number of deliveries in historical delivery data represents the probability of both traffic accidents and rainy weather occurring simultaneously. Through statistical analysis of a large amount of historical data, a relatively accurate joint probability table can be obtained, providing a foundation for subsequently calculating the posterior probability distribution of delivery time delays.
[0096] The posterior probability distribution of delivery time delays is estimated using the Markov Chain Monte Carlo method. The Markov Chain Monte Carlo method is a technique for random sampling in a probability space. In a Bayesian probabilistic network, given the joint probabilities of traffic event type and weather conditions, this method can sample from the posterior distribution to obtain the probability distribution of delivery time delays. Assuming a traffic accident has occurred and the weather is rainy, the Markov Chain Monte Carlo method can simulate multiple possible delivery time delay scenarios. The distribution of these simulation results is then statistically analyzed to obtain the posterior probability distribution of delivery time delays under these conditions, thus allowing for a more accurate assessment of the likelihood and extent of delivery time delays.
[0097] By constructing a Bayesian probabilistic network and calculating the conditional probability distribution, the impact of traffic events and weather conditions on delivery time can be fully considered, providing a more scientific basis for accurate delivery time prediction. For example, in actual delivery, when encountering sudden traffic events and severe weather, the probability distribution of delivery time delays can be quickly calculated using a Bayesian probabilistic network, allowing for proactive countermeasures and improved delivery service quality.
[0098] In one specific implementation, when fusing the conditional probability distribution and the initial time distribution model, the conditional probability distribution output by the Bayesian probability network is first converted into a Gaussian distribution. Since the Gaussian distribution has certain advantages in mathematical calculation and analysis, converting the conditional probability distribution to a Gaussian distribution facilitates subsequent fusion with the initial time distribution model. For example, by fitting the delivery time delay probability distribution output by the Bayesian probability network to conform to the form of a Gaussian distribution, the corresponding mean and standard deviation can be obtained.
[0099] A weighted fusion of Gaussian mixture models in the initial time distribution model is performed, with weights determined by the similarity between real-time environmental parameters and historical data. Real-time environmental parameters include the current traffic event type and weather conditions. Similarity is calculated by comparing current environmental parameters with those from different time windows in historical data. For example, the similarity between current weather conditions and weather conditions in different time windows of historical data can be calculated using methods such as Euclidean distance. Higher similarity results in a greater weight for the corresponding historical data in the weighted fusion. Assuming the current weather is sunny, and multiple time windows in the historical data contain records of sunny days, the time window most similar to the current weather conditions is found by calculating similarity, assigned a higher weight, and its corresponding Gaussian mixture model is then fused with the transformed conditional probability distribution.
[0100] The expected value maximization (EVM) algorithm is used to optimize the parameters of the merged distribution. EVM is an iterative algorithm used to estimate unknown parameters in a probabilistic model. In the merged distribution, some parameters may need adjustment to more accurately reflect reality. Through continuous iteration, EVM can gradually optimize these parameters, making the merged distribution more reasonable. For example, in a merged Gaussian mixture model, adjusting parameters such as the mean, standard deviation, and weights allows the model to better fit actual delivery time data, improving the accuracy of delivery time predictions.
[0101] By performing the fusion operations described above, the real-time factors considered by the Bayesian probabilistic network can be combined with the initial time distribution model, laying the foundation for generating more accurate candidate delivery time series. For example, in actual delivery, real-time traffic events and weather changes can affect delivery time. Through the fusion operation, these impacts can be incorporated into the delivery time prediction model in a timely manner, improving the reliability of the prediction.
[0102] In one specific implementation, when generating candidate delivery time series, N random samples are taken from the fused distribution, with each sample generating a time series of a complete delivery route. N is a pre-set number of samples, the size of which affects the diversity and accuracy of the candidate delivery time series. For example, setting N to 1000, by randomly drawing samples from the fused Gaussian mixture model, 1000 complete time series containing the travel time of each delivery segment are generated.
[0103] Each time series is labeled with a time window, and its probability density value is recorded. The time window label clearly identifies the time cycle pattern corresponding to the time series, facilitating subsequent analysis and filtering. The probability density value reflects the likelihood of the time series appearing in the fused distribution. For example, a time series generated within a certain time window has a higher probability density value, indicating that the delivery time combination represented by this time series is more likely to occur under the environmental conditions of that time window.
[0104] Abnormal time series with probability density values below a preset threshold are removed, and the remaining time series are retained as candidate delivery time series. The preset threshold is a standard set based on practical experience and data characteristics to exclude unreasonable time series. Assuming the preset threshold is 0.01, when the probability density value of a time series is below this threshold, it indicates that its probability of occurrence in reality is low, classifying it as an abnormal time series, and it is removed. After screening, the retained candidate delivery time series are more representative and reliable, providing high-quality data for subsequent cluster analysis and determining the final delivery time plan. For example, in actual delivery, removing abnormal time series can prevent deviations in delivery plans caused by unreasonable time forecasts, thereby improving delivery efficiency.
[0105] In one specific implementation, when performing cluster analysis on candidate delivery time series, the K-means algorithm is used to cluster the candidate delivery time series, and the number of clusters is determined by the elbow rule. The K-means algorithm is a commonly used clustering algorithm that divides data into K categories by continuously adjusting the cluster centers. The elbow rule is a method for determining the value of K. By calculating the change in clustering errors, such as the sum of squared errors (SSE), under different K values, a curve of error versus K is plotted. The K value at the inflection point of the curve is usually considered to be a better number of clusters. For example, for 1000 candidate delivery time series, different values of K from 2 to 10 are tried, and the SSE under each K value is calculated. Plotting the curve reveals that when K = 5, the curve shows a clear inflection point, at which point the number of clusters is determined to be 5.
[0106] For each cluster, the mean and variance of its time nodes are calculated, and the top M clusters with the smallest variances are selected as the valid candidate set. The mean represents the average level of time nodes within that cluster, while the variance reflects the dispersion of time nodes. The smaller the variance, the more concentrated and representative the time nodes are within that cluster. For example, in 5 clusters, the mean and variance of the time nodes for each cluster are calculated, and the top 3 clusters with the smallest variances are selected as the valid candidate set. The time nodes in these 3 clusters are more stable and more likely to represent reasonable delivery times.
[0107] The means of the valid candidate clusters are arranged chronologically to generate a candidate time node set. Arranging the means chronologically clearly shows the representative time nodes in different clusters. For example, arranging the means of three valid candidate clusters in ascending chronological order yields a candidate time node set. The time nodes in this set can serve as important evidence for generating the probability density function and determining the final delivery time plan. Through cluster analysis, candidate delivery time series can be effectively screened and organized, extracting more valuable candidate time nodes and improving the accuracy and rationality of delivery time determination.
[0108] In one specific implementation, when generating the probability density function, kernel density estimation is performed on the candidate time node set, and a Gaussian kernel function is selected to calculate the density distribution. Kernel density estimation is a nonparametric estimation method used to estimate the probability density function of data. The Gaussian kernel function is a commonly used kernel function, and its formula is: ,in It's a data point. The bandwidth parameter determines the smoothness of the kernel function. When estimating the kernel density of a candidate time node set, a suitable bandwidth parameter is selected, and the density value at each time point is calculated using the Gaussian kernel function, thus obtaining the density distribution. For example, in the candidate time node set, for each time point, the contribution of its surrounding data points to the density of that point is calculated according to the Gaussian kernel function, thereby obtaining the density distribution of the entire candidate time node set.
[0109] Extract the time points corresponding to the peak values of the density distribution as high-probability time nodes. These high-probability time nodes represent time points that are more likely to occur during the delivery process. For example, on the density distribution curve, the time points corresponding to the peak values are high-probability time nodes, and they are more likely to be reasonable delivery times.
[0110] Calculate the confidence interval for high-probability time points, with the interval range adjusted by the scaling factor of the standard deviation of the density distribution. The scaling factor is an adjustable parameter used to control the width of the confidence interval. Assuming a scaling factor of 1.5, the range of the confidence interval is determined by multiplying the standard deviation of the density distribution by this factor. For example, if the standard deviation of a high-probability time point is 10 minutes and the scaling factor is 1.5, then the confidence interval for that time point is a range 15 minutes to the left and right of that time point.
[0111] When optimizing the time allocation for delivery routes, candidate time nodes within the confidence interval are mapped to the time constraints of the delivery routes. Delivery routes may have time limitations, such as customer-required delivery time ranges or operational time constraints for delivery vehicles. Matching candidate time nodes with these time constraints ensures that delivery times meet actual requirements.
[0112] A time allocation cost function is constructed, comprising a time deviation penalty and a route conflict penalty. The time deviation penalty measures the difference between the actual delivery time and the expected time, while the route conflict penalty addresses potential vehicle conflicts, resource allocation conflicts, and other issues that may occur along the delivery route. For example, the time deviation penalty can be defined as the square of the difference between the actual delivery time and the customer's requested delivery time, and the route conflict penalty can be assigned different weights based on the severity of the conflict.
[0113] The dynamic programming algorithm minimizes the total cost under time constraints, outputting the optimal time allocation solution. Dynamic programming is an optimization algorithm used to solve multi-stage decision problems. In the delivery time allocation problem, the delivery process is divided into multiple stages, and appropriate time nodes are selected for each stage. The dynamic programming algorithm is then used to continuously optimize and find the time allocation scheme that minimizes the total cost.
[0114] The total cost function used to optimize the time allocation for delivery routes is:
[0115] Where C represents the total cost, which needs to be minimized using a dynamic programming algorithm; : Weighting coefficient for time deviation penalty, reflecting the degree of importance attached to time deviation; L: Time deviation penalty term, calculated using the following formula. ;in For the actual allocated time, Let N be the desired time, and N be the number of time points. : The weighting coefficient of the path conflict penalty, reflecting the degree of importance attached to path conflicts; M: The path conflict penalty term. When two adjacent time nodes overlap, M is the square of the conflict duration; when there is no conflict... .
[0116] When generating the final delivery time plan, the time nodes in the optimal solution are arranged in path order to generate a time plan table. Following the order of the delivery routes, the time nodes in the optimal time allocation solution are arranged sequentially to form a detailed delivery time plan.
[0117] The time schedule is checked for time conflicts. If conflicts are found, the confidence interval range is readjusted. Time conflicts may include situations where vehicles need to arrive at different locations at the same time, or delivery tasks exceeding vehicle operating hours. If a conflict is detected, the confidence interval is recalculated by adjusting the standard deviation scaling factor, and the time allocation and time schedule are regenerated.
[0118] The final output is a conflict-free final delivery time plan and its corresponding probability confidence level. The probability confidence level reflects the reliability of the delivery time plan, giving delivery personnel and customers a clearer understanding of the delivery time. For example, if the output final delivery time plan is "10:00 - 11:30" with a probability confidence level of 0.9, it means that there is a 90% probability that the delivery time plan is accurate. Through these steps, a reasonable and reliable delivery time plan can be generated, improving delivery efficiency and service quality.
[0119] One embodiment of the present invention first constructs a prediction model, modeling the delivery time prediction process as a probabilistic statistical model, and selects a Bayesian regression model as the core algorithm, clearly defining the feature space and target variable. Next, historical delivery data is collected and cleaned, features are extracted and preprocessed to ensure data quality. Then, the preprocessed data is used to train the Bayesian regression model, enabling it to accurately reflect the relationship between the feature space and the target variable. Finally, feature data is collected in real time during the delivery process and input into the trained model to obtain the predicted delivery time. This invention comprehensively considers multiple influencing factors, possesses real-time prediction capabilities, significantly improves the accuracy of delivery time prediction, enhances logistics efficiency and service quality, and reduces enterprise operating costs.
[0120] Example 3:
[0121] The present invention also provides an electronic device including a memory and a processor, the memory storing at least one program, the at least one program being executed by the processor to implement an embodiment of the delivery time determination method as described above.
[0122] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor is the control center of the computer unit, connecting various parts of the entire computer unit via various interfaces and lines.
[0123] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer unit by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0124] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.
Claims
1. A method for determining delivery time, characterized in that, include: Obtain historical delivery data for the target delivery task, including: actual travel time, weather conditions, traffic event type, and timestamp of at least one delivery segment related to the target delivery task; Based on the timestamp and the time window corresponding to each predetermined cycle type, the historical delivery data is segmented to obtain the historical delivery data within each time window; wherein, the cycle type includes one or more of daily cycle, weekly cycle, and holiday cycle; For each time window, based on historical delivery data within that time window, the average travel time and standard deviation of each delivery segment are determined. A Gaussian mixture model is then used to model the travel time distribution under different weather conditions within the same time window. The parameters of the Gaussian mixture model are associated with time window labels to generate an initial time distribution model. The time window labels are used to identify the time window corresponding to the Gaussian mixture model. The parameters of the Gaussian mixture model include: the average travel time and standard deviation of each delivery segment, and the weights of each Gaussian distribution. Input the current real-time traffic event type and current weather conditions of the target delivery task into the Bayesian probability network pre-constructed for each delivery route, and calculate the conditional probability distribution of each delivery route. The conditional probability distribution is fused with the initial time distribution model, and multiple candidate delivery time series are generated by simulating using the Markov chain Monte Carlo method. Cluster analysis was performed on the multiple candidate delivery time series, and the cluster centers were extracted as candidate time nodes; Based on the frequency of occurrence and time interval of the candidate time nodes, a probability density function is generated, and the confidence interval of the candidate time nodes is calculated. The time allocation of delivery routes is optimized within the confidence interval using a dynamic programming algorithm to generate the final delivery time plan.
2. The determination method according to claim 1, characterized in that, Also includes: Based on the real-time environmental parameters of the target delivery task, time windows that match the real-time environmental parameters are selected from the initial time distribution model, and the average travel time and standard deviation corresponding to the selected time windows are extracted; wherein, the real-time environmental parameters include: the traffic event type and weather conditions of the time window to which the current time belongs.
3. The determination method according to claim 1, characterized in that, Constructing a Bayesian probabilistic network includes: Define traffic event types as discrete nodes, weather conditions as continuous nodes, and delivery time delays as output nodes; where traffic event types include one or more of the following: traffic accidents and road construction; weather conditions include one or more of the following: temperature, humidity, and rainfall; Calculate a joint probability table of traffic event types and weather conditions based on the historical delivery data; Based on the joint probability table, the posterior probability distribution of delivery time delay is estimated using the Markov chain Monte Carlo method.
4. The determination method according to claim 1, characterized in that, The fusion of the conditional probability distribution with the initial time distribution model includes: Convert the conditional probability distribution output by the Bayesian probability network into a Gaussian distribution form; The Gaussian mixture model in the initial time distribution model is weighted and fused to obtain the fused distribution parameters; wherein, the weights are determined based on the similarity between the current real-time environmental parameters of the target delivery task and the environmental parameters of the historical delivery data; wherein, the environmental parameters include: traffic event type and weather conditions; The fused distribution parameters are optimized using the expectation-maximization algorithm.
5. The determination method according to claim 4, characterized in that, The steps to generate multiple candidate delivery time series include: The fused distribution is randomly sampled N times, and each sampling generates a time series of a complete delivery route, where N is a predetermined first number; Add a time window label to each time series and record the probability density value corresponding to that time series; Time series with probability density values below a preset threshold are removed as abnormal time series, and the remaining time series are retained as candidate delivery time series.
6. The determination method according to claim 1, characterized in that, The cluster analysis includes: The candidate delivery time series were clustered using the K-means algorithm, and the number of clusters was determined by the elbow rule. For each cluster, calculate the mean and variance at each time point, and select the top M clusters with the smallest variance as the effective candidate set, where M is a predetermined second number; The mean of the effective candidate set is arranged in chronological order to generate a candidate time node set.
7. The determination method according to claim 6, characterized in that, The step of generating the probability density function includes: Kernel density estimation is performed on the candidate time node set, and the density distribution is calculated by selecting a Gaussian kernel function; The time points corresponding to the peak values of the density distribution are extracted as high-probability time nodes; Calculate the confidence interval for the high-probability time nodes, wherein the range of the confidence interval is adjusted according to the scaling factor of the standard deviation of the density distribution.
8. The determination method according to claim 1, characterized in that, The steps for optimizing the time allocation of delivery routes include: Map the candidate time nodes within the confidence interval to the time constraints of the delivery route; Construct a time allocation cost function, where the cost includes time deviation penalty and path conflict penalty; The optimal time allocation solution is output by minimizing the total cost under the time constraints using a dynamic programming algorithm. The total cost function is: Where C represents the total cost; The weighting coefficient of the time deviation penalty reflects the degree of importance attached to time deviation; L: the time deviation penalty term, calculated using the following formula. ;in For the actual allocated time, Let N be the desired time, and N be the number of time points. : The weighting coefficient of the path conflict penalty, reflecting the degree of importance attached to path conflicts; M: The path conflict penalty term. When two adjacent time nodes overlap, M is the square of the conflict duration; when there is no conflict... .
9. The determining method according to claim 8, characterized in that, The steps for generating the final delivery time plan include: Arrange the time nodes in the optimal solution in path order to generate a time schedule table; The generated time schedule is checked for time conflicts, and the confidence interval range is readjusted when conflicts exist. Output the conflict-free final delivery time plan and the corresponding probability confidence level.
10. An electronic device, characterized in that, It includes a memory and a processor, the memory storing at least one program, which is executed by the processor to implement the method for determining delivery time as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Distribution time estimation method and device, storage medium and electronic equipment
CN109993367A
Model training method and device, storage medium and electronic equipment
CN114925982A