Data distribution method and device
By optimizing waybill allocation using historical waybill data and semi-supervised clustering algorithm, the delay and accuracy problems of VRP model under large-scale orders are solved, and more efficient waybill allocation is achieved.
Patent Information
- Application Number
- CN202411126462.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-08
AI Technical Summary
In the process of distribution of logistics waybills in the e-commerce field, due to the large order scale, the running time of the VRP model is extended, affecting the accuracy and efficiency of the results.
By obtaining historical waybill data, the pre-allocated user set of the waybill to be allocated is determined, and semi-supervised clustering is performed based on the waybill data to be allocated is obtained to obtain the initial waybill data set of each user, and the solution is combined with the path planning constraints to optimize the waybill allocation.
It reduces the complexity of data allocation and solution, reduces the solution time, and improves the accuracy and efficiency of waybill allocation.
Smart Images

Figure CN118917622A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for data distribution. Background Art
[0002] The rapid development of technology in the e-commerce field is accompanied by a rapid increase in logistics volume. For a large number of logistics waybills, the distribution station needs to reasonably allocate the orders so that the delivery personnel can complete the delivery of all waybills in a timely manner. When allocating waybills, the station manager needs to adjust the real-time acquisition of the personnel waybill allocation plan according to the attendance personnel, and determine the waybill allocation result through the VRP (vehicle routing problem) model.
[0003] However, in the process of determining the waybill allocation results, the large order size can easily lead to extended model operation delays, which affects the effectiveness of the VRP model and the accuracy of the results. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for data allocation, which can effectively reduce the effect of solving the data allocation problem, improve the accuracy, and optimize the waybill allocation method.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for data distribution is provided, comprising:
[0006] Obtain the user set to be allocated, waybill data to be allocated, and historical waybill data;
[0007] Determine a pre-allocated user set corresponding to the waybill data to be allocated based on the historical waybill data;
[0008] Determine the target waybill data corresponding to each user to be allocated in the user set to be allocated according to the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated;
[0009] The target waybill data corresponding to each user to be assigned is used as the cluster center, and semi-supervised clustering is performed on the waybill data to obtain the initial waybill data set corresponding to each user to be assigned;
[0010] By combining the initial waybill data set corresponding to each user to be assigned and the set path planning constraints, the waybill data set corresponding to each user to be assigned is obtained by solving the path planning problem.
[0011] Optionally, determining a pre-allocated user set corresponding to the to-be-allocated waybill data based on the historical waybill data includes:
[0012] Determine the location information of each waybill to be allocated according to the waybill data to be allocated;
[0013] Statistics on user delivery data for each location based on historical waybill data;
[0014] The pre-assigned user set corresponding to the to-be-assigned waybill data is determined based on the user delivery data of each location information.
[0015] Optionally, determining a pre-allocated user set corresponding to the to-be-allocated waybill data based on the user delivery data of each location information includes:
[0016] Based on the user delivery data of each location information and the preset delivery number threshold, a pre-assigned user set corresponding to the waybill data to be assigned is determined.
[0017] Optionally, determining the target waybill data corresponding to each user to be allocated in the user set to be allocated according to the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated includes:
[0018] Determine a deliverable waybill set corresponding to each user to be allocated based on the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated;
[0019] The target waybill data corresponding to each user to be assigned is determined based on the deliverable waybill set corresponding to each user to be assigned.
[0020] Optionally, determining the target waybill data corresponding to each to-be-allocated user based on the deliverable waybill set corresponding to each to-be-allocated user includes:
[0021] For each user to be assigned, if the deliverable waybill set corresponding to the user to be assigned includes at least one waybill data, a deliverable waybill different from the target waybill data corresponding to other users to be assigned is selected from the deliverable waybill set corresponding to the user to be assigned as the target waybill data corresponding to the user to be assigned.
[0022] Optionally, the method further comprises:
[0023] For each user to be assigned, if the deliverable waybill set corresponding to the user to be assigned does not include waybill data, a waybill data different from the target waybill data corresponding to other users to be assigned is randomly selected from the waybill data to be assigned as the target waybill data corresponding to the user to be assigned.
[0024] Optionally, the target waybill data corresponding to each to-be-assigned user is used as the cluster center, and semi-supervised clustering is performed on the to-be-assigned waybill data to obtain an initial waybill data set corresponding to each to-be-assigned user, including:
[0025] The target waybill data corresponding to each to-be-assigned user is taken as the cluster center, the vehicle capacity of each to-be-assigned user is taken as the constraint condition, the total delivery distance of the waybill data corresponding to the to-be-assigned user is minimized, and the familiarity between the to-be-assigned user and the location information of each to-be-assigned waybill in the to-be-assigned waybill data is maximized as the objective function, and the to-be-assigned waybill data is semi-supervised clustered to obtain the initial waybill data set corresponding to each to-be-assigned user;
[0026] The familiarity between the user to be assigned and the location information of each waybill to be assigned in the waybill to be assigned data is obtained in the following way:
[0027] For each location information of the waybill to be allocated in the waybill data to be allocated, the total number of deliveries corresponding to the location information of the waybill to be allocated and the number of deliveries to each user to be allocated corresponding to the location information of the waybill to be allocated are counted;
[0028] Based on the total number of deliveries corresponding to the location information of the waybill to be assigned and the number of deliveries of each user to be assigned, the familiarity of each user to be assigned and the location information of the waybill to be assigned is calculated.
[0029] According to another aspect of an embodiment of the present invention, there is provided a data distribution device, comprising:
[0030] The acquisition module is used to obtain the user set to be allocated, the waybill data to be allocated and the historical waybill data;
[0031] A determination module, used to determine a pre-assigned user set corresponding to the waybill data to be assigned based on the historical waybill data; determine the target waybill data corresponding to each user to be assigned in the user set to be assigned according to the waybill data to be assigned and the pre-assigned user set corresponding to the waybill data to be assigned;
[0032] The calculation module is used to use the target waybill data corresponding to each user to be assigned as the cluster center, perform semi-supervised clustering on the waybill data to be assigned, and obtain the initial waybill data set corresponding to each user to be assigned; combine the initial waybill data set corresponding to each user to be assigned and the set path planning constraints, and obtain the waybill data set corresponding to each user to be assigned by solving the path planning problem.
[0033] Optionally, a determination module is used to determine the pre-allocated user set corresponding to the waybill data to be allocated based on the historical waybill data, including: a determination module is used to determine the location information of each waybill to be allocated according to the waybill data to be allocated; a statistical module is used to count the user delivery data of each location information according to the historical waybill data; a determination module is used to determine the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information.
[0034] Optionally, a determination module is used to determine the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information, including: a determination module is used to determine the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information and a preset delivery number threshold.
[0035] Optionally, a determination module is used to determine the target waybill data corresponding to each user to be assigned in the user set to be assigned based on the waybill data to be assigned and the pre-assigned user set corresponding to the waybill data to be assigned, including: a determination module is used to determine the deliverable waybill set corresponding to each user to be assigned based on the waybill data to be assigned and the pre-assigned user set corresponding to the waybill data to be assigned; and determine the target waybill data corresponding to each user to be assigned based on the deliverable waybill set corresponding to each user to be assigned.
[0036] Optionally, a determination module is used to determine the target waybill data corresponding to each user to be assigned based on the deliverable waybill set corresponding to each user to be assigned, including: a determination module is used to, for each user to be assigned, when the deliverable waybill set corresponding to the user to be assigned includes at least one waybill data, select a deliverable waybill different from the target waybill data corresponding to other users to be assigned from the deliverable waybill set corresponding to the user to be assigned, as the target waybill data corresponding to the user to be assigned.
[0037] Optionally, the device also includes: a selection module, which is used to randomly select a waybill data that is different from the target waybill data corresponding to other users to be assigned from the waybill data to be assigned, as the target waybill data corresponding to the user to be assigned, when the waybill data is not included in the deliverable waybill set corresponding to the user to be assigned.
[0038] Optionally, a calculation module is used to take the target waybill data corresponding to each user to be assigned as the cluster center, perform semi-supervised clustering on the waybill data to be assigned, and obtain an initial waybill data set corresponding to each user to be assigned, including: a calculation module is used to take the target waybill data corresponding to each user to be assigned as the cluster center, take the vehicle capacity of each user to be assigned as a constraint condition, take the shortest total delivery distance of the waybill data corresponding to the user to be assigned and the maximum familiarity of the user to be assigned with the location information of each waybill to be assigned in the waybill data to be assigned as the objective function, perform semi-supervised clustering on the waybill data to be assigned, and obtain an initial waybill data set corresponding to each user to be assigned; wherein the familiarity of the user to be assigned with the location information of each waybill to be assigned in the waybill data to be assigned is obtained in the following manner: for the location information of each waybill to be assigned in the waybill data to be assigned, count the total number of deliveries corresponding to the location information of the waybill to be assigned, and the number of deliveries of each user to be assigned corresponding to the location information of the waybill to be assigned; based on the total number of deliveries corresponding to the location information of the waybill to be assigned and the number of deliveries of each user to be assigned, calculate the familiarity of each user to be assigned with the location information of the waybill to be assigned.
[0039] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data distribution method provided by an embodiment of the present invention.
[0040] According to another aspect of an embodiment of the present invention, a computer readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for data distribution provided by an embodiment of the present invention is implemented.
[0041] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for data allocation provided by an embodiment of the present invention is implemented.
[0042] One embodiment of the above invention has the following advantages or beneficial effects: it is possible to determine the pre-assigned user set of the waybill data to be assigned based on the historical waybill data, and further determine the target waybill data corresponding to each user to be assigned in combination with the waybill data to be assigned, and use the target waybill data as the cluster center to calculate the initial solution data of the correspondence between the waybill data to be assigned and the user to be assigned using a semi-supervised clustering algorithm, and on this basis use the VRP model to calculate the final solution to obtain the data allocation result. By calculating the initial solution using a semi-supervised clustering algorithm and then solving the VRP based on the initial solution, the complexity of solving the VRP can be greatly reduced, the time consumed in solving the solution can be reduced, and the solving efficiency can be improved.
[0043] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0045] Figure 1 is a schematic diagram of main steps of a method for data distribution according to an embodiment of the present invention;
[0046] Figure 2 is a schematic diagram of main modules of a device for data distribution according to an embodiment of the present invention;
[0047] Figure 3 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0048] Figure 4 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0050] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution disclosed in the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0051] It should be noted that in the technical solution of the present invention, the collection, use, storage, sharing and transfer of user personal information involved are in compliance with the provisions of relevant laws and regulations, and it is necessary to inform the user and obtain the user's consent or authorization. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted.
[0052] Figure 1 FIG. 4 is a schematic diagram of the main steps of the method for data distribution according to an embodiment of the present invention. Figure 1 As shown, the data distribution method of the embodiment of the present invention mainly includes the following steps S101 to S105.
[0053] Step S101, obtaining a user set to be allocated, waybill data to be allocated, and historical waybill data.
[0054] Obtain the set of users to be assigned, the waybill data to be assigned, and the historical waybill data that can be delivered within the preset time period. The set of users to be assigned can be the set of couriers on duty on the same day. By encoding each courier, the courier set {0, ..., i, ..., k-1} is obtained, which represents k couriers on duty on the same day. The code of each courier can be the id of the courier; encode each waybill to be assigned (lat, lng), lat represents the latitude of the waybill location, and lng represents the longitude of the waybill location; the preset time period is generally one day. The historical waybill data can be the waybill data of the last three months. Specifically, the waybill data of any period and any length of historical time period can be obtained.
[0055] Step S102: determining a pre-allocated user set corresponding to the waybill data to be allocated based on the historical waybill data.
[0056] According to the historical waybill data, the number of deliveries by the couriers in the road area where each waybill location is located in the waybill data to be allocated is counted, and the set of habitual couriers (pre-allocated user set) X for each waybill is selected as {i, ..., j} according to the number of deliveries. Specifically, a couriers with the largest number of deliveries can be selected as items in the set. Based on the set, the code of each waybill in the waybill data to be allocated is supplemented, and the code of each waybill after supplementation is {lat, lng, X}.
[0057] Optionally, when counting the number of deliveries by a delivery courier, only the historical waybill data of the courier on duty on that day can be counted, and then the corresponding pre-assigned user set only includes the items of the courier on that day. Compared with counting the waybill data of all couriers, it can greatly reduce the amount of data processing and improve the statistical speed.
[0058] Step S103, determining the target waybill data corresponding to each user to be allocated in the user set to be allocated according to the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated.
[0059] The waybill data corresponding to each user to be assigned is counted based on the waybill data to be assigned and the corresponding pre-assigned user set. Specifically, the familiar waybill set of each courier is counted, that is, the users included in the pre-assigned user set corresponding to each waybill are the habitual couriers of the waybill, that is, the waybill is the familiar waybill of the courier. All familiar waybills of each user (courier) to be assigned are counted to form a familiar waybill set. One waybill is selected from the familiar waybill set as the target waybill data for each user to be assigned. Among them, since the same waybill can be a familiar order for two or more users to be assigned, in order to avoid repeated selection, the target waybill data should be a waybill that has not been selected before.
[0060] Step S104, taking the target waybill data corresponding to each to-be-assigned user as the cluster center, performing semi-supervised clustering on the to-be-assigned waybill data to obtain an initial waybill data set corresponding to each to-be-assigned user.
[0061] A semi-supervised clustering algorithm is used to calculate the set of users to be assigned and the waybill data to be assigned, and the corresponding relationship between the set of users to be assigned and the waybill data to be assigned is obtained, which contains the initial waybill data set corresponding to each user to be assigned. Specifically, the target waybill corresponding to each user to be assigned is used as the initial point of the cluster center, and k cluster centers are obtained. The encoding format of each cluster center is (la, lng, i), where i is the code of the user to be assigned.
[0062] Step S105 , combining the initial waybill data set corresponding to each to-be-assigned user and the set path planning constraints, and solving the path planning problem to obtain the waybill data set corresponding to each to-be-assigned user.
[0063] Path planning is performed based on the calculated initial solution data, that is, the initial waybill data set corresponding to each user to be assigned, and the preset path planning constraints. The VRP solution is solved through the iterative layer to obtain the final result data of the correspondence between the waybill data to be assigned and the user to be assigned, that is, the waybill data set corresponding to each user to be assigned.
[0064] Optionally, the initial VRP route will be initialized according to the initial solution. Under the guidance of the initial solution, each user to be assigned corresponds to a specific order set, and the initial solution is generated relatively randomly. The specific order set takes into account the habits of the users to be assigned, the load of the users to be assigned, and the shortest distance constraints, so that the optimal solution can be obtained through rapid iteration. In this process, the items in the initial waybill data set corresponding to each user to be assigned are randomly sorted to obtain k routes in series, and input into jsprit (a model for solving VRP problems) for iterative solution. In the iteration of the VRP solution, more constraints such as capacity, personnel ratio, waybill timeliness, and vehicle load balancing are considered. At the same time, the shortest distance and the highest order overlap rate are taken as the objective function, and the final distribution scheduling solution is obtained according to the specified iteration rounds and running time. Among them, the personnel ratio is the attendance rate of the courier; the waybill timeliness constraint requires that the number of waybills delivered on time is greater than the preset threshold, such as 80%. Among them, the constraint formula is as follows.
[0065]
[0066] Where dis is the distance between the target waybill and the waybill to be assigned; num is the user to be assigned; and The preset weight value k is the number of routes, and N is the number of users to be assigned.
[0067] According to the data allocation method provided by the embodiment of the present invention, it is possible to determine the pre-allocated user set of the waybill data to be allocated based on the historical waybill data, and further determine the target waybill data corresponding to each user to be allocated in combination with the waybill data to be allocated, and use the target waybill data as the cluster center to calculate the initial solution data of the correspondence between the waybill data to be allocated and the user to be allocated using a semi-supervised clustering algorithm, and on this basis use the VRP model to calculate the final solution to obtain the data allocation result. By calculating the initial solution using a semi-supervised clustering algorithm and then solving the VRP based on the initial solution, the complexity of solving the VRP can be greatly reduced, the time consumed in solving the solution can be reduced, and the solving efficiency can be improved.
[0068] Optionally, the pre-allocated user set corresponding to the waybill data to be allocated is determined based on the historical waybill data, including: determining the location information of each waybill to be allocated based on the waybill data to be allocated; counting the user delivery data of each location information based on the historical waybill data; and determining the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information. Determine the location coordinates of each waybill based on the waybill data to be allocated, and determine the road area information to which the location of each waybill belongs based on the coordinates. Count the number of courier delivery times in each road area of all road areas to which the waybill data to be allocated belongs; determine the set of habitual couriers corresponding to each waybill to be allocated, that is, the pre-allocated user set, based on the counted number of courier delivery times. For example, if the road area of waybill a is q, the number of deliveries by courier b in road area q is 30, the number of deliveries by courier c is 49, and the number of deliveries by courier d is 118, then the determined set of habitual couriers corresponding to waybill a may be {d}.
[0069] Optionally, when counting the number of deliveries by couriers, the number of deliveries by all couriers may be counted, or only the couriers on duty on the day, that is, the historical number of deliveries of the users to be assigned may be counted.
[0070] Optionally, determining the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information includes: determining the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information and a preset delivery number threshold. When determining the pre-allocated user set corresponding to each waybill to be allocated, the pre-allocated user is determined based on the statistical courier delivery number data and the preset delivery number threshold. Specifically, users whose delivery number is greater than the preset delivery number threshold are selected as items in the pre-allocated user set.
[0071] Optionally, the pre-assigned user set corresponding to each waybill to be assigned may be determined by selecting a preset number of users as items in the pre-assigned user set in descending order of the number of delivery times.
[0072] Alternatively, only the user with the largest number of deliveries may be selected as the item in the pre-assigned user set.
[0073] Optionally, according to the waybill data to be allocated and the set of pre-allocated users corresponding to the waybill data to be allocated, the target waybill data corresponding to each user to be allocated in the user set to be allocated is determined, including: according to the waybill data to be allocated and the set of pre-allocated users corresponding to the waybill data to be allocated, the set of deliverable waybills corresponding to each user to be allocated is determined; based on the set of deliverable waybills corresponding to each user to be allocated, the target waybill data corresponding to each user to be allocated is determined. According to the waybill data to be allocated and the set of pre-allocated users corresponding to the waybill data to be allocated, the deliverable waybills for each user to be allocated are determined, and all the determined deliverable waybills constitute a deliverable waybill set. One waybill in the set of deliverable waybills is selected as the target waybill data for the user to be allocated.
[0074] According to the data allocation method provided by the embodiment of the present invention, the initial solution data of the correspondence between the waybill data to be allocated and the user to be allocated can be calculated by using a semi-supervised clustering algorithm, and on this basis, the VRP model is used to calculate the final solution to obtain the data allocation result. By calculating the data allocation result by combining the semi-supervised clustering algorithm with the VRP solution method, the complexity of VRP solution can be greatly reduced, the time consumed for solution can be reduced, and the solution efficiency can be improved. At the same time, the historical waybill data can be used to help determine the target waybill of the user to be allocated, which can further improve the accuracy of the calculation results of the semi-supervised clustering algorithm, reduce the difficulty of VRP solution, and improve the solution performance.
[0075] Optionally, the target waybill data corresponding to each user to be assigned is determined based on the deliverable waybill set corresponding to each user to be assigned, including: for each user to be assigned, when the deliverable waybill set corresponding to the user to be assigned includes at least one waybill data, a deliverable waybill different from the target waybill data corresponding to other users to be assigned is selected from the deliverable waybill set corresponding to the user to be assigned as the target waybill data corresponding to the user to be assigned. For each user to be assigned, if the deliverable waybill set corresponding to the user to be assigned is not empty, a waybill is selected from the corresponding deliverable waybill set as the target waybill for the user to be assigned. The selected waybill should be a waybill that has not been selected as a target waybill by other users to be assigned. The selected target waybill data may be randomly selected.
[0076] Optionally, the method further includes: for each user to be assigned, when the set of deliverable waybills corresponding to the user to be assigned does not include waybill data, randomly selecting a waybill data different from the target waybill data corresponding to other users to be assigned from the waybill data to be assigned as the target waybill data corresponding to the user to be assigned. If the set of deliverable waybills corresponding to the user to be assigned is empty, randomly selecting a waybill that has not been selected by other users to be assigned from the waybill data to be assigned as the target waybill.
[0077] Optionally, the target waybill data corresponding to each user to be assigned is used as the cluster center, and semi-supervised clustering is performed on the waybill data to be assigned to obtain an initial waybill data set corresponding to each user to be assigned, including: taking the target waybill data corresponding to each user to be assigned as the cluster center, taking the vehicle capacity of each user to be assigned as a constraint condition, taking the shortest total delivery distance of the waybill data corresponding to the user to be assigned and the maximum familiarity of the user to be assigned with the location information of each waybill to be assigned in the waybill data to be assigned as the objective function, performing semi-supervised clustering on the waybill data to be assigned to obtain an initial waybill data set corresponding to each user to be assigned; wherein the familiarity of the user to be assigned with the location information of each waybill to be assigned in the waybill data to be assigned is obtained in the following manner: for the location information of each waybill to be assigned in the waybill data to be assigned, counting the total number of deliveries corresponding to the location information of the waybill to be assigned, and the number of deliveries of each user to be assigned corresponding to the location information of the waybill to be assigned; based on the total number of deliveries corresponding to the location information of the waybill to be assigned and the number of deliveries of each user to be assigned, calculating the familiarity of each user to be assigned with the location information of the waybill to be assigned.
[0078] The problem of solving the corresponding relationship between the waybill data to be allocated and the user to be allocated is transformed into the minimum cost flow (MCF) problem, and the problem is transformed based on the vehicle capacity of the user to be allocated and the volume of the waybill to be allocated. Specifically, the k cluster centers are used as demand points , the attribute value is the vehicle capacity, the waybill to be assigned as the supply point The traditional MCF problem includes two main roles: supply point and demand point. To distinguish, if , then this point is the supply point. If , then this point is a demand point. Each supply point is connected to a demand point to form an edge , and the variable Representative side The flow rate on Represents the flow edge The cost, is the flow threshold, the MCF problem can be expressed as follows.
[0079]
[0080]
[0081]
[0082] When solving the problem, it is necessary to ensure that the supply point supply to the demand point has the same demand value, and auxiliary points need to be added The demand value of this point is , That is, the difference between the supply point and the demand point. The ratio of the waybill volume to the vehicle capacity is less than 80% as a constraint, and the shortest distance and the maximum habitual overlap rate are used as the objective function for solution. The shortest distance is the shortest distance between the demand point and the supply point, and the habitual overlap rate is the overlap between the actual delivery courier of the waybill and the delivery courier obtained by the solution. The formula of the objective function is as follows.
[0083]
[0084] Among them, k represents the cluster center point set, n represents the cluster internal point set, represents the number of points in the cluster containing courier i. and is the preset weight value.
[0085] By solving the above minimum cost flow problem, the initial solution data of the correspondence between the waybill data to be allocated and the users to be allocated are obtained, that is, the initial waybill data set result corresponding to each user to be allocated.
[0086] According to the data allocation method provided by the embodiment of the present invention, a semi-supervised clustering algorithm can be used to calculate the initial solution data of the correspondence between the waybill data to be allocated and the user to be allocated, and the VRP model is combined to calculate the final solution to obtain the data allocation result. By combining the semi-supervised clustering algorithm with the VRP solution method, the complexity of VRP solution can be greatly reduced, the solution time can be reduced, and the solution efficiency can be improved.
[0087] Figure 2 is a schematic diagram of a data distribution device 200 provided in an embodiment of the present invention, such as Figure 2 As shown, the data distribution device 200 according to the embodiment of the present invention mainly includes: an acquisition module 201 , a calculation module 202 and a calculation module 203 .
[0088] The acquisition module 201 is used to acquire the user set to be allocated, the waybill data to be allocated and the historical waybill data;
[0089] Determination module 202, used to determine the pre-assigned user set corresponding to the waybill data to be assigned based on the historical waybill data; determine the target waybill data corresponding to each to-be-assigned user in the to-be-assigned user set according to the waybill data to be assigned and the pre-assigned user set corresponding to the waybill data to be assigned;
[0090] The calculation module 203 is used to use the target waybill data corresponding to each user to be assigned as the cluster center, perform semi-supervised clustering on the waybill data to be assigned, and obtain an initial waybill data set corresponding to each user to be assigned; combine the initial waybill data set corresponding to each user to be assigned and the set path planning constraints, and obtain the waybill data set corresponding to each user to be assigned by solving the path planning problem.
[0091] According to the data distribution device provided by the embodiment of the present invention, it is possible to determine the pre-allocated user set of the waybill data to be allocated based on the historical waybill data, and further determine the target waybill data corresponding to each user to be allocated in combination with the waybill data to be allocated, and use the target waybill data as the cluster center to calculate the initial solution data of the correspondence between the waybill data to be allocated and the user to be allocated using a semi-supervised clustering algorithm, and on this basis, use the VRP model to calculate the final solution to obtain the data distribution result. By calculating the initial solution using a semi-supervised clustering algorithm and then solving the VRP based on the initial solution, the complexity of solving the VRP can be greatly reduced, the time consumed in solving the solution can be reduced, and the solving efficiency can be improved.
[0092] Optionally, a determination module 202 is used to determine a pre-allocated user set corresponding to the waybill data to be allocated based on historical waybill data, including: a determination module 202, used to determine the location information of each waybill to be allocated based on the waybill data to be allocated; a statistics module 204, used to count the user delivery data of each location information based on the historical waybill data; a determination module 202, used to determine the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information.
[0093] Optionally, the determination module 202 is used to determine the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information, including: the determination module 202 is used to determine the pre-allocated user set corresponding to the waybill data to be allocated based on the user delivery data of each location information and a preset delivery number threshold.
[0094] Optionally, a determination module 202 is used to determine the target waybill data corresponding to each user to be assigned in the user set to be assigned based on the waybill data to be assigned and the pre-assigned user set corresponding to the waybill data to be assigned, including: a determination module 202 is used to determine the deliverable waybill set corresponding to each user to be assigned based on the waybill data to be assigned and the pre-assigned user set corresponding to the waybill data to be assigned; and determine the target waybill data corresponding to each user to be assigned based on the deliverable waybill set corresponding to each user to be assigned.
[0095] Optionally, the determination module 202 is used to determine the target waybill data corresponding to each user to be assigned based on the deliverable waybill set corresponding to each user to be assigned, including: the determination module 202 is used to, for each user to be assigned, when the deliverable waybill set corresponding to the user to be assigned includes at least one waybill data, select a deliverable waybill different from the target waybill data corresponding to other users to be assigned from the deliverable waybill set corresponding to the user to be assigned, as the target waybill data corresponding to the user to be assigned.
[0096] Optionally, the device also includes: a selection module 205, which is used for randomly selecting, for each user to be assigned, a waybill data that is different from the target waybill data corresponding to other users to be assigned from the waybill data to be assigned, as the target waybill data corresponding to the user to be assigned, when the waybill data is not included in the deliverable waybill set corresponding to the user to be assigned.
[0097] Optionally, the calculation module 203 is used to take the target waybill data corresponding to each to-be-assigned user as the cluster center, perform semi-supervised clustering on the waybill data to be assigned, and obtain an initial waybill data set corresponding to each to-be-assigned user, including: the calculation module 203 is used to take the target waybill data corresponding to each to-be-assigned user as the cluster center, take the vehicle capacity of each to-be-assigned user as the constraint condition, take the shortest total delivery distance of the waybill data corresponding to the to-be-assigned user and the maximum familiarity of the to-be-assigned user with the location information of each to-be-assigned waybill in the to-be-assigned waybill data as the objective function, and perform semi-supervised clustering on the waybill data to be assigned. Semi-supervised clustering is performed to obtain an initial waybill data set corresponding to each user to be assigned; wherein the familiarity between the user to be assigned and the location information of each waybill to be assigned in the waybill data to be assigned is obtained in the following manner: for the location information of each waybill to be assigned in the waybill data to be assigned, the total number of deliveries corresponding to the location information of the waybill to be assigned and the number of deliveries of each user to be assigned corresponding to the location information of the waybill to be assigned are counted; based on the total number of deliveries corresponding to the location information of the waybill to be assigned and the number of deliveries of each user to be assigned, the familiarity between each user to be assigned and the location information of the waybill to be assigned is calculated.
[0098] According to the data allocation device provided by the embodiment of the present invention, the semi-supervised clustering algorithm can be used to calculate the initial solution data of the correspondence between the waybill data to be allocated and the user to be allocated, and the VRP model is combined to calculate the final solution to obtain the data allocation result. By combining the semi-supervised clustering algorithm with the VRP solution method, the complexity of VRP solution can be greatly reduced, the solution time can be reduced, and the solution efficiency can be improved.
[0099] Figure 3 An exemplary system architecture 300 is shown to which the method or apparatus for data distribution according to an embodiment of the present invention may be applied.
[0100] like Figure 3 As shown, the system architecture 300 may include terminal devices 301, 302, 303, a network 304 and a server 305. The network 304 is used to provide a medium for communication links between the terminal devices 301, 302, 303 and the server 305. The network 304 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0101] Users can use terminal devices 301, 302, 303 to interact with server 305 through network 304 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 301, 302, 303, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0102] The terminal devices 301 , 302 , and 303 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0103] The server 305 may be a server that provides various services, such as a background management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 301, 302, and 303. The background management server may analyze and process the received data such as the data allocation request, and feed back the processing result (such as the data allocation result - only an example) to the terminal device.
[0104] It should be noted that the data distribution method provided in the embodiment of the present invention is generally executed by the server 305 , and accordingly, the data distribution device is generally set in the server 305 .
[0105] It should be understood that Figure 3 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0106] Reference below Figure 4 , which shows a schematic diagram of the structure of a computer system 400 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 4 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0107] like Figure 4As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the system 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0108] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
[0109] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above-mentioned functions defined in the system of the present invention are executed.
[0110] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0111] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] The units or modules involved in the embodiments of the present invention may be implemented in software or hardware. The units or modules described may also be provided in a processor. For example, they may be described as follows: a processor includes an acquisition module, a determination module, and a calculation module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves. For example, the acquisition module may also be described as a "module for acquiring a set of users to be allocated, waybill data to be allocated, and historical waybill data."
[0113] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0114] Obtain the user set to be allocated, waybill data to be allocated, and historical waybill data;
[0115] Determine a pre-allocated user set corresponding to the waybill data to be allocated based on the historical waybill data;
[0116] Determine the target waybill data corresponding to each user to be allocated in the user set to be allocated according to the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated;
[0117] The target waybill data corresponding to each user to be assigned is used as the cluster center, and semi-supervised clustering is performed on the waybill data to obtain the initial waybill data set corresponding to each user to be assigned;
[0118] By combining the initial waybill data set corresponding to each user to be assigned and the set path planning constraints, the waybill data set corresponding to each user to be assigned is obtained by solving the path planning problem.
[0119] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for data allocation provided by an embodiment of the present invention is implemented.
[0120] According to the technical solution of the embodiment of the present invention, it is possible to determine the pre-assigned user set of the waybill data to be assigned based on the historical waybill data, and further determine the target waybill data corresponding to each user to be assigned in combination with the waybill data to be assigned. Based on the target waybill data as the cluster center, a semi-supervised clustering algorithm is used to calculate the initial solution data of the correspondence between the waybill data to be assigned and the user to be assigned. On this basis, the VRP model is used to calculate the final solution to obtain the data allocation result. By calculating the initial solution using the semi-supervised clustering algorithm and then solving the VRP based on the initial solution, the complexity of solving the VRP can be greatly reduced, the time consumed in solving the solution can be reduced, and the solving efficiency can be improved.
[0121] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for data distribution, characterized in that: include: Obtain the user set to be allocated, waybill data to be allocated, and historical waybill data; Determine a pre-allocated user set corresponding to the to-be-allocated waybill data based on the historical waybill data; Determine, according to the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated, the target waybill data corresponding to each user to be allocated in the user set to be allocated; The target waybill data corresponding to each to-be-assigned user is used as the cluster center, and semi-supervised clustering is performed on the to-be-assigned waybill data to obtain an initial waybill data set corresponding to each to-be-assigned user; By combining the initial waybill data set corresponding to each user to be assigned and the set path planning constraints, the waybill data set corresponding to each user to be assigned is obtained by solving the path planning problem.
2. The method according to claim 1, characterized in that The determining, based on the historical waybill data, a set of pre-allocated users corresponding to the waybill data to be allocated comprises: Determine the location information of each waybill to be allocated according to the waybill data to be allocated; Counting user delivery data of each location information according to the historical waybill data; The pre-allocated user set corresponding to the to-be-allocated waybill data is determined based on the user delivery data of each of the location information.
3. The method according to claim 2, characterized in that The determining of the pre-allocated user set corresponding to the to-be-allocated waybill data based on the user delivery data of each of the location information comprises: Based on the user delivery data of each of the location information and a preset delivery number threshold, a pre-assigned user set corresponding to the waybill data to be assigned is determined.
4. The method according to any one of claims 1 to 3, characterized in that The determining, according to the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated, the target waybill data corresponding to each user to be allocated in the user set to be allocated comprises: Determine a deliverable waybill set corresponding to each user to be allocated according to the waybill data to be allocated and a pre-allocated user set corresponding to the waybill data to be allocated; The target waybill data corresponding to each user to be assigned is determined based on the deliverable waybill set corresponding to each user to be assigned.
5. The method according to claim 4, characterized in that The determining of target waybill data corresponding to each to-be-allocated user based on the deliverable waybill set corresponding to each to-be-allocated user includes: For each user to be assigned, when the deliverable waybill set corresponding to the user to be assigned includes at least one waybill data, a deliverable waybill different from the target waybill data corresponding to other users to be assigned is selected from the deliverable waybill set corresponding to the user to be assigned as the target waybill data corresponding to the user to be assigned.
6. The method according to claim 5, characterized in that The method further comprises: For each user to be assigned, if the waybill data is not included in the deliverable waybill set corresponding to the user to be assigned, a waybill data different from the target waybill data corresponding to other users to be assigned is randomly selected from the waybill data to be assigned as the target waybill data corresponding to the user to be assigned.
7. The method according to any one of claims 1 to 3, characterized in that The target waybill data corresponding to each to-be-allocated user is used as the cluster center, and semi-supervised clustering is performed on the to-be-allocated waybill data to obtain an initial waybill data set corresponding to each to-be-allocated user, including: The target waybill data corresponding to each to-be-assigned user is taken as the cluster center, the vehicle capacity of each to-be-assigned user is taken as the constraint condition, the total delivery distance of the waybill data corresponding to the to-be-assigned user is minimized, and the familiarity between the to-be-assigned user and the location information of each to-be-assigned waybill in the to-be-assigned waybill data is maximized as the objective function, and the to-be-assigned waybill data is semi-supervised clustered to obtain the initial waybill data set corresponding to each to-be-assigned user; The familiarity between the user to be assigned and the location information of each waybill to be assigned in the waybill to be assigned data is obtained in the following way: For each location information of the waybill to be allocated in the waybill data to be allocated, counting the total number of deliveries corresponding to the location information of the waybill to be allocated, and the number of deliveries to each user to be allocated corresponding to the location information of the waybill to be allocated; Based on the total number of deliveries corresponding to the location information of the waybill to be assigned and the number of deliveries of each user to be assigned, the familiarity of each user to be assigned with the location information of the waybill to be assigned is calculated.
8. A data distribution device, characterized in that: include: The acquisition module is used to obtain the user set to be allocated, the waybill data to be allocated and the historical waybill data; A determination module, configured to determine a set of pre-allocated users corresponding to the to-be-allocated waybill data based on the historical waybill data; Determine, according to the waybill data to be allocated and the pre-allocated user set corresponding to the waybill data to be allocated, the target waybill data corresponding to each user to be allocated in the user set to be allocated; A calculation module is used to use the target waybill data corresponding to each to-be-allocated user as the cluster center, perform semi-supervised clustering on the to-be-allocated waybill data, and obtain an initial waybill data set corresponding to each to-be-allocated user; By combining the initial waybill data set corresponding to each user to be assigned and the set path planning constraints, the waybill data set corresponding to each user to be assigned is obtained by solving the path planning problem.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
