This application relates to the logistics field, and in particular, to a method for determining a transportation scheme, a method for training a fast loading model, and a device.
With development of the economy, transportation industries are seeking increasingly high efficiency and accuracy, and containers are often the primary vessels for transportation. As a quantity of pick-up points and an amount of goods that need to be transported increase, transportation routes need to be planned to improve transportation efficiency.
In an existing solution, a route scheme is obtained by using an ant colony optimization algorithm, and then a goods loading scheme for the route scheme, namely, a manner of loading goods into a container, is obtained through three-dimensional loading simulation. However, in the three-dimensional loading simulation, goods cannot be processed in parallel, a large quantity of operations are required, and a large amount of time is consumed. Particularly, when a goods volume is comparatively large, a larger amount of time is consumed. Consequently, efficiency of obtaining a goods loading scheme and outputting an actual loading rate is reduced, and efficiency of obtaining a target transportation scheme is affected.
Embodiments of this application provide a method for determining a transportation scheme, a method for training a fast loading model, and a device that are used for goods transportation, to fast obtain a target transportation scheme, reduce transportation costs, and improve transportation efficiency especially when a transportation volume is large and a situation is complex.
In view of this, a first aspect of this application provides a method for determining a transportation scheme, and the method may include:
first obtaining at least one route scheme and a first goods allocation scheme set corresponding to each of the at least one route scheme, where each of the at least one route scheme is a transportation route planned for transporting to-be-transported goods, one route scheme may include at least one transportation route, the first goods allocation scheme set corresponding to each of the at least one route scheme includes at least one goods allocation scheme, and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme is a scheme for allocating the to-be-transported goods for the corresponding route scheme; determining, by using a fast loading model, an actual loading rate of each goods allocation scheme in the first goods allocation set corresponding to each of the at least one route scheme, where the fast loading model is obtained by training offline simulation data offline, the offline simulation data includes a historical loading scheme calculated by using a three-dimensional loading algorithm, and the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to determine a target transportation scheme, where the target transportation scheme includes a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
In this embodiment of this application, after the at least one route scheme and the first goods allocation scheme set corresponding to each of the at least one route scheme are determined, the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each route scheme can be determined by using the fast loading model that is obtained by training the offline simulation data offline, actual loading rates of all goods allocation schemes corresponding to each route scheme can be fast obtained, duration of obtaining the actual loading rates of all the goods allocation schemes corresponding to each route scheme can be reduced, and efficiency of determining the target transportation scheme is improved. The fast loading model is obtained by performing offline simulation training on the offline simulation data, the offline simulation data includes data obtained through a three-dimensional loading operation, and accuracy of the obtained actual loading rate can be improved.
With reference to the first aspect of this application, in a first implementation of the first aspect of this application, the obtaining at least one route scheme and a first goods allocation scheme set corresponding to each of the at least one route scheme may include:
first obtaining a target freight bill, where the target freight bill includes transportation node information and to-be-transported goods information, the transportation node information includes a freight starting point, a freight ending point, and M pickup points, and the to-be-transported goods information includes information about to-be-transported goods distributed at the M pickup points, where M is a positive integer; then determining the at least one route scheme based on a transportation node in the transportation node information, where one route scheme may include at least one transportation route, each of the at least one transportation route includes a freight starting point, a freight ending point, and N of the M pickup points, N is a positive integer and N≤M, and to complete transportation of the to-be-transported goods distributed at the M pickup points, each of the at least one route scheme covers the M pickup points; and allocating the to-be-transported goods for each transportation route in each of the at least one route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
In this implementation of this application, after the target freight bill is obtained, route planning and goods allocation are performed based on information provided in the target freight bill. When the route scheme is determined, the route planning can be directly performed based on the transportation node, to reduce duration for route searching, and improve efficiency of the route planning. After the route planning is performed, goods allocation is then performed based on the planned route scheme, to obtain a goods allocation set for each route scheme. Subsequently, each route scheme and each goods allocation scheme in the goods allocation scheme set corresponding to the route scheme are integrated and evaluated, to obtain the target transportation scheme, so that overall efficiency of obtaining the target transportation scheme can be improved.
With reference to the first implementation of the first aspect of this application, in a second implementation of the first aspect of this application, the determining the at least one route scheme based on the transportation node information may include:
if an amount of historical route data is greater than a first threshold, initializing transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix; determining a transfer probability distribution of the M pickup points based on the hyperparameter matrix, where the transfer probability distribution includes a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and determining each transportation route in each of the at least one route scheme based on the transfer probability distribution, to obtain the at least one route scheme.
In this implementation of this application, the route planning may be performed by using historical route data, and the route planning specifically includes: initializing the transfer hyperparameters of the M pickup points by using the historical route data, and then determining the transfer probability distribution of the pickup points based on the transfer hyperparameters. The probability distribution is a transfer probability of a container in each transportation route in the route scheme between a pickup point and a port. It should be understood that, a larger quantity of times that a jump occurs in the historical route data indicates a higher probability corresponding to the jump. Each transportation route in each of the at least one route scheme can be determined based on the obtained transfer probability distribution of the pickup point, efficiency of obtaining the at least one route scheme can be further improved, and the transfer hyperparameters of the pickup points are calculated by using the historical route data, so that the obtained route scheme can be more accurate.
With reference to the second implementation of the first aspect of this application, in a third implementation of the first aspect of this application, the method may further include:
if the amount of historical route data is not greater than the first threshold, initializing the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
When the amount of the historical route data is insufficient, the transfer hyperparameters of the pickup points may not be initialized by using the historical route data, and a heuristic algorithm may be selected to initialize the transfer hyperparameters of the pickup points, thereby adding a manner of determining the hyperparameters of the pickup points.
With reference to any one of the first implementation of the first aspect of this application to the third implementation of the first aspect of this application, in a fourth implementation of the first aspect of this application, the allocating the to-be-transported goods for each transportation route in each of the at least one route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme may include:
clustering goods that is obtained from the target freight bill and that is at each of the M pickup points based on a clustering condition, to obtain a clustering result, where the clustering condition may include a length, a width, a height, and a weight of the goods, and in addition, the clustering condition may further include a material, a pressure coefficient, a minimum area, or the like; and performing sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, where the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, where the first goods allocation hyperparameter may be an even distribution hyperparameter, or may be obtained by updating a previous goods allocation scheme during repeated goods allocation; and separately selecting a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combining the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
In this implementation of this application, when goods at a pickup point is allocated, clustering may be performed with reference to features of the goods distributed at the pickup point, namely, features including a length, a width, a height, or a weight. Precise clustering may be used, or fuzzy clustering may be used, and adjustment may be made specifically based on an actual requirement, so that the goods at the pickup points can be fast classified, and the goods are fast allocated to obtain each goods allocation scheme in the goods allocation scheme set corresponding to each of the at least one route scheme.
With reference to any one of the first implementation of the first aspect of this application to the fourth implementation of the first aspect of this application, in a fifth implementation of the first aspect of this application, the determining, by using a fast loading model, an actual loading rate of each goods allocation scheme in the first goods allocation set corresponding to each of the at least one route scheme may include:
obtaining a first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, where the first feature vector is used to indicate a feature value of to-be-transported goods in a goods allocation scheme, for example, a vector formed by a length, a width, a height, a weight, or the like of the goods in each goods allocation scheme; and inputting the first feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme into the fast loading model, to obtain the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, where the actual loading rate includes a volume actual loading rate and a weight actual loading rate, the volume actual loading rate includes a proportion of a volume of goods allocated in each transportation route in a load volume of a container in each of the at least one route scheme, and the weight actual loading rate includes a proportion of a weight of goods allocated in each transportation route in a load weight of a container in each of the at least one route scheme.
In this implementation of this application, the first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the obtained at least one route scheme is obtained, the first feature vector is a feature value that indicates a goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, the first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme is input to the fast loading model, the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme may be obtained, and the actual loading rate may include the volume actual loading rate and the weight actual loading rate. Therefore, the first feature vector of each goods allocation scheme may be input to the fast loading model, and the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme can be fast obtained, thereby improving efficiency of obtaining the actual loading rate of each goods allocation scheme.
With reference to the fifth implementation of the first aspect of this application, in a six implementation of the first aspect of this application, the obtaining a first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme may include:
obtaining a second feature vector of each piece of the to-be-transported goods, where the second feature vector of each piece of the to-be-transported goods includes a length, a width, a height, and a weight of the corresponding goods; calculating, based on the second feature vector of each piece of the to-be-transported goods, a third feature vector of goods distributed at each of the M pickup points, for each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme, where the third feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme includes an average value and a covariance of second feature vectors of all pieces of the to-be-transported goods; and performing weighted combination on the third feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme, to obtain the corresponding first feature vector in each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
In this implementation of this application, a specific step of obtaining the first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme may be: first obtaining the second feature vector of each piece of the to-be-transported goods; calculating, based on the second feature vector of each piece of goods, the third feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme at the M pickup points; performing weighting calculation on the third feature vector; and finally obtaining the first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
With reference to any one of the first aspect of this application, or the first implementation of the first aspect of this application to the sixth implementation of the first aspect of this application, in a seventh implementation of the first aspect of this application, the integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to determine a target transportation scheme may include:
calculating scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate; if all the goods allocation schemes include one or more goods allocation schemes scored higher than a second threshold, determining the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and using a route scheme corresponding to the target goods allocation scheme as the target route scheme; and determining the target transportation scheme based on the target goods allocation scheme and the target route scheme.
In this implementation of this application, the preset evaluation function and the actual loading rate may be used to calculate the scores of all the obtained goods allocation schemes to obtain a score of each goods allocation scheme. In all the goods allocation schemes, if there is no goods allocation scheme scored higher than the second threshold, the target goods allocation scheme is determined in goods allocation schemes scored not lower than the second threshold. If there is one goods allocation scheme scored higher than the second threshold, the goods allocation scheme is determined as the target goods allocation scheme. If there are two goods allocation schemes scored higher than the second threshold, one of the at least two goods allocation schemes scored higher than the second threshold may be randomly determined as the target goods allocation scheme or a goods allocation scheme scored the highest may be determined as the target goods allocation scheme, and a route scheme corresponding to the target goods allocation scheme is determined as the target route scheme, to obtain the target transportation scheme. In this implementation of this application, each goods allocation scheme is scored to determine the target goods allocation scheme, and an optimal target transportation scheme can be obtained.
With reference to the seventh implementation of the first aspect of this application, in an eighth implementation of the first aspect of this application, the evaluation function includes:
where {right arrow over (R)} is a route scheme vector, m is a quantity of containers, {right arrow over (rV)} is a volume actual loading rate vector of the m containers, {right arrow over (rW)} is a weight actual loading rate vector of the m containers; α, β, and γ are weight parameters, rVi is a volume actual loading rate of an ith container, rWi is a weight actual loading rate of an ith container,
In this implementation of this application, an evaluation function for evaluating a goods allocation scheme and a route scheme is added, so that an optimal target transportation scheme can be obtained by using the evaluation function.
With reference to the seventh implementation of the first aspect of this application or the eighth implementation of the first aspect of this application, in a ninth implementation of the first aspect of this application, the method further includes:
if all the goods allocation schemes do not include the goods allocation scheme scored higher than the second threshold, performing sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, where each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme; separately selecting a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combining the goods allocation manners, to obtain each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme, where each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme is a scheme of allocating the to-be-transported goods for a corresponding route scheme; and calculating a score of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme by using the evaluation function and the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme, where the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme is obtained by using the fast loading model.
In this implementation of this application, if all the allocation schemes do not include a goods allocation scheme scored higher than the second threshold, the first goods allocation hyperparameter of each pickup point may be updated by using each goods allocation scheme in the first goods allocation scheme set, to obtain the second goods allocation hyperparameter of each pickup point; and then the goods at each pickup point is reallocated based on the second goods allocation hyperparameter, to obtain each goods allocation scheme in the second goods allocation scheme set for each route scheme, and subsequently, each goods allocation scheme in the second goods allocation scheme set is continued to be further integrated and evaluated, until a stopping condition is met. For example, the goods allocation scheme scored higher than the second threshold is obtained, or a quantity of times of iteration reaches a preset quantity. Therefore, in this implementation of this application, repeated allocation and integration and evaluation are performed by using a goods allocation scheme, so that a better target goods allocation scheme and target route scheme can be obtained.
It should be understood that when repeated allocation is performed by using the goods allocation scheme, a route scheme may further be re-planned, or goods may be directly reallocated by using the at least one route scheme.
With reference to any one of the first aspect of this application, or the first implementation of the first aspect of this application to the ninth implementation of the first aspect of this application, in a tenth implementation of the first aspect of this application, after the integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and a goods allocation scheme in each of the at least one route scheme, to determine a target transportation scheme, the method further includes:
determining a type of a container in each transportation route in the target route scheme based on the target goods allocation scheme and the target route scheme; and generating a loading scheme based on the type of the container in each transportation route in the target route scheme and the three-dimensional loading algorithm, where the loading scheme is a loading manner of the to-be-transported goods in the container in each transportation route in the target route scheme.
In this implementation of this application, after the target transportation scheme is determined, the type of the container may further be determined, adjustment may be made based on the actual loading rate, and the type of the container more matching the actual loading rate is determined, to reduce transportation costs. In addition, after the type of the container is determined, a loading scheme may further be generated by using the three-dimensional loading algorithm, and the loading manner of the goods in the container is determined, so that efficiency of loading the goods can be improved.
With reference to any one of the first aspect of this application, or the first implementation of the first aspect of this application to the tenth implementation of the first aspect of this application, in an eleventh implementation of the first aspect of this application, before the integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to determine a target transportation scheme, the method may further include:
if determining, based on the actual loading rate, that L of the M pickup points further include remaining goods not allocated to the container, determining a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, where L≤M, and L is a positive integer; and
the integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to determine a target transportation scheme may include:
integrating and evaluating, based on the actual loading rate, each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to determine the target transportation scheme.
In this implementation of this application, it may be calculated, based on the actual loading rate, whether the to-be-transported goods further includes the remaining goods not allocated to the container, and if there is goods that cannot be loaded into the container, route planning and goods allocation may be performed on the remaining goods, to obtain the route scheme and the goods allocation scheme of the remaining goods; and the route scheme and the goods allocation scheme of the remaining goods, and the target route scheme and the target goods allocation scheme are used as the target transportation scheme, to obtain a complete transportation scheme of the to-be-transported goods.
A second aspect of this application provides a method for training a fast loading model, and the method may include:
first obtaining offline simulation data, where the offline simulation data includes a historical loading scheme and a historical actual loading rate that are calculated through three-dimensional loading during offline simulation; then obtaining a feature vector from the offline simulation data, where the feature vector includes a feature value of historical transportation goods corresponding to the historical loading scheme; converting the feature vector into training data in a preset format; and training a predictive model by using the training data, to obtain a fast loading model, where the fast loading model is used to output an actual loading rate of each goods allocation scheme in a goods allocation scheme set for each transportation route, and the actual loading rate is a proportion of goods loaded into a container in the container in each goods allocation scheme.
In this implementation of this application, the fast loading model may be trained by using the offline simulation data. The fast loading model is used to fast obtain the actual loading rate of the goods allocation scheme, so that efficiency of determining a target transportation scheme can be improved.
With reference to the second aspect of this application, in a first implementation of the second aspect of this application, the preset format is: (a feature vector, a historical actual loading rate).
With reference to the second aspect of this application or the first implementation of the second aspect of this application, in a second implementation of the second aspect of this application, the predictive model may include but is not limited to: a linear regression model, a ridge regression model, an LASSO model, a support vector machine model, a random forest model, an XgBoost model, or an artificial neural network model.
With reference to the second aspect of this application, in the first implementation of the second aspect of this application, or the second implementation of the second aspect of this application, in a third implementation of the second aspect of this application, the obtaining module may include:
first obtaining at least one historical route scheme and a first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, where each of the at least one historical route scheme is a transportation route planned for transporting historical transportation goods, one route scheme may include at least one transportation route, the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme includes at least one goods allocation scheme, and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme is a scheme for allocating the historical transportation goods for the corresponding route scheme; determining, by using a three-dimensional loading algorithm, a loading scheme and an actual loading rate of each goods allocation scheme in the first goods allocation set corresponding to each of the at least one historical route scheme, where the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and integrating and evaluating, based on the actual loading rate, each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, to determine a target transportation scheme, where the target transportation scheme includes a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
In this embodiment of this application, the actual loading rate of the goods allocation scheme corresponding to each route scheme is determined by using the three-dimensional loading algorithm model obtained by training the offline simulation data offline, so that the actual loading rate of the goods allocation scheme corresponding to each route scheme can be accurately obtained, thereby improving accuracy of determining the offline simulation data.
With reference to the second aspect of this application, in a fourth implementation of the second aspect of this application, the obtaining at least one historical route scheme and a first historical goods allocation scheme set corresponding to each of the at least one historical route scheme may include:
first obtaining a historical freight bill, where the historical freight bill includes transportation node information and information about the historical transportation goods, the transportation node information includes a freight starting point, a freight ending point, and M pickup points, and the information about the historical transportation goods includes information about the historical transportation goods distributed at the M pickup points, where M is a positive integer; then determining the at least one historical route scheme based on a transportation node in the transportation node information, where one route scheme may include at least one transportation route, each of the at least one transportation route includes a freight starting point, a freight ending point, and N of the M pickup points, where N is a positive integer and N≤M, and to complete transportation of the historical transportation goods distributed at the M pickup points, and each of the at least one historical route scheme covers the M pickup points; and allocating the historical transportation goods for each transportation route in each of the at least one historical route scheme, to obtain each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme.
In this implementation of this application, after the historical freight bill is obtained, route planning and goods allocation are allocated based on the information provided in the historical freight bill. When the route scheme is determined, the route planning can be directly performed based on the transportation node, duration for route searching can be reduced, and efficiency of the route planning can be improved. After the route planning is completed, the goods allocation is then performed based on the planned route scheme, to obtain a historical goods allocation scheme set for each route scheme. Subsequently, each route scheme and each goods allocation scheme in the historical goods allocation scheme set corresponding to each route scheme are integrated and evaluated, to obtain the target transportation scheme, so that overall efficiency of obtaining the target transportation scheme can be improved.
With reference to the fourth implementation of the second aspect of this application, in a fifth implementation of the second aspect of this application, the determining the at least one historical route scheme based on the transportation node information may include:
if an amount of historical route data is greater than a first threshold, initializing transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix, where the historical route data includes a historical route scheme for transporting the historical to-be-transported goods; determining a transfer probability distribution of the M pickup points based on the hyperparameter matrix, where the transfer probability distribution includes a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and determining each transportation route in each of the at least one historical route scheme based on the transfer probability distribution, to obtain the at least one historical route scheme.
In this implementation of this application, the route planning may be performed by using historical route data, and the route planning specifically includes: initializing the transfer hyperparameters of the M pickup points by using the historical route data, and then determining the transfer probability distribution of the pickup points based on the transfer hyperparameters. The probability distribution is a transfer probability of a container in each transportation route in the route scheme between a pickup point and a port. It should be understood that, a larger quantity of times that a jump occurs in the historical route data indicates a higher probability corresponding to the jump. Each transportation route in each of the at least one historical route scheme can be determined based on the obtained transfer probability distribution of the pickup point, efficiency of obtaining the at least one historical route scheme can be further improved, and the transfer hyperparameters of the pickup points are calculated by using the historical route data, so that the obtained route scheme can be more accurate.
With reference to the fifth implementation of the second aspect of this application, in a sixth implementation of the second aspect of this application, the method may further include:
if the amount of historical route data is not greater than the first threshold, initializing the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
When the amount of the historical route data is insufficient, the transfer hyperparameters of the pickup points may not be initialized by using the historical route data, and a heuristic algorithm may be selected to initialize the transfer hyperparameters of the pickup points, thereby adding a manner of determining the hyperparameters of the pickup points.
With reference to any one of the third implementation of the second aspect of this application to the sixth implementation of the second aspect of this application, in a seventh implementation of the second aspect of this application, the allocating the historical transportation goods for each transportation route in each of the at least one historical route scheme, to obtain each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme may include:
clustering goods that is obtained from the target freight bill and that is at each of the M pickup points based on a clustering condition, to obtain a clustering result, where the clustering condition may include a length, a width, a height, and a weight of the goods, and in addition, the clustering condition may further include a material, a pressure coefficient, a minimum area, or the like; and performing sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, where the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, where the first goods allocation hyperparameter may be an even distribution hyperparameter, or may be obtained by updating a previous goods allocation scheme during repeated goods allocation; and separately selecting a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combining the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme.
In this implementation of this application, when goods at a pickup point is allocated, clustering may be performed with reference to features of the goods distributed at the pickup point, namely, features including a length, a width, a height, or a weight. Precise clustering may be used, or fuzzy clustering may be used, and adjustment may be made specifically based on an actual requirement, so that the goods at the pickup points can be fast classified, and the goods are fast allocated to obtain each goods allocation scheme in the historical goods allocation scheme set corresponding to each of the at least one historical route scheme.
With reference to any one of the second aspect of this application, the third implementation of the second aspect of this application to the sixth implementation of the second aspect of this application, in a seventh implementation of the second aspect of this application, the integrating and evaluating, based on the actual loading rate, each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, to determine a target transportation scheme may include:
calculating scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate; if all the goods allocation schemes include one or more goods allocation schemes scored higher than a second threshold, determining the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and using a route scheme corresponding to the target goods allocation scheme as the target route scheme; and determining the target transportation scheme based on the target goods allocation scheme and the target route scheme.
In this implementation of this application, the preset evaluation function and the actual loading rate may be used to calculate the scores of all the obtained goods allocation schemes to obtain a score of each goods allocation scheme. In all the goods allocation schemes, if there is no goods allocation scheme scored higher than the second threshold, the target goods allocation scheme is determined in the goods allocation scored higher than the second threshold. If there is one goods allocation scheme scored higher than the second threshold, the goods allocation scheme is determined as the target goods allocation scheme. If there are two goods allocation schemes scored higher than the second threshold, one of the at least two goods allocation schemes scored higher than the second threshold may be randomly determined as the target goods allocation scheme or a goods allocation scheme scored the highest may be determined as the target goods allocation scheme, and a route scheme corresponding to the target goods allocation scheme is determined as the target route scheme, to obtain the target transportation scheme. In this implementation of this application, each goods allocation scheme is scored to determine the target goods allocation scheme, and an optimal target transportation scheme can be obtained.
With reference to the seventh implementation of the second aspect of this application, in the eighth implementation of the second aspect of this application, the evaluation function includes:
where {right arrow over (R)} is a route scheme vector, m is a quantity of containers, {right arrow over (rV)} is a volume actual loading rate vector of the m containers, {right arrow over (rW)} is a weight actual loading rate vector of the m containers; α, β, and γ are weight parameters, rVi is a volume actual loading rate of an ith container, rWi is a weight actual loading rate of an ith container,
In this implementation of this application, an evaluation function for evaluating a goods allocation scheme and a route scheme is added, so that an optimal target transportation scheme can be obtained by using the evaluation function.
With reference to the seventh implementation of the second aspect of this application or the eighth implementation of the second aspect of this application, in a ninth implementation of the second aspect of this application, the method further includes:
if all the goods allocation schemes do not include the goods allocation scheme scored higher than the second threshold, performing sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, where each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme; separately selecting a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combining the goods allocation manners, to obtain each goods allocation scheme in the second historical goods allocation scheme set corresponding to each of the at least one historical route scheme, where each goods allocation scheme in the second historical goods allocation scheme set corresponding to each of the at least one historical route scheme is a scheme of allocating the historical transportation goods for a corresponding route scheme; and calculating a score of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme by using the evaluation function and an actual loading rate of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme, where the actual loading rate of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme is obtained by using the three-dimensional loading algorithm.
In this implementation of this application, if all the allocation schemes do not include a goods allocation scheme scored higher than the second threshold, the first goods allocation hyperparameter of each pickup point may be updated by using each goods allocation scheme in the first historical goods allocation scheme set, to obtain the second goods allocation hyperparameter of each pickup point; and then the goods at each pickup point is reallocated based on the second goods allocation hyperparameter, to obtain each goods allocation scheme in the second historical goods allocation scheme set for each route scheme, and subsequently, each goods allocation scheme in the second historical goods allocation scheme set is continued to be further integrated and evaluated, until a stopping condition is met. For example, the goods allocation scheme scored higher than the second threshold is obtained, or a quantity of times of iteration reaches a preset quantity. Therefore, in this implementation of this application, repeated allocation and integration and evaluation are performed by using a goods allocation scheme, so that a better target goods allocation scheme and target route scheme can be obtained.
It should be understood that when repeated allocation is performed by using the goods allocation scheme, a route scheme may further be re-planned, or goods may be directly reallocated by using the at least one historical route scheme.
With reference to any one of the second aspect of this application, the third implementation of the second aspect of this application to the ninth implementation of the second aspect of this application, in a tenth implementation of the second aspect of this application, before the integrating and evaluating, based on the actual loading rate, each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, to determine a target transportation scheme, the method may further include:
if determining, based on the actual loading rate, that L of the M pickup points further include remaining goods not allocated to the container, determining a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, where L≤M, and L is a positive integer; and
the integrating and evaluating, based on the actual loading rate, each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, to determine a target transportation scheme may include:
integrating and evaluating, based on the actual loading rate, each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to determine the target transportation scheme.
In this implementation of this application, it may be calculated, based on the actual loading rate, whether the historical transportation goods further includes the remaining goods not allocated to the container, and if there is goods that cannot be loaded into the container, route planning and goods allocation may be performed on the remaining goods, to obtain the route scheme and the goods allocation scheme of the remaining goods; and the route scheme and the goods allocation scheme of the remaining goods, and the target route scheme and the target goods allocation scheme are used as the target transportation scheme, to obtain a complete transportation scheme of the historical goods.
A third aspect of this application provides a determining apparatus, including:
an obtaining module, configured to obtain at least one route scheme and a first goods allocation scheme set corresponding to each of the at least one route scheme, where each of the at least one route scheme is a transportation route planned for transporting to-be-transported goods, the first goods allocation scheme set corresponding to each of the at least one route scheme includes at least one goods allocation scheme, and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme is a scheme for allocating the to-be-transported goods for the corresponding route scheme;
a fast loading module, configured to determine, by using a fast loading model, an actual loading rate of each goods allocation scheme in the first goods allocation set corresponding to each of the at least one route scheme, where the fast loading model is obtained by training offline simulation data offline, the offline simulation data includes a historical loading scheme calculated by using a three-dimensional loading algorithm, and the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and
an evaluation module, configured to integrate and evaluate, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to determine a target transportation scheme, where the target transportation scheme includes a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
With reference to the third aspect of this application, in a first implementation of the third aspect of this application, the obtaining module includes:
an obtaining submodule, configured to obtain a target freight bill, where the target freight bill includes transportation node information and to-be-transported goods information, the transportation node information includes a freight starting point, a freight ending point, and M pickup points, and the to-be-transported goods information includes information about to-be-transported goods distributed at the M pickup points, where M is a positive integer;
a route planning submodule, configured to determine the at least one route scheme based on the transportation node information, where each of the at least one route scheme includes at least one transportation route, each of the at least one transportation route includes a freight starting point, a freight ending point, and N of the M pickup points, and each of the at least one route scheme covers the M pickup points, where N is a positive integer and N≤M; and
a goods allocation submodule, configured to allocate the to-be-transported goods for each transportation route in each of the at least one route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
With reference to the first implementation of the third aspect of this application, in a second implementation of the third aspect of this application, the route planning submodule is specifically configured to:
if an amount of historical route data is greater than a first threshold, initialize transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix;
determine a transfer probability distribution of the M pickup points based on the hyperparameter matrix, where the transfer probability distribution includes a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and
determine each transportation route in each of the at least one route scheme based on the transfer probability distribution, to obtain the at least one route scheme.
With reference to the first implementation of the third aspect of this application or the second implementation of the third aspect of this application, in a third implementation of the third aspect of this application, the determining apparatus further includes:
an initialization module, configured to: if the amount of historical route data is not greater than the first threshold, initialize the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
With reference to any one of the first implementation of the third aspect of this application to the third implementation of the third aspect of this application, in a fourth implementation of the third aspect of this application, the goods allocation submodule is specifically configured to:
cluster goods at each of the M pickup points based on a clustering condition, to obtain a clustering result, where the clustering condition includes a length, a width, a height, and a weight of the goods;
perform sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, where the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme; and
separately select a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combine the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
With reference to any one of the first implementation of the third aspect of this application to the fourth implementation of the third aspect of this application, in a fifth implementation of the third aspect of this application, the fast loading module is specifically configured to:
obtain a first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, where the first feature vector is used to indicate a feature value of to-be-transported goods in a goods allocation scheme; and
input the first feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme into the fast loading model, to obtain the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, where the actual loading rate includes a volume actual loading rate and a weight actual loading rate, the volume actual loading rate includes a proportion of a volume of goods allocated in each transportation route in a load volume of a container in each of the at least one route scheme, and the weight actual loading rate includes a proportion of a weight of goods allocated in each transportation route in a load weight of a container in each of the at least one route scheme.
With reference to the fifth implementation of the third aspect of this application, in a sixth implementation of the third aspect of this application, the fast loading module is specifically configured to:
obtain a second feature vector of each piece of the to-be-transported goods, where the second feature vector of each piece of the to-be-transported goods includes a length, a width, a height, and a weight of the corresponding goods;
calculate, based on the second feature vector of each piece of the to-be-transported goods, a third feature vector of goods distributed at each of the M pickup points, for each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme, where the third feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme includes an average value and a covariance of second feature vectors of all pieces of the to-be-transported goods; and
perform weighted combination on the third feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme, to obtain the corresponding first feature vector in each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
With reference to any one of the third aspect of this application, and the first implementation of the third aspect of this application to the sixth implementation of the third aspect of this application, in a seventh implementation of the third aspect of this application, the evaluation module is specifically configured to:
calculate scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate;
if all the goods allocation schemes include one or more goods allocation schemes scored higher than a second threshold, determine the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and use a route scheme corresponding to the target goods allocation scheme as the target route scheme; and
determine the target transportation scheme based on the target goods allocation scheme and the target route scheme.
With reference to the seventh implementation of the third aspect of this application, in an eighth implementation of the third aspect of this application, the evaluation function includes:
where {right arrow over (R)} is a route scheme vector, m is a quantity of containers, {right arrow over (rV)} is a volume actual loading rate vector of the m containers, {right arrow over (rW)} is a weight actual loading rate vector of the m containers; α, β, and γ are weight parameters, rVi is a volume actual loading rate of an ith container, rWi is a weight actual loading rate of an ith container,
With reference to the seventh implementation of the third aspect of this application or the eighth implementation of the third aspect of this application, in a ninth implementation of the third aspect of this application, the evaluation module is further configured to:
if all the goods allocation schemes do not include the goods allocation scheme scored higher than the second threshold, perform sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, where each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme;
separately select a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combine the goods allocation manners, to obtain each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme, where each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme is a scheme of allocating the to-be-transported goods for a corresponding route scheme; and
calculate a score of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme by using the evaluation function and the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme, where the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme is obtained by using the fast loading model.
With reference to any one of the third aspect of this application, the first implementation of the third aspect of this application to the ninth implementation of the third aspect of this application, in the tenth implementation of the third aspect of this application, the determining apparatus further includes:
a post-processing module, configured to: after each of the at least one route scheme and the goods allocation scheme for each of the at least one route scheme are integrated and evaluated based on the actual loading rate to determine the target transportation scheme, determine a type of a container in each transportation route in the target route scheme based on the target goods allocation scheme and the target route scheme; and
a three-dimensional loading module, configured to generate a loading scheme based on the type that is of the container in each transportation route in the target route scheme and that is determined by the post-processing module, and the three-dimensional loading algorithm, where the loading scheme is a loading manner of the to-be-transported goods in the container in each transportation route in the target route scheme.
With reference to any one of the third aspect of this application, the first implementation of the third aspect of this application to the tenth implementation of the third aspect of this application, in the eleventh implementation of the third aspect of this application, the determining apparatus may further include:
a determining module, configured to: before each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme are integrated and evaluated based on the actual loading rate to determine the target transportation scheme, if determining, based on the actual loading rate, that L of the M pickup points further include remaining goods not allocated to the container, determine a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, where L≤M, and L is a positive integer, where
the evaluation module is further configured to integrate and evaluate, based on the actual loading rate, each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to determine the target transportation scheme.
A fourth aspect of this application provides a training apparatus, including:
an obtaining module, configured to obtain offline simulation data, where the offline simulation data includes a historical loading scheme and a historical actual loading rate that are calculated through three-dimensional loading, where
the obtaining module is further configured to obtain a feature vector from the offline simulation data, where the feature vector includes a feature value of historical transportation goods corresponding to the historical loading scheme;
a conversion module, configured to convert the feature vector into training data in a preset format; and
a training module, configured to train a predictive model by using the training data, to obtain a fast loading model, where the fast loading model is used to output an actual loading rate of each goods allocation scheme in a goods allocation scheme set for each transportation route, and the actual loading rate is a proportion of goods loaded into a container in the container in each goods allocation scheme.
With reference to the fourth aspect of this application, in a first implementation of the fourth aspect of this application, the preset format is: (a feature vector, a historical actual loading rate).
With reference to the fourth aspect of this application or the first implementation of the fourth aspect of this application, in a second implementation of the fourth aspect of this application, the predictive model includes: a linear regression model, a ridge regression model, an LASSO model, a support vector machine model, a random forest model, an XgBoost model, or an artificial neural network model.
With reference to the fourth aspect of this application, in the first implementation of the fourth aspect of this application, or the second implementation of the fourth aspect of this application, in a third implementation of the fourth aspect of this application, the obtaining module may include:
an obtaining submodule, configured to obtain at least one historical route scheme and a first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, where each of the at least one historical route scheme is a transportation route planned for transporting historical transportation goods, the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme includes at least one historical goods allocation scheme, and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme is a scheme for allocating the historical transportation goods for the corresponding route scheme;
a three-dimensional loading submodule, configured to determine, by using a three-dimensional loading algorithm, an actual loading rate of each goods allocation scheme in the first goods allocation set corresponding to each of the at least one historical route scheme, where the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and
an evaluation submodule, configured to integrate and evaluate, based on the actual loading rate, each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, to determine a target transportation scheme, where the target transportation scheme includes a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
In this embodiment of this application, the three-dimensional loading algorithm may be used for calculation during training of the fast loading model, to obtain a historical loading scheme corresponding to the historical route scheme, so that the actual loading rate of the goods allocation scheme corresponding to the historical route scheme can be accurately output.
With reference to the third implementation of the fourth aspect of this application, in a fourth implementation of the fourth aspect of this application, the obtaining submodule includes:
an obtaining unit, configured to obtain a historical freight bill, where the historical freight bill includes transportation node information and information about the historical transportation goods, the transportation node information includes a freight starting point, a freight ending point, and M pickup points, and the information about the historical transportation goods includes information about the historical transportation goods distributed at the M pickup points, where M is a positive integer;
a route planning unit, configured to determine the at least one historical route scheme based on the transportation node information, where each of the at least one historical route scheme includes at least one transportation route, each of the at least one transportation route includes a freight starting point, a freight ending point, and N of the M pickup points, and each of the at least one historical route scheme covers the M pickup points, where N is a positive integer and N≤M; and
a goods allocation unit, configured to allocate the historical transportation goods for each transportation route in each of the at least one historical route scheme, to obtain each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme.
With reference to the third implementation of the fourth aspect of this application, in a fifth implementation of the fourth aspect of this application, the route planning unit is specifically configured to:
if an amount of historical route data is greater than a first threshold, initialize transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix;
determine a transfer probability distribution of the M pickup points based on the hyperparameter matrix, where the transfer probability distribution includes a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and
determine each transportation route in each of the at least one historical route scheme based on the transfer probability distribution, to obtain the at least one historical route scheme.
With reference to the fourth implementation of the fourth aspect of this application, in a sixth implementation of the fourth aspect of this application, the training apparatus further includes:
an initialization module, configured to: if the amount of historical route data is not greater than the first threshold, initialize the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
With reference to any one of the third implementation of the fourth aspect of this application to the fifth implementation of the fourth aspect of this application, in a sixth implementation of the fourth aspect of this application, the goods allocation unit is specifically configured to:
cluster goods at each of the M pickup points based on a clustering condition, to obtain a clustering result, where the clustering condition includes a length, a width, a height, and a weight of the goods;
perform sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, where the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme; and
separately select a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combine the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme.
With reference to any one of the third implementation of the fourth aspect of this application to the sixth implementation of the fourth aspect of this application, in a seventh implementation of the fourth aspect of this application, the evaluation submodule is specifically configured to:
calculate scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate;
if all the goods allocation schemes include one or more goods allocation schemes scored higher than a second threshold, determine the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and use a route scheme corresponding to the target goods allocation scheme as the target route scheme; and
determine the target transportation scheme based on the target goods allocation scheme and the target route scheme.
With reference to the seventh implementation of the fourth aspect of this application, in an eighth implementation of the fourth aspect of this application, the evaluation function includes:
where {right arrow over (R)} is a route scheme vector, m is a quantity of containers,
With reference to the sixth implementation of the fourth aspect of this application or the seventh implementation of the fourth aspect of this application, in an eleventh implementation of the fourth aspect of this application, the evaluation submodule is further configured to:
if all the goods allocation schemes do not include the goods allocation scheme scored higher than the second threshold, perform sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, where each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme;
separately select a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combine the goods allocation manners, to obtain each goods allocation scheme in the second historical goods allocation scheme set corresponding to each of the at least one historical route scheme, where each goods allocation scheme in the second historical goods allocation scheme set corresponding to each of the at least one historical route scheme is a scheme of allocating the historical transportation goods for a corresponding route scheme; and
calculate a score of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme by using the evaluation function and an actual loading rate of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme, where the actual loading rate of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme is obtained by using the three-dimensional loading submodel.
It should be understood that when allocation is repeatedly performed by using the goods allocation scheme, a route scheme may further be re-planned, or goods may be directly reallocated by using the at least one historical route scheme.
With reference to any one of the fourth aspect of this application, and the third implementation of the fourth aspect of this application to the eleventh implementation of the fourth aspect of this application, in a twelfth implementation of the fourth aspect of this application, the training apparatus further includes:
a determining module, configured to: before each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme are integrated and evaluated based on the actual loading rate to determine the target transportation scheme, if determining, based on the actual loading rate, that L of the M pickup points further include remaining goods not allocated to the container, determine a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, where L≤M, and L is a positive integer, where
the evaluation submodule is further configured to integrate and evaluate, based on the actual loading rate, each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to determine the target transportation scheme.
A fifth aspect of this application provides a determining apparatus, and the determining apparatus may include:
a processor, a memory, a bus, and an input/output interface, where the processor, the memory, and the input/output interface are connected by using the bus;
the memory is configured to store program code; and
when invoking the program code in the memory, the processor performs the steps of the method provided in the first aspect of this application.
A sixth aspect of this application provides a training apparatus, and the training apparatus may include:
a processor, a memory, a bus, and an input/output interface, where the processor, the memory, and the input/output interface are connected by using the bus;
the memory is configured to store program code; and
when invoking the program code in the memory, the processor performs the steps of the method provided in the second aspect of this application.
A seventh aspect of the embodiments of this application provides a storage medium, where the storage medium stores a programmable instruction, and when the programmable instruction is run on a computer, the computer is enabled to perform the method described in any one of the first aspect or the implementations of the first aspect.
The storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (English acronym: ROM, English full name: Read-Only Memory), a random access memory (English acronym: RAM, English full name: Random Access Memory), a magnetic disk, or an optical disc.
An eighth aspect of the embodiments of this application provides a storage medium, where the storage medium stores a programmable instruction, and when the programmable instruction is run on a computer, the computer is enabled to perform the method described in any one of the second aspect or the implementations of the second aspect. The storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (English acronym: ROM, English full name: Read-Only Memory), a random access memory (English acronym: RAM, English full name: Random Access Memory), a magnetic disk, or an optical disc.
A ninth aspect of the embodiments of this application provides a computer program product, where the computer program product includes a computer software instruction, and the computer software instruction may be loaded by a processor to implement the procedure in the method for determining a transportation scheme in the first aspect.
A tenth aspect of the embodiments of this application provides a computer program product, where the computer program product includes a computer software instruction, and the computer software instruction may be loaded by a processor to implement the procedure in the method for training a fast loading model in the second aspect.
An eleventh aspect of the embodiments of this application provides a simulation system, including a determining apparatus and a training apparatus, where the determining apparatus is configured to perform steps in any one of the first aspect and the implementations of the first aspect of this application; and the training apparatus performs the steps in any one of the second aspect and the implementations of the second aspect of this application.
It can be learned from the foregoing technical solutions that the embodiments of this application have the following advantages:
When the target transportation scheme is determined, the actual loading rate of the goods allocation scheme corresponding to each route scheme can be obtained by using the fast loading model, and then, the target transportation scheme is determined based on the actual loading rate. The fast loading model is obtained by training the offline simulation data offline, the offline simulation data is a historical loading scheme obtained through three-dimensional calculation, the actual loading rate of the goods allocation scheme can be fast obtained by using the fast loading model, a loading manner can be obtained without a need of performing the three-dimensional operation, and the actual loading rate can be directly calculated, so that the actual loading rate of the goods allocation scheme can be fast obtained, and duration required for obtaining the actual loading rate can be reduced, thereby improving efficiency of obtaining the target transportation scheme.
Embodiments of this application provide a method for determining a transportation scheme, a method for training a fast loading model, and a device that are used for goods transportation, to fast obtain a target transportation scheme, reduce transportation costs, and improve transportation efficiency especially when a transportation volume is large and a situation is complex.
With development of logistics industry, goods transportation is widely used in industry and life, and container loading simulation is a core problem in the logistics field. In this case, high efficiency and accuracy need to be achieved for the container loading simulation. High efficiency means that a quick response can be made, and a loading result can be output in a short time by using input data. Therefore, a logistics resource can be preferentially preempted, a delivery time can be shortened, and timely transportation and delivery of goods can be ensured. Accuracy means that an output loading result is valid, so that utilization of a container can be improved, and transportation costs can be reduced.
A scenario applied to the embodiments of this application may be shown in
For example, in the target freight bill, it is required that goods at D1, D2, D3, and D4 be transported to the port 2, and it can be determined that a route scheme is that: a container 1 departs from the port 1, passes through D1 and D3, picks-up goods of D1 and D3, and then arrives at the port 2. After calculation, a volume actual loading rate of the container 1 is 95%, and a weight actual loading rate is 96%. A container 2 departs from the port 1, passes through D2 and D4, transports goods of D2 and D4, and then arrives at the port 2. After calculation, a volume actual loading rate of the container 2 is 97%, and a weight actual loading rate is 98%. Therefore, an optimal route for goods transportation can be obtained by using the method for determining a transportation scheme provided in the embodiments of this application, and the volume actual loading rate and the weight actual loading rate of the container are improved.
A procedure of the method for determining a transportation scheme provided in the embodiments of this application is described below. Referring to
201. Obtain a target freight bill.
The target freight bill is a freight bill of to-be-transported goods, the target freight bill includes a transportation node and to-be-transported goods information, and the transportation node includes a port and M pickup points. The port may include a freight starting point and a freight ending point for transporting the to-be-transported goods, and the freight starting point and the freight ending point may be a same port, or may be different ports. The to-be-transported goods are distributed at various pickup points of the M pickup points. There may be one or more ports, and there may be one or more M pickup points. Details are not limited herein. In actual application, the freight bill of the to-be-transported goods may be input by a user, or may be generated by an actual transportation system.
202. Plan a transportation route based on a transportation node, to obtain a route scheme set.
After the target freight bill is obtained, the freight starting point and the freight ending point for transportation, and the pickup points at which the to-be-transported goods are distributed may be determined by using the target freight bill, the transportation route may be planned based on historical route data to obtain at least one route scheme, each of the at least one route scheme may include at least one transportation route, that is, a plurality of transportation routes form a complete route scheme, the at least one route scheme forms a route scheme set, and the route scheme set includes the at least one route scheme. One transportation route may correspond to one container. If a plurality of containers are required for completing transportation of the to-be-transported goods, transportation routes of the plurality of containers can be determined, and if goods at one pickup point cannot be transported by using one container, the plurality of containers may be used for transportation. Therefore, one pickup point may be passed through by a plurality of containers. For example, a requirement in the target freight bill is to transport goods of pickup points D1, D2, D3, and D4 to a port 2. A container departs from a port 1, a transfer hyperparameter of a pickup point may be initialized, then, a pickup point transfer probability may be obtained by using the transfer hyperparameter of the pickup point, a transfer probability between pickup points, or between a port and a pickup point is determined, and a plurality of transportation routes may be obtained based on the pickup point transfer probability and include at least one transportation route from the port 1 to D1, D2, D3, and D4, and to the port 2, or at least one route scheme from the port 1 to D2, D1, D4, and D3, to the port 2 and the like. The at least one transportation route may form at least one route scheme, and the at least one route scheme forms a route scheme set.
Specifically, the target freight bill includes the transportation node and the information about to-be-transported goods distributed at the M pickup points. The transportation node includes ports and the M pickup points. M is a positive integer, and the port includes the freight starting point and the freight ending point. The freight starting point and the freight ending point may be a same port, or may be different ports. Route planning is performed based on the transportation node, to obtain the route scheme set. The route scheme set includes the at least one route scheme, and each of the at least one route scheme includes at least one transportation route. Using a route scheme as an example, the route scheme includes at least one transportation route, all transportation routes in the route scheme cover the M pickup points, and one transportation route in the route scheme may cover L of the M pickup points, where L≤M.
In actual application, a planned route may be adjusted based on the historical route data or a preset weight. For example, a transfer probability between a port and a pickup point or between pickup points may be obtained based on a historical route scheme, that is, a transfer probability between pickup points may alternatively be initialized through random distribution or even distribution, and then, each transportation route in each route scheme in a route scheme set is generated based on the transfer probability between the pickup points. Compared with a scheme in the prior art in which a route scheme is obtained through searching by using a rule, in this embodiment of this application, each route scheme in the route scheme set can be quickly generated based on the transfer probability between the pickup points, thereby improving efficiency of obtaining the route scheme.
Each route scheme in the route scheme set may further need to be compared in detail, to determine a most suitable route scheme. Conditions of determining the most suitable route scheme may include a route length, an actual loading rate of a container in a route scheme, or a difference between a volume actual loading rate and a weight actual loading rate of a container in a route scheme. A shorter route indicates a better route scheme. A greater actual loading rate of the container in the route scheme indicates a better route scheme. A smaller difference between the volume actual loading rate and the weight actual loading rate of the container in the route scheme indicates a better route scheme.
203. Perform goods allocation based on the route scheme set, to obtain a goods allocation scheme set for each route scheme in the route scheme set.
The route scheme set includes the at least one route scheme, and therefore, goods allocation needs to be further performed for each of the at least one route scheme. That goods allocation is performed for each transportation route in each route scheme in the route scheme set means that the to-be-transported goods are allocated to a container corresponding to each transportation route in each route scheme, to obtain the goods allocation scheme set for each of the at least one route scheme, namely, the first goods allocation scheme set.
Specifically, during the goods allocation, since there are different types of goods, and distribution probabilities of the different types of goods may vary, the goods allocation cannot be simply performed by using a distribution algorithm, and the goods allocation needs to be defined by calculating actual probability distributions of the different types of goods. In this embodiment of this application, before the goods allocation is performed, goods of each pickup point may be clustered first, and then for a same type of goods, a probability distribution is used to determine an allocation manner. A reference condition of clustering may be a length, a width, a height, a weight, a minimum contact area, a material, a bearing coefficient, or the like of the goods. To improve efficiency, the clustering may be performed by using some conditions. For example, the clustering may be performed by using the length, the width, the height, and the weight. The clustering may include precise clustering and fuzzy clustering. In this embodiment of this application, for example, clustering is performed by using the length, the width, the height, and the weight. The precise clustering may be classifying four pieces of goods having completely same features into one category. The clustering is a small granularity-based clustering manner, and a clustering speed is high. The clustering is performed in this way, and accuracy of goods allocation can be improved. When a quantity of categories of goods generated through the precise clustering is excessively large, evaluation and operation costs of one scheme, that is, one route scheme are increased, and the increase in the evaluation and operation costs includes an increase in operation time, a decrease in operation efficiency, and the like. Therefore, when the quantity of categories obtained through the precise clustering is greater than a preset threshold, a clustering operation may alternatively be performed by using clustering algorithms such as K-means (k-means) clustering, a Gaussian mixture model, or a hierarchical clustering method. Therefore, for goods at each pickup point, a distribution of each category can be obtained by using a clustering algorithm, and each goods allocation scheme in the goods allocation scheme set corresponding to each of the at least one route scheme is obtained based on the distribution of each category.
204. Determine an actual loading rate of each goods allocation scheme by using a fast loading model.
After the goods allocation scheme of each of the at least one route scheme is determined, the actual loading rate of each of the at least one route scheme may be determined by using the fast loading model, and the actual loading rate may include a volume actual loading rate and a weight actual loading rate. The fast loading model is obtained through offline training by using the offline simulation data, and the offline simulation data may be a historical loading scheme calculated through three-dimensional loading. The volume actual loading rate is a proportion of goods allocated to a container relative to a load volume of the container, and the weight actual loading rate is a proportion of goods allocated to a container relative to a load weight of the container.
In actual application, a feature may be extracted from the historical loading scheme, the offline simulation data is converted into training data in a preset format, then a predictive model is trained by using the training data, and the predictive model may be used to predict a loading scheme of the to-be-transported goods, to output the actual loading rate. Compared with the prior art in which three-dimensional loading is used for online calculation, the fast loading model in this embodiment of this application can fast output the actual loading rate of each of the at least one route scheme, thereby improving efficiency of obtaining the target transportation scheme.
205. Integrate and evaluate, based on the actual loading rate, each route scheme and the goods allocation scheme corresponding to each route scheme, to determine a target transportation scheme.
After the goods allocation scheme of each route scheme in the goods allocation scheme set is obtained, each of the at least one route scheme and a corresponding goods allocation scheme need to be comparatively evaluated, to select a target route scheme, that is, the target route scheme in each of the at least one route scheme. A specific evaluation manner may be that: the shorter distance of a route scheme, the better; the higher actual loading rate of a container, the better; and the smaller difference between a volume actual loading rate and a weight actual loading rate of a container, the better. Based on different conditions including a length of the route scheme, the actual loading rate of the container, and the difference between the volume actual loading rate and the weight actual loading rate of the container, the target route scheme and a corresponding target goods allocation scheme, that is, the target transportation scheme, can be determined through collaborative evaluation. The target transportation scheme may include an optimal or second optimal transportation scheme corresponding to the target freight bill.
In actual application, iterative route planning, goods allocation, fast loading, and integration and evaluation may be performed on the route scheme in the route solution set. After a stopping condition is met, for example, after a quantity of iteration times reaches a threshold, or after an optimal route scheme and goods allocation scheme are obtained, the target transportation scheme is output.
In this embodiment of this application, after a target freight bill is obtained, route planning is performed based on the target freight bill, and a route scheme set can be obtained. The route scheme set includes at least one route scheme, each of the at least one route scheme includes at least one transportation route, that is, the at least one transportation route forms a complete route scheme, and goods allocation is performed for each transportation route in each route scheme in the route scheme set, to obtain a goods allocation scheme for each of the at least one route scheme. Compared with the prior art in which a large quantity of times of route searching are performed by using a Tabu search method, in this embodiment of this application, a quantity of times of route searching can be reduced, and efficiency of obtaining a route scheme can be improved. Subsequently, an actual loading rate of each route scheme in the goods allocation scheme set is fast output by using a fast loading model, where the actual loading rate includes a volume actual loading rate and a weight actual loading rate, and then integration and evaluation are performed on the goods allocation scheme and each of the at least one route scheme in the route scheme set, to obtain a target route scheme and a target goods allocation scheme corresponding to the target route scheme. The target route scheme and the target goods allocation scheme form a target transportation scheme. The fast loading model is obtained training the offline simulation data, and the offline simulation data includes a historical loading scheme calculated through three-dimensional loading. Compared with the prior art in which a loading scheme is obtained in an online operation through three-dimensional loading, in this embodiment of this application, the actual loading rate can be fast output, and each of the at least one route scheme and the corresponding goods allocation scheme are integrated and evaluated based on the actual loading rate, to obtain the target transportation scheme, so that efficiency of obtaining the target route scheme and the target goods allocation scheme, that is, determining the target transportation scheme can be improved.
The foregoing describes the procedure of the method for determining a transportation scheme in the embodiments of this application, and the following describes more detail the method for determining a transportation scheme in the embodiments of this application.
A procedure of the method for determining a transportation scheme may be: After a target freight bill is received 301, a hyperparameter is initialized 302, and a transfer hyperparameter of a pickup point is initialized; after the transfer hyperparameter of the pickup point is initialized, a pickup point transfer probability distribution can be obtained based on the transfer hyperparameter of the pickup point, and route planning 303 is performed based on the pickup point transfer probability distribution, to obtain a route scheme set; then, goods allocation 304 is performed for each route scheme in the route scheme set, to obtain a goods allocation scheme set for each route scheme in the route scheme set; then, fast loading 306 is performed, fast goods loading is performed for the route scheme and the goods allocation scheme to output an actual loading rate, and scheme evaluation 305 is performed, to integrate and evaluate the route scheme and the goods allocation scheme; and the route scheme set and the goods allocation scheme are further integrated and evaluated to obtain the target route scheme and the corresponding target goods allocation scheme, that is, a simulation result 309. The fast loading model in the fast loading step is obtained by training the offline simulation data 308 offline that is obtained through offline simulation 307. In actual application, step 303 to step 306 may be repeatedly performed, to repeatedly explore a route scheme and explore a goods allocation scheme until a stopping condition is met, to obtain the target route scheme and the corresponding target goods allocation scheme. Alternatively, one route scheme in the route scheme set and a corresponding goods allocation scheme may be directly used as the target route scheme and the corresponding target goods allocation scheme. Adjustment may be specifically made based on an actual design requirement, and details are not limited herein.
The following specifically describes the steps in this embodiment of this application.
301. Target freight bill.
First, a target freight bill is obtained 301, and a transportation node and to-be-transported goods may be learned of from the target freight bill. The transportation node includes a port and a pickup point, and the to-be-transported goods are distributed at each pickup point. The port may include a freight starting point and a freight ending point, the freight starting point and the freight ending point may be a same port, or may be different ports. For example, the target freight bill may indicate that a port 1 is the freight starting point, and to-be-transported goods distributed at a pickup point 1 and a pickup point 2 are to be transported to a port 2.
302. Hyperparameter initialization.
Subsequently, a transfer hyperparameter of a pickup point is initialized, a pickup point transfer probability distribution is obtained based on the initialized transfer hyperparameter of the pickup point, and the pickup point transfer probability distribution includes a transfer probability of a container from a port to a pickup point or between pickup points, for example, a transfer probability from a pickup point D1 to a pickup point D2.
In actual application, a specific procedure of the Bayesian estimation algorithm may be as follows: A prior distribution is first allocated to a to-be-estimated estimator, then a posterior distribution is calculated based on the Bayesian formula with reference to experimental data, and then an estimated value of the to-be-estimated estimator is obtained based on the posterior distribution. Therefore, in the method for determining a goods allocation scheme in this embodiment of this application, the transfer hyperparameter of the pickup point may be calculated by using the Bayesian estimation algorithm. The prior distribution may be obtained based on historical data or user experience. In an actual service system, a large amount of historical route data is accumulated, a large quantity of samples of to-be-estimated estimators may be extracted from the historical route data, and the hyperparameter is estimated by using these samples. The historical route data may be used as prior data. In addition, in actual application, the prior data may be adjusted based on experience of an actual scheduler. However, when the quantity of the samples of the to-be-estimated estimators obtained from the historical route data is lower than a preset threshold, the hyperparameter cannot be estimated, and a heuristic algorithm may be used for estimation. The following separately describes in detail the Bayesian estimation algorithm and the heuristic algorithm that can be used in this embodiment of this application.
1. Bayesian Estimation Algorithm.
A prior distribution may be generated by sampling a polynomial distribution, a binomial distribution, or the like. For example, when the target freight bill includes k pickup points D1, D2, D3, . . . , and Dk and a port, a transfer probability from the port to the pickup points is a polynomial distribution: a parameter θ=(θ1, θ2, . . . , θk), and the transfer probability from the port to the pickup points is shown in
Each piece of historical route data may indicate a historical transportation route. For example, there is a piece of historical route data: Port→D1→D3→D6→Port which indicates that a transportation route is: departing from a port, successively passing through D1, D3, and D6 and then returning to the port. A specific initialization procedure may include the following steps: first, selecting a pickup point or a port in the target freight bill as the current starting point, sifting out the historical route data, and if there are k pickup points in the freight bill, determining (k+1) pieces of historical route data. For example, if a port is selected as the current starting point, use of any pickup point in the freight bill as the current jump point can form a valid transfer mode, and there needs to be at least one corresponding valid transfer mode in the historical route data sifted out. For example, in the target freight bill, if a route from a port to D1 is selected, at least one route in the historical route data sifted out includes a route from the port to D1. As shown in
The historical route data sifted out is arranged in a preset order, and S pieces of historical route data are sequentially selected based on a preset window size. As shown in
Statistics on a quantity of times that a valid transfer mode occurs is separately collected in historical route data of each window, and based on this, a parameter of a corresponding polynomial distribution is calculated. Assuming that there are t windows, where t≥Nmin, t samples of θ can be obtained. A specific counting process may be shown in
After statistics on historical route data of all windows are collected, maximum likelihood estimation is performed based on the obtained t samples of θ, to calculate an estimated value of the hyperparameter α.
2. Heuristic Algorithm.
If a quantity of historical routes in a current window is less than a preset threshold Nmin, a hyperparameter may be calculated by using the heuristic algorithm. If there are k pickup points in the target freight bill, using one pickup point Di thereof as an example, a total volume of goods is Vi, a total weight is Wi, a maximum loading volume of a container is V, and a maximum weight is W.
A specific algorithm procedure of the heuristic algorithm may include the following steps.
First, a minimum quantity of cars required for loading all goods of the pickup point Di is calculated. Herein, one car is considered as one container, where min_car=(Vi/V,Wi/W). After the minimum quantity of cars min_car is calculated, the minimum quantity of cars is rounded up.
Then, an energy coefficient PDi of the pickup point Di is calculated, and the energy coefficient is a hyperparameter of a polynomial distribution corresponding to the pickup point, where
If there is no bonded warehouse, where the bonded warehouse is a warehouse from which goods can be transported out after taxes are paid, and is only accessible to an empty container, the hyperparameter of the polynomial distribution corresponding to the pickup point Di is:
αDi=(PD
A hyperparameter of a polynomial distribution corresponding to a port is: αPort=(PD
In an actual scenario, a bonded warehouse may also exist at a pickup point. If the bonded warehouse exists at the pickup point, assuming that the bonded warehouse is Di, the hyperparameter of the polynomial distribution corresponding to the port is set to: αPort=(ε(1), . . . , ε(i−1), 1, ε(i+1), the hyperparameter corresponding to the pickup point Di is 1, hyperparameters of other pickup points may be set to ε, and ε corresponding to the other pickup points may be set to a very small number, for example, 0.00001 or 0.0000001.
In actual application, a large amount of high-quality historical route data is accumulated, and a valid data basis may be provided for hyperparameter initialization. In the method for determining a transportation scheme provided in this embodiment of this application, hyperparameter initialization may be performed by using the historical route data, a more accurate route scheme may be obtained by using the historical route data, and in addition, efficiency of obtaining a route scheme subsequently can be improved.
303. Route planning.
After the transfer hyperparameter of the pickup point is initialized, route planning is performed. A transportation route needs to be planned to determine a route scheme and a quantity of containers for transportation. After the hyperparameter is initialized, a pickup point transfer hyperparameter matrix may be obtained. A pickup point transfer probability matrix may be generated by using the pickup point transfer hyperparameter matrix, and the pickup point transfer probability matrix includes a probability distribution of transferring between a port and a pickup point, or between pickup points. A transfer probability is a transfer probability from one port to one pickup point or from one pickup point to another pickup point, and may be obtained based on the historical route data. For example, as shown in
After the transfer probability matrix is obtained, a route scheme set, that is, a route scheme group, is generated through sampling. An example of obtaining a route scheme through sampling is shown in
A probability Pi of selecting each route scheme may be calculated, i indicates an ith scheme, namely, a route scheme, each of the at least one route scheme may be evaluated by using the evaluation function, and a specific formula for calculating a probability of a scheme is:
j represents a jth scheme, ri represents a total quantity of schemes, f(i) is a score of a scheme, and the scheme score function is an evaluation function in a scheme evaluation step. Details are to be described in step 305 of scheme evaluation step, and are not described herein. Therefore, it can be learned from the formula for calculating a scheme probability that, a probability of selecting a route scheme is related to evaluation of the route scheme, and higher evaluation of the route scheme indicates a greater probability of selecting the route. It may be understood as that, higher evaluation of the route scheme indicates that the route scheme is better.
m schemes are selected based on the calculated probability of selecting each of the at least one route scheme, to update the route scheme set. In addition, the hyperparameter matrix in addition to the route scheme set may further be updated, to improve efficiency of subsequently calculating the hyperparameter, and if evaluation of a planned route is not high, the route planning may continue to be performed by using the updated hyperparameter matrix, to obtain a more accurate route scheme. The m selected schemes are used for Bayesian estimation to update the hyperparameter matrix, and a specific example of updating the hyperparameter matrix is shown in
For example, after the hyperparameter is initialized, the pickup point transfer probability matrix is obtained based on the initialized transfer hyperparameter of the pickup point, and a first route scheme set is determined based on the pickup point transfer probability matrix. The first route scheme set includes at least one route scheme, goods allocation is performed based on each route scheme in the first route scheme set, and each goods allocation scheme in the goods allocation scheme set for each route scheme in the first route scheme set is obtained. Subsequently, each route scheme in the first route scheme set and the goods allocation scheme corresponding to each route scheme in the first route scheme set are integrated and evaluated. If no suitable target transportation scheme is obtained based on a result of the integration and evaluation, the transfer hyperparameter of the pickup point may be updated based on each route scheme in the first route scheme set, and the updated pickup point transfer probability matrix is obtained by using the updated transfer hyperparameter of the pickup point. The transportation route is re-planned based on the updated pickup point transfer probability matrix, to obtain a second route scheme set. The second route scheme set includes at least one route scheme, and then goods allocation and integration and evaluation are performed on each route scheme in the second route scheme set, to obtain the target transportation scheme.
304. Goods allocation.
After the route planning is performed, and each route scheme in the route scheme set is obtained, goods allocation may be performed for each transportation route in each route scheme in the route scheme set, and the goods allocation is performed for each transportation route in each route scheme in the route scheme set, to obtain goods loaded into a container in each transportation route.
One route scheme set may be considered as a group, and each scheme in the group represents one route scheme. After a scheme is generated, each transportation route in the route scheme has been acknowledged. Therefore, a quantity of required containers, and a route of each container have been determined. In actual application, it may be considered that a container is in a one-to-one correspondence with a transportation route, and a container is in a one-to-one correspondence with a freight car. In this case, goods loaded into a container further need to be allocated, to determine goods loaded into each container.
During the goods allocation, since there are different types of goods, for example, different lengths, different widths, different heights, or different weights, goods allocation at a pickup point cannot be described by using a simple distribution. In this embodiment of this application, goods may be clustered, and then the goods are allocated through clustering. A reference condition of clustering may be a length, a width, a height, a weight, a minimum contact area, a material, a bearing coefficient, or the like of the goods. To improve efficiency, the clustering may be performed by using some conditions. For example, the clustering may be performed by using the length, the width, the height, and the weight. The clustering may include precise clustering and fuzzy clustering. In this embodiment of this application, for example, the clustering is performed by using the length, the width, the height, and the weight. The precise clustering may be classifying four pieces of goods having completely same features into one category. The clustering is a small granularity-based clustering manner, and a clustering speed is high. The clustering is performed in this way, and accuracy of goods allocation can be improved. When a quantity of categories of goods generated through the precise clustering is excessively large, for example, a length of goods may be grouped into a plurality of categories, and a width may also be grouped into a plurality of categories, scheme calculation costs are increased. Therefore, when the quantity of categories obtained through the precise clustering is greater than a preset threshold, a clustering operation may alternatively be performed by using clustering algorithms such as K-means (k-means) clustering, a Gaussian mixture model, or a hierarchical clustering method. In this embodiment of this application, goods are classified by using a clustering method, and the goods are allocated after the classification, so that accuracy of subsequently obtaining a goods loading scheme can be improved.
For example, a schematic diagram of goods allocation may be shown in
For example, one route scheme is used as an example. After a first goods allocation scheme set is formed, and each goods allocation scheme in the first goods allocation scheme set is evaluated and scored, if the first goods allocation scheme does not include a goods allocation scheme scored higher than a second threshold, a first goods allocation hyperparameter of a pickup point may be updated by using the obtained first goods allocation scheme set, to obtain a second goods allocation hyperparameter of the pickup point. To-be-transported goods are re-allocated by using the second goods allocation hyperparameter to obtain a second goods allocation scheme set corresponding to the route scheme, and each goods allocation scheme in the second goods allocation scheme set is continued to be integrated and evaluated, to determine a target goods allocation scheme and a corresponding target route scheme. In actual application, goods allocation may be repeatedly performed until a stopping condition is met. For example, a quantity of iteration times reaches a preset quantity of times, or a quantity of goods allocation schemes whose scores of results of integration and evaluation are higher than the second threshold reaches a preset quantity. The goods allocation stops after the target goods allocation scheme is determined.
Specifically, to improve the efficiency of the method for determining a transportation scheme in this embodiment of this application, after a scheme score is obtained, an algorithm similar to that used in step 303 of route planning is used to calculate scheme selection probabilities, n schemes are selected based on the scheme selection probabilities, and original pickup point hyperparameter matrices of various pickup points are updated based on the n schemes, obtain a target pickup point hyperparameter matrix. After the goods allocation scheme of each pickup point is determined, a further learning process may be included, and the further learning process may be used to repeatedly allocate goods. A specific process of updating a goods allocation hyperparameter may be shown in
305. Scheme evaluation.
After the goods allocation is performed, and the goods allocation scheme is obtained, scheme evaluation is further required. The scheme evaluation is to integrate a route scheme and a goods allocation scheme, and evaluate the route scheme and the goods allocation scheme. An evaluation index includes: a route length in a route scheme, an actual loading rate of a container, and a difference between a volume actual loading rate and a weight actual loading rate of a container. A shorter route in a route scheme indicates a shorter car travelling route, that is, a shorter transportation route of a container, so that transportation costs can be reduced, and transportation efficiency can be improved. A higher actual loading rate of a container, that is, a larger amount of goods loaded into a container indicates a smaller quantity of containers required for loading same goods, so that the transportation costs can also be reduced and the transportation efficiency can be improved. The difference between the volume actual loading rate and the weight actual loading rate of the container cannot exceed a threshold. For example, as shown in
Containers with unbalanced actual loading rates may be obtained by observing loading records of containers in historical data. The volume actual loading rate and the weight actual loading rate are distributed at two corresponding sides of an average volume actual loading rate
Therefore, this embodiment of this application provides an evaluation function, to evaluate a route length and an actual loading rate of a container, and further compare a difference between a volume actual loading rate and a weight actual loading rate.
The evaluation function is:
{right arrow over (R)} K is a route scheme vector, m containers are included, {right arrow over (rV)} is a volume actual loading rate vector of the m containers, {right arrow over (rW)} is a weight actual loading rate vector of the m containers; α, β and γ are weight parameters, rVi is a volume actual loading rate of an ith container, rWi is a weight actual loading rate of an ith container,
The evaluation function may be used to evaluate a route scheme, to sift out some invalid route schemes or low-evaluated route schemes, to update the route scheme set.
306. Fast loading.
When step 305 of scheme evaluation is performed, fast loading simulation may be performed on each route scheme in the route scheme set by using the fast loading model, to obtain an actual loading rate of each route scheme in the goods allocation scheme set corresponding to each route scheme. Based on the goods allocation scheme obtained through goods allocation, that is, a set of goods loaded into the container, the actual loading rate of the container is fast obtained. The fast loading model is obtained by training the offline simulation data 308, the offline simulation data includes a historical loading scheme obtained through three-dimensional loading, the offline simulation data may be obtained through offline simulation 307, and the step of the offline simulation 307 is similar to the step of determining the target transportation scheme in this embodiment of this application.
In actual application, in addition to conforming, by using the fast loading model, the actual loading rate that is of each goods allocation corresponding to each of the at least one route scheme and that is obtained by performing fast loading for each route scheme in the route scheme set, goods loaded into the container may further be estimated based on the actual loading rate, to obtain a feasible solution, that is, to determine whether each piece of goods can be loaded into the container. If there is remaining goods that cannot be loaded into the container, further goods allocation needs to be performed on the remaining goods, to obtain the target transportation scheme by using which the to-be-transported goods can be completely transported.
Therefore, step 304, step 305, and step 306 together form a step of exploring a goods allocation scheme. The step of exploring a goods allocation scheme and step 303 form a step of exploring a route scheme. After the target transportation scheme, that is, a target transportation route and a goods allocation scheme corresponding to the target transportation route are determined, the target transportation scheme is output, and the to-be-transported goods are transported by using the target transportation scheme.
In actual application, step 303 to step 306 may be repeated to obtain the target route scheme and the corresponding target goods allocation scheme, that is, the target transportation scheme, and the to-be-transported goods are transported by using the target route scheme and the corresponding target goods allocation scheme.
Specifically, a specific obtaining procedure of the fast loading model and the loading scheme may be shown in
The offline training part is first described. Specifically, as shown in
During the offline training and the online prediction, a feature needs to be extracted, feature extraction processes of the offline training and the online prediction are similar, and a difference lies in that for the offline training, a feature is extracted from the offline simulation data, and for the online prediction, a feature is extracted from a goods set allocated to a container, that is, from each goods allocation scheme. A specific feature extraction procedure includes: first extracting a feature of a single piece of goods, to obtain a feature vector of the single piece of goods, namely, a second feature vector, where the feature of the single piece of goods includes: a length, a width, a height, and a weight of the goods, and may further include a minimum contact area, a material, a bearing coefficient, and the like. The material and the bearing coefficient are category-based variables, that is, are related to a category of goods, and category dimensions are not high. Therefore, in this embodiment of this application, a one-hot encoding scheme may be used to represent the material and the bearing coefficient. For example, there are four materials, and if one piece of goods belongs to a material 1, the material is identified in a form of the one-hot encoding scheme as: (1, 0, 0, 0).
After the feature vector of the single piece of goods is obtained, a feature vector {right arrow over (Pi)}, namely, a third feature vector, of a goods set allocated at a pickup point is subsequently obtained. {right arrow over (Pi)} may include an average value and a covariance of goods feature vectors, an amount of goods of different materials, and a quantized value ti of the pickup point.
Subsequently, weighted combination is performed on {right arrow over (Pi)} of the container passing through various pickup points, to obtain a final feature vector, that is, a first feature vector {right arrow over (O)} of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme:
represents a quantity of pickup points, ri represents a quantized value of a sequence of a pickup point i in a route scheme, and ri and ti are historical route-based data, and are obtained through analysis by using a corresponding analysis method.
During the offline training, each piece of historical loading scheme data in the offline simulation data is converted into training data in a preset format. The preset format may be (a feature vector, an actual loading rate), and then model training is performed, to obtain the fast loading model. Two models need to be trained, and the two models include a model for predicting a volume actual loading rate and a model for predicting a weight actual loading rate. That is, the fast loading model includes a model for predicting a volume actual loading rate and a model for predicting a weight actual loading rate.
During the online prediction, the goods sets allocated to the container are converted to feature vectors in a preset format, and then the feature vectors are input to the trained model, to obtain a corresponding output value.
In actual application, goods allocated to the container may not be loaded into the container, and when during hyperparameter update, only the part of goods loaded into the container can be considered, that is, a feasible solution, and an amount of loaded goods is used to update the hyperparameter. The goods allocation scheme determined during the goods allocation includes a set of goods loaded into the container. The model for predicting an actual loading rate can predict an actual loading rate of only the goods set, but cannot determine whether the goods in the goods set can be loaded into the container. Therefore, the set of goods that can be loaded into the container needs to be predicted based on the information about the actual loading rate, and in this embodiment of this application, linear programming can be used to resolve this problem.
For example, n pieces of goods are allocated to one container, a volume of an ith piece of goods is vi, a weight is wi, pi is a probability that an ith piece of goods can be loaded into the container, a volume actual loading rate output by the model for predicting an actual loading rate is rv, a weight actual loading rate is rw, predicted values of the volume and weight of the goods loaded into the container are respectively V and W, and linear programming may be defined as:
A set of pi can be obtained by solving the foregoing formula, goods in a goods set are sorted in a descending order of pi, and goods are sequentially selected based on the sequence. Given that a total volume of removed goods exceeds V, or a total weight exceeds W, a provided goods set is an estimation of a feasible solution, that is, goods that can be loaded into the container.
In this embodiment of this application, after the feasible solution is obtained through online simulation, post-processing may further be performed. That is, after the target transportation scheme is determined, a suitable container type may further be determined to generate a final loading scheme. For example, an available container type may be 40HQ, and a volume and a weight of goods loaded into each container can be obtained through goods allocation exploration and route scheme exploration in
If there is no remaining goods, that is, goods that cannot be loaded into the container, the determined suitable container type and the final loading scheme are a complete scheme. If there is remaining goods, that is, goods that cannot be loaded into the container, a virtual freight bill may be generated for the remaining goods, and exploration of the goods allocation scheme is repeated to obtain a transportation scheme of the remaining goods, to complete transportation of the remaining goods.
In this embodiment of this application, the offline simulation data for training the fast loading model may be obtained through the offline simulation. A specific process of the offline simulation is similar to that of the online simulation, and differences include that: during the offline simulation, a historical freight bill is used for simulation, and during the online simulation, a current freight bill is used for simulation; and during the offline simulation, three-dimensional loading is used to generate the loading scheme, and during the online simulation, the actual loading rate and the like is output by using the fast loading model obtained through offline training. For details, refer to
In actual application, because intermediate data of the online simulation occupies much of a memory and cannot be stored, when the fast loading model is trained offline, the steps of route planning, goods allocation, and scheme evaluation need to be performed again on the historical freight bill. During the offline simulation, first, the historical freight bill is obtained. The historical freight bill includes historical pickup point information and information about historical to-be-transported goods. Then, the route planning is performed based on the historical freight bill, to obtain a historical route scheme corresponding to the historical freight bill. Goods allocation is performed based on the historical route scheme, to obtain a historical goods allocation scheme set corresponding to each historical route scheme. An actual loading rate of each goods allocation scheme in a historical goods allocation scheme set corresponding to the final route scheme, and a loading manner are obtained through a three-dimensional loading operation. Based on the actual loading rate of each goods allocation scheme, integration and evaluation are performed on each of the at least one historical route scheme and each goods allocation scheme in the corresponding historical goods allocation scheme set, to obtain a historical transportation scheme.
Steps of hyperparameter initialization, route planning, goods allocation, and scheme evaluation that are included in the offline simulation are the same as steps of hyperparameter initialization, route planning, goods allocation, and scheme evaluation that are in the online simulation in
During the offline simulation, to obtain more accurate data, the three-dimensional loading algorithm may be used to calculate the actual loading rate, that is, to obtain a specific loading manner. When goods has been allocated, that is, after goods has been allocated to a container, a three-dimensional loading operation may be used to obtain a volume actual loading rate and a weight actual loading rate of the container, the volume actual loading rate and the weight actual loading rate may be used to evaluate a route scheme, and a step of evaluating the route scheme is similar to step 305 of scheme evaluation in
However, three-dimensional loading is a sequential process, that is, the loading simulation of goods can only be performed in order, and a plurality of pieces of goods cannot be processed in parallel. Therefore, when there is a comparatively large amount of goods, more time needs to be consumed for loading simulation. Therefore, in this embodiment of this application, three-dimensional loading simulation is used during offline simulation and post-processing, so that efficiency of obtaining the goods loading scheme and outputting the actual loading rate can be improved. During the offline simulation, the three-dimensional loading algorithm is used to calculate the actual loading rate, so that a more accurate actual loading rate can be obtained. During the post-processing, the three-dimensional loading algorithm is used to obtain the loading scheme, so that a goods loading manner can be obtained during transportation, thereby improving transportation efficiency.
The foregoing describes in detail the method for determining a transportation route provided in the embodiments of this application, and the following describes apparatuses provided in the embodiments of this application. First, a determining apparatus is described. Referring to
an obtaining module 1701, configured to obtain at least one route scheme and a first goods allocation scheme set corresponding to each of the at least one route scheme, where each of the at least one route scheme is a transportation route planned for transporting to-be-transported goods, the first goods allocation scheme set corresponding to each of the at least one route scheme includes at least one goods allocation scheme, and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme is a scheme for allocating the to-be-transported goods for the corresponding route scheme;
a fast loading module 1702, configured to determine, by using a fast loading model, an actual loading rate of each goods allocation scheme in the first goods allocation set corresponding to each of the at least one route scheme, where the fast loading model is obtained by training offline simulation data offline, the offline simulation data includes a historical loading scheme calculated by using a three-dimensional loading algorithm, and the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and
an evaluation module 1703, configured to integrate and evaluate, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to determine a target transportation scheme, where the target transportation scheme includes a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
Optionally, in some possible implementations, the obtaining module 1701 may include:
an obtaining submodule 17011, configured to obtain a target freight bill, where the target freight bill includes transportation node information and to-be-transported goods information, the transportation node information includes a freight starting point, a freight ending point, and M pickup points, and the to-be-transported goods information includes information about to-be-transported goods distributed at the M pickup points, where M is a positive integer;
a route planning submodule 17012, configured to determine the at least one route scheme based on the transportation node information, where each of the at least one route scheme includes at least one transportation route, each of the at least one transportation route includes a freight starting point, a freight ending point, and N of the M pickup points, and each of the at least one route scheme covers the M pickup points, where N is a positive integer and N≤M; and
a goods allocation submodule 17013, configured to allocate the to-be-transported goods for each transportation route in each of the at least one route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
Optionally, in some possible implementations, the route planning submodule 17012 is specifically configured to:
if an amount of historical route data is greater than a first threshold, initialize transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix;
determine a transfer probability distribution of the M pickup points based on the hyperparameter matrix, where the transfer probability distribution includes a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and
determine each transportation route in each of the at least one route scheme based on the transfer probability distribution, to obtain the at least one route scheme.
Optionally, in some possible implementations, the determining apparatus may further include:
an initialization module 1704, configured to: if the amount of historical route data is not greater than the first threshold, initialize the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
Optionally, in some possible implementations, the goods allocation submodule 17013 is specifically configured to:
cluster goods at each of the M pickup points based on a clustering condition, to obtain a clustering result, where the clustering condition includes a length, a width, a height, and a weight of the goods;
perform sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, where the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme; and
separately select a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combine the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
Optionally, in some possible implementations, the fast loading module 1702 is specifically configured to:
obtain a first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, where the first feature vector is used to indicate a feature value of to-be-transported goods in a goods allocation scheme; and
input the first feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme into the fast loading model, to obtain the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, where the actual loading rate includes a volume actual loading rate and a weight actual loading rate, the volume actual loading rate includes a proportion of a volume of goods allocated in each transportation route in a load volume of a container in each of the at least one route scheme, and the weight actual loading rate includes a proportion of a weight of goods allocated in each transportation route in a load weight of a container in each of the at least one route scheme.
Optionally, in some possible implementations, the fast loading module 1702 is specifically configured to:
obtain a second feature vector of each piece of the to-be-transported goods, where the second feature vector of each piece of the to-be-transported goods includes a length, a width, a height, and a weight of the corresponding goods;
calculate, based on the second feature vector of each piece of the to-be-transported goods, a third feature vector of goods distributed at each of the M pickup points, for each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme, where the third feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme includes an average value and a covariance of second feature vectors of all pieces of the to-be-transported goods; and
perform weighted combination on the third feature vector of each goods allocation scheme in the first goods allocation scheme corresponding to each of the at least one route scheme, to obtain the corresponding first feature vector in each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
Optionally, in some possible implementations, where the evaluation module 1703 is specifically configured to:
calculate scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate;
if all the goods allocation schemes include one or more goods allocation schemes scored higher than a second threshold, determine the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and use a route scheme corresponding to the target goods allocation scheme as the target route scheme; and
determine the target transportation scheme based on the target goods allocation scheme and the target route scheme.
Optionally, in some possible implementations, the evaluation function includes:
where {right arrow over (R)} is a route scheme vector, m is a quantity of containers, {right arrow over (rV)} is a volume actual loading rate vector of the m containers, {right arrow over (rW)} is a weight actual loading rate vector of the m containers; α, β, and γ are weight parameters, rVi is a volume actual loading rate of an ith container, rWi is a weight actual loading rate of an ith container,
Optionally, in some possible implementations, the evaluation module 1703 is further configured to:
if all the goods allocation schemes do not include the goods allocation scheme scored higher than the second threshold, perform sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, where each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme;
separately select a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combine the goods allocation manners, to obtain each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme, where each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme is a scheme of allocating the to-be-transported goods for a corresponding route scheme; and
calculate a score of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme by using the evaluation function and the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme, where the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme is obtained by using the fast loading model.
Optionally, in some possible implementations, the determining apparatus may further include:
a post-processing module 1705, configured to: after each of the at least one route scheme and the goods allocation scheme for each of the at least one route scheme are integrated and evaluated based on the actual loading rate to determine the target transportation scheme, determine a type of a container in each transportation route in the target route scheme based on the target goods allocation scheme and the target route scheme; and
a three-dimensional loading module 1706, configured to generate a loading scheme based on the type that is of the container in each transportation route in the target route scheme and that is determined by the post-processing module 1705, and the three-dimensional loading algorithm, where the loading scheme is a loading manner of the to-be-transported goods in the container in each transportation route in the target route scheme.
Optionally, in some possible implementations, the determining apparatus may further include:
a determining module 1707, configured to: before each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme are integrated and evaluated based on the actual loading rate to determine the target transportation scheme, if determining, based on the actual loading rate, that L of the M pickup points further include remaining goods not allocated to the container, determine a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, where L≤M, and L is a positive integer, where
the evaluation module 1703 is further configured to integrate and evaluate, based on the actual loading rate, each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to determine the target transportation scheme.
The following describes a training apparatus in the embodiments of this application.
an obtaining module 1801, configured to obtain offline simulation data, where the offline simulation data includes a historical loading scheme and a historical actual loading rate that are calculated through three-dimensional loading, where
the obtaining module 1801 is further configured to obtain a feature vector from the offline simulation data, where the feature vector includes a feature value of historical transportation goods corresponding to the historical loading scheme;
a conversion module 1802, configured to convert the feature vector into training data in a preset format; and
a training module 1803, configured to train a predictive model by using the training data, to obtain a fast loading model, where the fast loading model is used to output an actual loading rate of each goods allocation scheme in a goods allocation scheme set for each transportation route, and the actual loading rate is a proportion of goods loaded into a container in the container in each goods allocation scheme.
Optionally, in some possible implementations, the preset format is: (a feature vector, a historical actual loading rate).
Optionally, in some possible implementations, the predictive model includes: a linear regression model, a ridge regression model, an LASSO model, a support vector machine model, a random forest model, an XgBoost model, or an artificial neural network model.
Optionally, in some possible implementations, the obtaining module 1801 may include:
an obtaining submodule 18011, configured to obtain at least one historical route scheme and a first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, where each of the at least one historical route scheme is a transportation route planned for transporting historical transportation goods, the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme includes at least one goods allocation scheme, and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme is a scheme for allocating the historical transportation goods for the corresponding route scheme;
a three-dimensional loading submodule 18012, configured to determine, by using a three-dimensional loading algorithm, an actual loading rate of each goods allocation scheme in the first goods allocation set corresponding to each of the at least one historical route scheme, where the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and
an evaluation submodule 18013, configured to integrate and evaluate, based on the actual loading rate, each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, to determine a target transportation scheme, where the target transportation scheme includes a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
In this embodiment of this application, the three-dimensional loading algorithm may be used for calculation during training of the fast loading model, to obtain a historical loading scheme corresponding to the historical route scheme, so that the actual loading rate of the goods allocation scheme corresponding to the historical route scheme can be accurately output.
Optionally, in some possible implementations, the obtaining submodule 18011 includes:
an obtaining unit 180111, configured to obtain a historical freight bill, where the historical freight bill includes transportation node information and information about the historical transportation goods, the transportation node information includes a freight starting point, a freight ending point, and M pickup points, and the information about the historical transportation goods includes information about the historical transportation goods distributed at the M pickup points, where M is a positive integer;
a route planning unit 180112, configured to determine the at least one historical route scheme based on the transportation node information, where each of the at least one historical route scheme includes at least one transportation route, each of the at least one transportation route includes a freight starting point, a freight ending point, and N of the M pickup points, and each of the at least one historical route scheme covers the M pickup points, where N is a positive integer and N≤M; and
a goods allocation unit 180113, configured to allocate the historical transportation goods for each transportation route in each of the at least one historical route scheme, to obtain each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme.
Optionally, in some possible implementations, the route planning unit 180112 is specifically configured to:
if an amount of historical route data is greater than a first threshold, initialize transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix;
determine a transfer probability distribution of the M pickup points based on the hyperparameter matrix, where the transfer probability distribution includes a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and
determine each transportation route in each of the at least one historical route scheme based on the transfer probability distribution, to obtain the at least one historical route scheme.
Optionally, in some possible implementations, the training apparatus further includes:
an initialization module 1804, configured to: if the amount of historical route data is not greater than the first threshold, initialize the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
Optionally, in some possible implementations, the goods allocation unit 180113 is specifically configured to:
cluster goods at each of the M pickup points based on a clustering condition, to obtain a clustering result, where the clustering condition includes a length, a width, a height, and a weight of the goods;
perform sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, where the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme; and
separately select a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combine the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme.
Optionally, in some possible implementations, the evaluation submodule 18013 is specifically configured to:
calculate scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate;
if all the goods allocation schemes include one or more goods allocation schemes scored higher than a second threshold, determine the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and use a route scheme corresponding to the target goods allocation scheme as the target route scheme; and
determine the target transportation scheme based on the target goods allocation scheme and the target route scheme.
Optionally, in some possible implementations, the evaluation function includes:
where {right arrow over (R)} is a route scheme vector, m is a quantity of containers, {right arrow over (rV)} is a volume actual loading rate vector of the m containers, {right arrow over (rW)} is a weight actual loading rate vector of the m containers; α, β, and γ are weight parameters, rVi is a volume actual loading rate of an ith container, rWi is a weight actual loading rate of an ith container,
Optionally, in some possible implementations, the evaluation submodule 18013 is further configured to:
if all the goods allocation schemes do not include the goods allocation scheme scored higher than the second threshold, perform sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, where each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme;
separately select a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combine the goods allocation manners, to obtain each goods allocation scheme in the second historical goods allocation scheme set corresponding to each of the at least one historical route scheme, where each goods allocation scheme in the second historical goods allocation scheme set corresponding to each of the at least one historical route scheme is a scheme of allocating the historical transportation goods for a corresponding route scheme; and
calculate a score of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme by using the evaluation function and an actual loading rate of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme, where the actual loading rate of each goods allocation scheme in the second historical goods allocation scheme set for each of the at least one historical route scheme is obtained by using the three-dimensional loading submodel.
It should be understood that when allocation is repeatedly performed by using the goods allocation scheme, a route scheme may further be re-planned, or goods may be directly reallocated by using the at least one historical route scheme.
Optionally, in some possible implementations, the training apparatus further includes:
a determining module 1805, configured to: before each of the at least one historical route scheme and each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme are integrated and evaluated based on the actual loading rate to determine the target transportation scheme, if determining, based on the actual loading rate, that L of the M pickup points further include remaining goods not allocated to the container, determine a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, where L≤M, and L is a positive integer, where
the evaluation submodule 18013 is further configured to integrate and evaluate, based on the actual loading rate, each goods allocation scheme in the first historical goods allocation scheme set corresponding to each of the at least one historical route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to determine the target transportation scheme.
The determining apparatus 1900 may further include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input/output interfaces 1958, and/or one or more operating systems 1941, for example, Windows Server™, Mac OS X™, Unix™, Linux™, and FreeBSD™.
The steps in the method for determining a transportation scheme in the embodiments of
The training apparatus 2000 may further include one or more power supplies 2026, one or more wired or wireless network interfaces 2050, one or more input/output interfaces 2058, and/or one or more operating systems 2041, for example, Windows Server™, Mac OS X™, Unix™, Linux™, and FreeBSD™.
The offline training steps in the embodiments of
It may be clearly understood by a person skilled in the art that for convenient and brief description, for a detailed working process of the described system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.
In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in another manner. For example, the described apparatus embodiments are merely examples. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electrical, mechanical, or another form.
The units described as separate components may or may not be physically separate, and components displayed as units may or may not be physical units. To be specific, the components may be located at one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions in the embodiments.
In addition, functional units in the embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units may be integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software function unit.
When the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the prior art, or all or some of the technical solutions may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods of
In conclusion, the foregoing embodiments are merely intended to describe the technical solutions of this application, but not to limit this application. Although this application is described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that the person may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features thereof, without causing the essence of the technical solutions to depart from the scope of the technical solutions of the embodiments of this application.
1. A method for obtaining a transportation scheme, comprising:
obtaining at least one route scheme and a first goods allocation scheme set corresponding to each of the at least one route scheme, wherein each of the at least one route scheme is a transportation route planned for transporting to-be-transported goods, the first goods allocation scheme set corresponding to each of the at least one route scheme comprises at least one goods allocation scheme, and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme is a scheme for allocating the to-be-transported goods for the corresponding route scheme;
obtaining, by using a fast loading model, an actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the fast loading model is obtained by training offline simulation data offline, the offline simulation data comprises a historical loading scheme calculated by using a three-dimensional loading algorithm, and the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and
integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to obtain a target transportation scheme, wherein the target transportation scheme comprises a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
2. The method according to claim 1, wherein the obtaining at least one route scheme and a first goods allocation scheme set corresponding to each of the at least one route scheme comprises:
obtaining a target freight bill, wherein the target freight bill comprises transportation node information and to-be-transported goods information, the transportation node information comprises a freight starting point, a freight ending point, and M pickup points, and the to-be-transported goods information comprises information about to-be-transported goods distributed at the M pickup points, wherein M is a positive integer;
obtaining the at least one route scheme based on the transportation node information, wherein each of the at least one route scheme comprises at least one transportation route, each of the at least one transportation route comprises a freight starting point, a freight ending point, and N of the M pickup points, and each of the at least one route scheme covers the M pickup points, wherein N is a positive integer and N≤M; and
allocating the to-be-transported goods for each transportation route in each of the at least one route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
3. The method according to claim 2, wherein the obtaining the at least one route scheme based on the transportation node information comprises:
if an amount of historical route data is greater than a first threshold, initializing transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix;
obtaining a transfer probability distribution of the M pickup points based on the hyperparameter matrix, wherein the transfer probability distribution comprises a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and
obtaining each transportation route in each of the at least one route scheme based on the transfer probability distribution, to obtain the at least one route scheme.
4. The method according to claim 3, wherein the method further comprises:
if the amount of historical route data is not greater than the first threshold, initializing the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
5. The method according to claim 2, wherein the allocating the to-be-transported goods for each transportation route in each of the at least one route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme comprises:
clustering goods at each of the M pickup points based on a clustering condition, to obtain a clustering result, wherein the clustering condition comprises a length, a width, a height, and a weight of the goods;
performing sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, wherein the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme; and
separately selecting a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combining the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
6. The method according to claim 2, wherein the obtaining, by using a fast loading model, an actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme comprises:
obtaining a first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the first feature vector is used to indicate a feature value of to-be-transported goods in a goods allocation scheme; and
inputting the first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme into the fast loading model, to obtain the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the actual loading rate comprises a volume actual loading rate and a weight actual loading rate, the volume actual loading rate comprises a proportion of a volume of goods allocated in each transportation route in a load volume of a container in each of the at least one route scheme, and the weight actual loading rate comprises a proportion of a weight of goods allocated in each transportation route in a load weight of a container in each of the at least one route scheme.
7. The method according to claim 6, wherein the obtaining a first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme comprises:
obtaining a second feature vector of each piece of the to-be-transported goods, wherein the second feature vector of each piece of the to-be-transported goods comprises a length, a width, a height, and a weight of the corresponding goods;
calculating, based on the second feature vector of each piece of the to-be-transported goods, a third feature vector of goods distributed at each of the M pickup points, for each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the third feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme comprises an average value and a covariance of second feature vectors of all pieces of the to-be-transported goods; and
performing weighted combination on the third feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to obtain the corresponding first feature vector in each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
8. The method according to claim 1, wherein the integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to obtain a target transportation scheme comprises:
calculating scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate;
if all the goods allocation schemes comprise one or more goods allocation schemes scored higher than a second threshold, obtaining the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and using a route scheme corresponding to the target goods allocation scheme as the target route scheme; and
obtaining the target transportation scheme based on the target goods allocation scheme and the target route scheme.
9. The method according to claim 8, wherein the method further comprises:
if all the goods allocation schemes do not comprise the goods allocation scheme scored higher than the second threshold, performing sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, wherein each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme;
separately selecting a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combining the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme, wherein each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme is a scheme of allocating the to-be-transported goods for a corresponding route scheme; and
calculating a score of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme by using the evaluation function and the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme, wherein the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme is obtained by using the fast loading model.
10. The method according to claim 1, wherein before the integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to obtain a target transportation scheme, the method further comprises:
If obtaining, based on the actual loading rate, that L of the M pickup points further comprise remaining goods not allocated to the container, obtaining a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, wherein L≤M, and L is a positive integer; and
the integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to obtain a target transportation scheme comprises:
integrating and evaluating, based on the actual loading rate, each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to obtain the target transportation scheme.
11. A obtaining a transportation scheme apparatus, comprising:
at least one processor; and
a non-transitory computer-readable storage medium coupled to the at least one processor and storing programming instructions for execution by the at least one processor, the programming instructions instruct the at least one processor to perform the following operations:
obtaining at least one route scheme and a first goods allocation scheme set corresponding to each of the at least one route scheme, wherein each of the at least one route scheme is a transportation route planned for transporting to-be-transported goods, the first goods allocation scheme set corresponding to each of the at least one route scheme comprises at least one goods allocation scheme, and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme is a scheme for allocating the to-be-transported goods for the corresponding route scheme;
obtaining, by using a fast loading model, an actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the fast loading model is obtained by training offline simulation data offline, the offline simulation data comprises a historical loading scheme calculated by using a three-dimensional loading algorithm, and the actual loading rate is a proportion of goods loaded into a container in the container in a goods allocation scheme; and
integrating and evaluating, based on the actual loading rate, each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to obtain a target transportation scheme, wherein the target transportation scheme comprises a target route scheme and a target goods allocation scheme corresponding to the target route scheme.
12. The obtaining a transportation scheme apparatus according to claim 11, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
obtaining a target freight bill, wherein the target freight bill comprises transportation node information and to-be-transported goods information, the transportation node information comprises a freight starting point, a freight ending point, and M pickup points, and the to-be-transported goods information comprises information about to-be-transported goods distributed at the M pickup points, wherein M is a positive integer;
obtaining the at least one route scheme based on the transportation node information, wherein each of the at least one route scheme comprises at least one transportation route, each of the at least one transportation route comprises a freight starting point, a freight ending point, and N of the M pickup points, and each of the at least one route scheme covers the M pickup points, wherein N is a positive integer and N≤M; and
allocating the to-be-transported goods for each transportation route in each of the at least one route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
13. The obtaining a transportation scheme apparatus according to claim 12, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
when an amount of historical route data is greater than a first threshold, initializing transfer hyperparameters of the M pickup points based on the historical route data, to obtain a hyperparameter matrix;
obtaining a transfer probability distribution of the M pickup points based on the hyperparameter matrix, wherein the transfer probability distribution comprises a transfer probability of a container in a transportation route between the freight starting point and the M pickup points, between the freight ending point and the M pickup points, or between the M pickup points; and
obtaining each transportation route in each of the at least one route scheme based on the transfer probability distribution, to obtain the at least one route scheme.
14. The obtaining a transportation scheme apparatus according to claim 13, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
when the amount of historical route data is not greater than the first threshold, initializing the transfer hyperparameters of the M pickup points by using a heuristic algorithm, to obtain the hyperparameter matrix.
15. The obtaining a transportation scheme apparatus according to claim 12, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
clustering goods at each of the M pickup points based on a clustering condition, to obtain a clustering result, wherein the clustering condition comprises a length, a width, a height, and a weight of the goods;
performing sampling calculation on the clustering result by using a first goods allocation hyperparameter of each of the M pickup points, to obtain a first goods allocation manner set of each of the M pickup points, wherein the first goods allocation hyperparameter of each of the M pickup points is a hyperparameter for allocating the goods at each of the M pickup points, and each goods allocation manner in the first goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme; and
separately selecting a goods allocation manner from the first goods allocation manner set of each of the M pickup points, and combine the goods allocation manner with a route scheme, to obtain each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
16. The obtaining a transportation scheme apparatus according to claim 12, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
obtaining a first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the first feature vector is used to indicate a feature value of to-be-transported goods in a goods allocation scheme; and
inputting the first feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme into the fast loading model, to obtain the actual loading rate of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the actual loading rate comprises a volume actual loading rate and a weight actual loading rate, the volume actual loading rate comprises a proportion of a volume of goods allocated in each transportation route in a load volume of a container in each of the at least one route scheme, and the weight actual loading rate comprises a proportion of a weight of goods allocated in each transportation route in a load weight of a container in each of the at least one route scheme.
17. The obtaining a transportation scheme apparatus according to claim 16, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
obtaining a second feature vector of each piece of the to-be-transported goods, wherein the second feature vector of each piece of the to-be-transported goods comprises a length, a width, a height, and a weight of the corresponding goods;
calculating, based on the second feature vector of each piece of the to-be-transported goods, a third feature vector of goods distributed at each of the M pickup points, for each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, wherein the third feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme comprises an average value and a covariance of second feature vectors of all pieces of the to-be-transported goods; and
performing weighted combination on the third feature vector of each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, to obtain the corresponding first feature vector in each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme.
18. The obtaining a transportation scheme apparatus according to claim 11, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
calculating scores of all obtained goods allocation schemes by using a preset evaluation function and the actual loading rate;
when all the goods allocation schemes comprise one or more goods allocation schemes scored higher than a second threshold, obtaining the target goods allocation scheme in the one or more goods allocation schemes scored higher than the second threshold, and use a route scheme corresponding to the target goods allocation scheme as the target route scheme; and
obtaining the target transportation scheme based on the target goods allocation scheme and the target route scheme.
19. The obtaining a transportation scheme apparatus according to claim 18, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
when all the goods allocation schemes do not comprise the goods allocation scheme scored higher than the second threshold, performing sampling calculation on the clustering result by using a second goods allocation hyperparameter of each of the M pickup points, to obtain a second goods allocation manner set of each of the M pickup points, wherein each goods allocation manner in the second goods allocation manner set of each of the M pickup points is a manner of allocating goods distributed at a pickup point for a corresponding route scheme, and the second goods allocation hyperparameter of each of the M pickup points is obtained by updating the first goods allocation hyperparameter of each of the M pickup points based on each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme;
separately selecting a goods allocation manner from the second goods allocation manner set of each of the M pickup points, and combine the goods allocation manners, to obtain each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme, wherein each goods allocation scheme in the second goods allocation scheme set corresponding to each of the at least one route scheme is a scheme of allocating the to-be-transported goods for a corresponding route scheme; and
calculating a score of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme by using the evaluation function and the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme, wherein the actual loading rate of each goods allocation scheme in the second goods allocation scheme set for each of the at least one route scheme is obtained by using the fast loading model.
20. The obtaining a transportation scheme apparatus according to claim 11, wherein the programming instructions further instruct the at least one processor to perform the following operation steps:
before each of the at least one route scheme and each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme are integrated and evaluated based on the actual loading rate, to obtain the target transportation scheme, when obtaining, based on the actual loading rate, that L of the M pickup points further comprise remaining goods not allocated to the container, obtaining a remaining goods route scheme and a remaining goods allocation scheme for the remaining goods, wherein L≤M, and L is a positive integer, wherein
integrating and evaluating, based on the actual loading rate, each goods allocation scheme in the first goods allocation scheme set corresponding to each of the at least one route scheme, and the remaining goods route scheme and the remaining goods allocation scheme, to obtain the target transportation scheme.
Number | Date | Country | Kind |
---|---|---|---|
201810118531.9 | Feb 2018 | CN | national |
This application is a continuation of International Application No. PCT/CN CN2018/108534, filed on Sep. 29, 2018, which claims priority to Chinese Patent Application No. 201810118531.9, filed on Feb. 6, 2018, The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2018/108534 | Sep 2018 | US |
Child | 16986508 | US |