Order splitting method, device, storage medium, electronic device and product
By dividing the waybills into grids and clustering in the takeaway delivery system, the grid and waybill clusters are formed, and the problem of unreasonable order division is solved, and the speed of order division and delivery quality are improved.
Patent Information
- Application Number
- CN202310166334.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-14
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-02-14
AI Technical Summary
In the prior art, the order-sharing method of takeaway delivery is not reasonable enough, resulting in high overlap rate of the area recalled by the delivery staff, low efficiency, and affecting the delivery quality.
By dividing the waybill into multiple grids and performing clustering processing, grid clusters and waybill clusters are formed, and the final order division results are obtained, random grouping is avoided, and the order division speed and rationality are improved.
While improving the order-subdividing speed, it enhances the rationality of order-subdividing, reduces overlap in the waybill package, and improves the delivery quality.
Smart Images

Figure CN116307979B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a bill splitting method, a bill splitting device, a computer-readable storage medium, an electronic device, and a computer program product. Background Art
[0002] Takeout delivery is a crucial part of the food delivery process. The delivery process and delivery completion impact both fulfillment efficiency and user experience. The rationality of how orders are allocated to delivery personnel largely determines the quality of food delivery. Therefore, to improve delivery quality, a rational and rapid order splitting method is urgently needed in the relevant technologies.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention
[0004] The purpose of this application is to provide an order splitting method, an order splitting device, a computer-readable storage medium, an electronic device and a computer program product, so as to improve the rationality and speed of order splitting at least to a certain extent.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.
[0006] According to one aspect of the present application, a method for splitting waybills is provided, which includes: dividing each waybill in the area to be split into multiple grids according to the merchant location corresponding to each waybill; clustering the multiple grids to obtain multiple grid clusters; determining whether there is a target grid cluster among the multiple grid clusters; wherein the number of waybills in the target grid cluster is greater than the preset number of waybills; if the target grid cluster exists, clustering the multiple waybills in the target grid cluster to obtain multiple waybill clusters; cluster merging according to the grid clusters and the waybill clusters to obtain the splitting results of each waybill in the area to be split.
[0007] According to another aspect of the present application, a waybill splitting device is provided, which includes: a division module for dividing each waybill in the area to be split into multiple grids according to the merchant location corresponding to each waybill; a grid clustering module for clustering the multiple grids to obtain multiple grid clusters; a determination module for determining whether there is a target grid cluster among the multiple grid clusters; wherein the number of waybills in the target grid cluster is greater than the preset number of waybills; a waybill clustering module for clustering the multiple waybills in the target grid cluster to obtain multiple waybill clusters if the target grid cluster exists; and a cluster merging module for cluster merging the grid clusters and the waybill clusters to obtain the splitting results of each waybill in the area to be split.
[0008] According to another aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the order splitting method as described above when executing the computer program.
[0009] According to one aspect of the present application, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed on a computer or a processor, the computer or processor executes the order splitting method as described above.
[0010] According to another aspect of the present application, a computer program product comprising instructions is provided. When the computer program product is run on a computer or a processor, the computer or processor executes the order splitting method as described above.
[0011] The order splitting method, order splitting device, computer-readable storage medium, electronic device, and computer program product provided by the embodiments of the present application have the following technical effects:
[0012] In the solution provided by the exemplary embodiment of the present application, each waybill is first divided into multiple grids based on the merchant locations corresponding to each waybill in the area to be divided, and the multiple grids are clustered to obtain multiple grid clusters. That is, when dividing the waybill, clustering is first performed at the grid granularity, which can reduce the number of analyzed individuals to a certain extent, thereby improving the speed of order division. If there is a target grid cluster among the multiple grid clusters with a number of waybills greater than the preset number of waybills, the multiple waybills in the target grid cluster are further clustered to obtain multiple waybill clusters, and then clusters are merged based on the grid clusters and waybill clusters to obtain the order division results. That is, when dividing the waybill, clustering is first performed at the grid granularity to obtain multiple grid clusters, and then the multiple waybills in the target grid cluster are clustered at the waybill granularity, without having to analyze and process each waybill in the area to be divided at the waybill granularity. This is equivalent to reducing the number of individual waybills analyzed to a certain extent, thereby facilitating the speed of order division. Furthermore, for the target grid cluster, waybills exceeding the preset number of waybills within the target grid cluster are not randomly grouped. Instead, multiple waybills within the target grid cluster are clustered to form multiple waybill clusters. This avoids the situation where the waybills within a cluster are not clustered together due to random grouping. Therefore, the speed of waybill sorting is increased while improving the rationality of waybill sorting. Furthermore, for the waybill clusters and grid clusters obtained through clustering, the waybills within each cluster are spatially clustered, further improving the rationality of waybill sorting.
[0013] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are incorporated into the specification and constitute a part of this application, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0015] Figure 1 A flowchart of an order splitting method provided in one embodiment of the present application.
[0016] Figure 2 This is a flowchart of an implementation method of S130 provided in one embodiment of the present application.
[0017] Figure 3 This is a flowchart of an implementation method of S1302 provided in one embodiment of the present application.
[0018] Figure 4This is a flowchart of an implementation method of S301 provided in one embodiment of the present application.
[0019] Figure 5 A schematic diagram of a grid cluster obtained after multiple recursive segmentation processes according to an embodiment of the present application.
[0020] Figure 6 This is a flowchart of an implementation method of S120 provided in one embodiment of the present application.
[0021] Figure 7 This is a flowchart of an implementation method of S601 provided in one embodiment of the present application.
[0022] Figure 8 This is a flowchart of an implementation method of S140 provided in one embodiment of the present application.
[0023] Figure 9 This is a flowchart of an implementation method of S801 provided in one embodiment of the present application.
[0024] Figure 10 A flowchart illustrating an implementation method of recursively segmenting candidate waybill clusters provided in an embodiment of the present application until a preset waybill segmentation end condition is met to obtain recursively segmented waybill clusters.
[0025] Figure 11 This is a flowchart of an implementation method of S1001 provided in one embodiment of the present application.
[0026] Figure 12 A schematic diagram of an order splitting device provided in one embodiment of the present application.
[0027] Figure 13 The figure schematically shows a structural diagram of an electronic device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0029] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; on the contrary, these embodiments are provided so that this application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced while omitting one or more of the above-mentioned specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present application.
[0031] In addition, the accompanying drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0032] With the development of the Internet, delivery services have greatly facilitated people's lives. Industries such as lifestyle services have also implemented online ordering and distribution to enable users to quickly place and deliver orders.
[0033] Take food delivery as an example. Delivery is a crucial step in the fulfillment process. The delivery process and delivery completion significantly impact fulfillment efficiency and user experience. The rationality of allocating waybills to delivery drivers also significantly determines the quality of delivery. In instant delivery logistics, when matching waybills with delivery drivers, the dispatch system first searches for qualified riders within a certain radius, centered around the merchant. After a suitable delivery driver is recalled, the dispatch system scores the riders based on various factors and assigns the order to the most suitable rider based on their scores. This matching process is typically performed in batches, creating a waybill matrix for a batch of waybills and recalled delivery drivers. However, due to computing resource and performance limitations, waybills must be segmented into multiple waybill packages. The package size is controlled by setting a limit on the number of waybills. The size of each waybill matrix is also controlled by controlling the recall radius and the number of recalled delivery drivers within each package. Finally, multiple waybill matrices are computed in parallel to accelerate computation.
[0034] In the related art, in the process of splitting the waybill to form the waybill package, the waybill is divided according to the business area, and the waybill that exceeds the order quantity limit is randomly grouped, resulting in insufficient aggregation of the waybill in the waybill package after the split. When the deliveryman is recalled, the deliveryman's recall area often overlaps, resulting in a high overlap rate of recalled deliverymen between different waybill packages, requiring secondary processing, resulting in low efficiency, that is, unreasonable order splitting, which affects the subsequent delivery quality.
[0035] The embodiments of the present application provide a method for splitting orders, an apparatus for splitting orders, and a computer-readable storage medium, an electronic device, and a computer program product for implementing the above-mentioned method, which can solve the above-mentioned problems existing in the related art. The following is a detailed description of the embodiment of the method for splitting orders provided in the embodiments of the present application:
[0036] in, Figure 1 This is a flow chart of the order splitting method provided in one embodiment of the present application. For example, the execution subject of the order splitting method provided in the embodiment of the present application is an electronic device, such as a server. Figure 1 , the embodiment shown in the figure includes: S110-S160.
[0037] S110: Divide each waybill into multiple grids according to the merchant location corresponding to each waybill in the area to be divided.
[0038] S120: performing clustering processing on the multiple grids to obtain multiple grid clusters.
[0039] S130: Determine whether a target grid cluster exists among the multiple grid clusters. If yes, execute step S140; otherwise, execute step S160.
[0040] S140: Clustering the multiple waybills in the target grid cluster to obtain multiple waybill clusters.
[0041] S150: Clustering and merging are performed based on the grid clusters and the waybill clusters to obtain the waybill splitting results for each waybill in the area to be split.
[0042] S160: Obtaining order splitting results for each waybill in the area to be split based on the multiple grid clusters.
[0043] exist Figure 1In the order splitting method provided in the illustrated embodiment, each waybill in the area to be split is first divided into multiple grids based on the merchant locations corresponding to each waybill. The multiple grids are then clustered to obtain multiple grid clusters. This means that clustering is performed at the grid granularity when splitting the waybill, which can reduce the number of individual items analyzed to a certain extent, thereby improving the speed of order splitting. If a target grid cluster exists among the multiple grid clusters, where the number of waybill items exceeds a preset number, the multiple waybill items in the target grid cluster are further clustered to obtain multiple waybill clusters. Clusters are then merged based on the grid clusters and the waybill clusters to obtain the order splitting results. Specifically, clustering is performed at the grid granularity to obtain multiple grid clusters, and then the multiple waybill items in the target grid cluster are clustered at the waybill granularity, eliminating the need to analyze each waybill in the area to be split at the waybill granularity. This effectively reduces the number of individual waybill items analyzed, thereby facilitating faster order splitting. Furthermore, for the target grid cluster, waybills exceeding the preset number of waybills within the target grid cluster are not randomly grouped. Instead, multiple waybills within the target grid cluster are clustered to form multiple waybill clusters. This avoids the situation where the waybills within a cluster are not clustered together due to random grouping. Therefore, the speed of waybill sorting is increased while improving the rationality of waybill sorting. Furthermore, for the waybill clusters and grid clusters obtained through clustering, the waybills within each cluster are spatially clustered, further improving the rationality of waybill sorting.
[0044] The following Figure 1 The specific implementation of each step in the embodiment shown is described in detail:
[0045] In S110, the area to be divided can be set according to actual needs. For example, the area to be divided can be determined based on administrative divisions, for example, the city is used as the area to be divided, or the various districts in the city are used as the area to be divided, and so on. Alternatively, the area to be divided can be determined based on the size of a preset area. The size of the preset area can be set according to actual needs. Alternatively, the area to be divided can be determined based on a preset business district. For example, the sum of the areas where multiple business districts are located can be used as the area to be divided. However, this embodiment does not specifically limit the method for determining the area to be divided.
[0046] Each waybill in the above-mentioned area to be divided can be understood as: each waybill whose delivery starting point is in the area to be divided, and the delivery starting point can be understood as the merchant location. It can be understood that the information of the waybill can usually include: the delivery starting point of the waybill, the delivery destination of the waybill, the user information of the order, and the expected delivery arrival time of the waybill. Therefore, the delivery starting point of the waybill can be obtained from the information of the waybill, and the delivery starting point can be used as the merchant location corresponding to the waybill. Thus, the electronic device can divide each waybill into multiple grids according to the merchant location corresponding to each waybill in the area to be divided. The above-mentioned merchant location can be the latitude and longitude coordinates of the merchant's location.
[0047] For example, the aforementioned multiple grids can be formed by dividing the area to be divided. For example, the grid side length is set to a meter, and the area to be divided is divided into a grid by a meter, resulting in multiple grids. The merchant location corresponding to each waybill in the area to be divided is then mapped to the corresponding grid, thereby dividing each waybill into multiple grids. Thus, each waybill in the area to be divided can fall into multiple grids.
[0048] This embodiment does not limit the shape of the grid. The grid shape is not limited to squares, but can also be other shapes such as rectangles, hexagons, and irregular polygons. Furthermore, this embodiment does not limit the size of the grid. Grid division does not necessarily follow a fixed size; the sizes of grids within the same geographic area can vary.
[0049] Exemplarily, the grid in this embodiment can be a honeycomb hexagonal grid, which is a network based on a global discrete grid. The global discrete grid is a new type of global modeling solution that divides the world into a seamless, non-overlapping, hierarchical multi-resolution grid structure and uniformly encodes the grid. In this embodiment, the merchant location corresponding to each waybill in the area to be divided can be mapped to the honeycomb hexagonal grid, so that each waybill in the area to be divided can fall into the honeycomb hexagonal grid. Then, the number of waybills in each hexagonal grid is counted, and finally a plurality of hexagonal grids with waybills are screened out, and the plurality of hexagonal grids with waybills are used as the plurality of grids in S110, or the plurality of hexagonal grids with waybills are used as the objects of clustering processing in S120.
[0050] For example, in this embodiment, the grids divided by waybills can be represented by points in two-dimensional space. Assume that there are Q grids divided by waybills, and Q grids correspond to Q points in two-dimensional space. The number of waybills aggregated in the i-th grid is represented as t i , where i<=Q, the coordinates of the point representing the i-th grid can be expressed as (lat i , lng i ).
[0051] For example, the coordinates of the point representing the i-th grid can be: the geometric center coordinates of the i-th grid. Alternatively, the coordinates of the point representing the i-th grid can be: the average value of the merchant locations corresponding to each waybill in the grid. The average value of the merchant locations can be understood as the average value of the latitude and longitude coordinates of the merchant locations, for example: Among them, lat i is the longitude coordinate of the point representing the i-th grid, lng i is the dimensional coordinate of the point representing the i-th grid, T is the number of waybills in the i-th grid, lat q is the longitude coordinate of the merchant location corresponding to the qth waybill in the i-th grid, lng q is the dimensional coordinate of the merchant location corresponding to the qth waybill within the i-th grid. Optionally, the coordinates of the point representing the i-th grid may also be a weighted average of the merchant locations corresponding to each waybill in the grid. This weighted average of the merchant locations can be understood as a weighted average of the latitude and longitude coordinates of the merchant locations. However, this embodiment does not specifically limit the method for determining the coordinates of the point representing the i-th grid.
[0052] In S120, the electronic device may cluster multiple grids using a clustering algorithm to cluster the multiple grids, thereby obtaining multiple grid clusters. Clustering can be understood as dividing multiple grids into different clusters according to a specific standard (such as a distance criterion), so that the similarity of grids within the same cluster is as great as possible, while the differences of grids not in the same cluster are as great as possible. That is, after clustering, grids of the same type are clustered together as much as possible, while grids of different types are separated as much as possible. The clustering algorithm used in this embodiment may be a density-based spatial clustering algorithm (DBscan), which can divide areas with sufficient density into clusters and can find clusters of any shape in a spatial database of noise. In this embodiment, multiple grids are clustered to obtain at least one grid cluster. The basis for clustering the grids may be grid positions, such as grid center point position data. A grid cluster may include at least one grid, and a grid may include at least one waybill. Grid positions corresponding to grids in the same grid cluster are relatively concentrated, and grid positions corresponding to grids in different grid clusters are relatively dispersed.
[0053] It should be noted that the clustering algorithm used in the embodiment of the present invention is not limited to the DBscan algorithm, and other clustering algorithms may also be used, such as the KMeans algorithm, k-medoids algorithm, k-modes algorithm, kernel k-means, hierarchical clustering algorithm, etc. This embodiment does not impose any restrictions on this.
[0054] In S130, the electronic device can calculate the number of waybills for each of the multiple grid clusters respectively. For example, for a grid cluster, the sum of the number of waybills obtained by adding up the number of waybills of the multiple grids in the grid cluster can be used as the number of waybills for the grid cluster. Then, based on the number of waybills of each of the multiple grid clusters, determine whether there is a grid cluster in the multiple grid clusters whose number of waybills is greater than the preset number of waybills. If so, the grid cluster in the multiple grid clusters whose number of waybills is greater than the preset number of waybills can be used as the target grid cluster. Among them, the preset number of waybills can be set according to actual needs, and the preset number of waybills can be the upper limit of the number of waybills in a waybill package in the desired order splitting result. The preset number of waybills set based on different areas to be split can be the same or different, and the preset number of waybills corresponding to the same area to be split at different time periods of the day can be the same or different. This embodiment does not specifically limit the size of the preset number of waybills.
[0055] In S140, the electronic device may perform clustering processing on the multiple waybills in the target grid cluster as clustering objects to obtain multiple waybill clusters. The clustering processing in this step is similar to the clustering processing in the above S120, except that: the clustering objects of the clustering processing in this step are the waybills in the target grid cluster, and the clustering objects of the clustering processing in the above S120 are grids. In this step, the same clustering algorithm as in S120 may be used to perform clustering processing to obtain multiple waybill clusters. In this embodiment, multiple waybills in the target grid cluster are clustered to obtain at least one waybill cluster. The basis for clustering the waybills may be the merchant location corresponding to the waybill, such as the latitude and longitude coordinates of the location of the merchant corresponding to the waybill.
[0056] Among them, a waybill cluster may include at least one waybill. The merchant locations corresponding to the waybills in the same waybill cluster are relatively concentrated, and the merchant locations corresponding to the waybills in different waybill clusters are relatively dispersed.
[0057] In S150, the electronic device may cluster and merge the grid clusters and the waybill clusters to obtain a waybill sorting result for each waybill in the to-be-sorted area. A grid cluster to be included in the cluster merging may be determined from the obtained multiple grid clusters. The grid cluster to be included in the cluster merging may be a non-target grid cluster from the multiple grid clusters, i.e., a grid cluster that does not belong to the target grid cluster.
[0058] For example, the grid clusters participating in the cluster merging can be first converted into waybill clusters, and then the converted waybill clusters can be cluster-merged with the waybill clusters obtained in S140 to obtain multiple merged waybill clusters, and the multiple merged waybill clusters can be used as the waybill splitting results. Among them, one waybill cluster in the multiple merged waybill clusters can be understood as a waybill package, that is, the waybill splitting results include multiple waybill packages.
[0059] Exemplarily, converting a grid cluster into a waybill cluster can be understood as combining the waybill items in each grid within the grid cluster into a waybill cluster. For example, grid cluster 1 includes four grids: grid 1 includes waybill 1 and waybill 2; grid 2 includes waybill 3 and waybill 4; grid 3 includes waybill 5; and grid 4 includes waybill 6, waybill 7, and waybill 8. In this case, converting grid cluster 1 into a waybill cluster can be understood as combining the waybill items in grids 1 through 4 into a waybill cluster. Consequently, the converted waybill cluster includes waybills 1 through 8.
[0060] For example, assuming the number of grid clusters is 100, 100 grid clusters are converted to obtain 100 waybill clusters. Assuming 20 waybill clusters are obtained in S140, the final waybill result obtained by merging the clusters includes 120 waybill clusters, that is, 120 waybill packages.
[0061] In this embodiment, each waybill in the area to be sorted is divided into multiple grids for sorting, reducing the number of individual items to be analyzed and significantly improving sorting speed. Furthermore, for the target grid cluster, waybill items exceeding the preset number of waybill items in the target grid cluster are not randomly grouped. Instead, the multiple waybill items in the target grid cluster are clustered to form multiple waybill clusters. This avoids the situation where random grouping results in insufficient clustering of waybill items within a cluster. Consequently, both the speed of sorting and the rationality of sorting can be improved.
[0062] In an exemplary embodiment, the number of grids in the above-mentioned target grid cluster is less than or equal to the preset number of grids and the number of waybills in the target grid cluster is greater than the preset number of waybills. That is to say, in this embodiment, the target grid cluster must not only meet the condition that the number of waybills is greater than the preset number of waybills, but also meet the condition that the number of grids is less than or equal to the preset number of grids. Among them, the preset number of grids can be set according to actual needs, for example, it can be set to 1. For ease of explanation, the preset number of waybills can also be represented by M below. For example, the number of grids in the target grid cluster is 1 and the number of waybills in the target grid cluster is greater than M, that is, the grids in the target grid cluster include one grid, and the number of waybills in this one grid is greater than M. In this case, the implementation method of determining whether there is a target grid cluster in the multiple grid clusters in the above S130 can be referred to. Figure 2 ,include:
[0063] S1301: Determine a candidate grid cluster from multiple grid clusters based on the number of waybills of each grid cluster; wherein the number of waybills of the candidate grid cluster is greater than the preset number of waybills.
[0064] S1302: recursively segment the candidate mesh clusters until a preset mesh segmentation end condition is met, thereby obtaining a recursively segmented mesh cluster.
[0065] S1303: Determine whether a target mesh cluster exists in the recursively segmented mesh clusters.
[0066] In this embodiment, by first screening out candidate grid clusters from the grid clusters for those with a greater number of waybills than the preset number, and then further recursively segmenting the candidate grid clusters to obtain the recursively segmented grid clusters, the selection range of the target grid clusters is reduced. Furthermore, if the number of grid cells in the target grid cluster is less than or equal to the preset number of grid cells and the number of waybills in the target grid cluster is greater than the preset number of waybills, this effectively adds a restriction to the target grid cluster. This can, to a certain extent, reduce the number of target grid clusters, which helps reduce the number of individual waybills analyzed and speed up order sorting.
[0067] The following Figure 2 The specific implementation of each step in the embodiment shown is described in detail:
[0068] In S1301, the electronic device may determine a grid cluster having a number of waybills greater than a preset number of waybills among multiple grid clusters based on the number of waybills of each grid cluster, and select the grid cluster having a number of waybills greater than the preset number of waybills among the multiple grid clusters as a candidate grid cluster.
[0069] In S1302, the electronic device may use a recursive segmentation algorithm to recursively segment the candidate grid clusters until a preset grid segmentation termination condition is satisfied, thereby obtaining a recursively segmented grid cluster. The grid segmentation termination condition may be set according to actual needs and is not specifically limited in this embodiment.
[0070] In S1303, the electronic device may determine, based on the number of grids and the number of waybills in each of the recursively segmented grid clusters, whether there is a grid cluster in each of the recursively segmented grid clusters having a grid number less than or equal to a preset number of grids and a number of waybills greater than the preset number of waybills. For example, a grid cluster in each of the recursively segmented grid clusters having a grid number of 1 and a number of waybills greater than M may be determined as the target grid cluster.
[0071] In an exemplary embodiment, the implementation of the above S1302 can be found in Figure 3 ,include:
[0072] S301: Determine L cluster center points based on multiple grids in a candidate grid cluster; where L is greater than or equal to 2.
[0073] S302: Classify the multiple grids in the candidate grid cluster into the L cluster centers according to the distances between the multiple grids in the candidate grid cluster and the L cluster centers, to obtain L grid clusters.
[0074] S303: Determine whether the L grid clusters meet a preset first iteration end condition. If yes, execute S305; otherwise, execute S304.
[0075] S304: Update the L cluster center points to the L cluster center points newly determined based on the L grid clusters, and proceed to S302.
[0076] S305: Determine whether there is a grid cluster with a number of waybills greater than a preset number of waybills among the L grid clusters that meet the first iteration end condition. If yes, execute S306; otherwise, execute S307.
[0077] S306: Grid clusters with a number of waybills greater than a preset number of waybills are selected as candidate grid clusters, and the process proceeds to S301.
[0078] S307: Determine whether a preset mesh segmentation end condition is met, and use the obtained mesh cluster as the mesh cluster after recursive segmentation.
[0079] In this embodiment, L cluster centers are determined based on multiple grids in the candidate grid cluster. Based on the distances between each of the grids in the candidate grid cluster and the L cluster centers, the grids in the candidate grid cluster are grouped into the L cluster centers, resulting in L grid clusters. If the L grid clusters do not meet the preset first iteration termination condition, the L cluster centers are updated to L cluster centers newly determined based on the L grid clusters, and the step of grouping the grids in the candidate grid cluster into the L cluster centers, based on the distances between each of the grids in the candidate grid cluster and the L cluster centers, to obtain L grid clusters is performed again until the L grid clusters meet the first iteration termination condition. If a grid cluster with more waybills than the preset number exists among the L grid clusters that meet the first iteration's termination criteria, the grid cluster with more waybills than the preset number is selected as a candidate grid cluster. The step of determining L cluster centers based on the multiple grids in the candidate grid cluster is repeated until the preset grid segmentation termination criteria are met. The resulting grid cluster is then used as the grid cluster after recursive segmentation. By continuously recursively segmenting the candidate grid clusters, and because the candidate grid clusters may be dynamically changing during the recursive processing, the L cluster centers determined based on the multiple grids in the candidate grid cluster also dynamically change, thereby balancing order sorting accuracy and speed.
[0080] The following Figure 3 The specific implementation of each step in the embodiment shown is described in detail:
[0081] In S301, the electronic device may determine L cluster center points based on multiple grids in the candidate grid cluster. The cluster center point may also be referred to as a centroid. For example, L grids may be selected from the multiple grids in the candidate grid cluster and used as the L cluster center points. Specifically, L coordinate points may be determined to represent the L grids and used as the L cluster center points.
[0082] In an exemplary embodiment, the implementation of the above S301 can be found in Figure 4 ,include:
[0083] S3011: Select two grids whose distance is greater than a first preset distance from a plurality of grids in a candidate grid cluster.
[0084] S3012: Cut the line between two grids whose distance is greater than a first preset distance into L line segments.
[0085] S3013: Determine L cluster center points based on the L line segments.
[0086] The following Figure 4The specific implementation of each step in the embodiment shown is described in detail:
[0087] In S3011, the electronic device may first calculate the distance between any two grids in the candidate grid cluster. Then, based on the distance between any two grids in the candidate grid cluster, the electronic device may select two grids from the multiple grids in the candidate grid cluster whose distance is greater than a first preset distance. The first preset distance may be set as needed and is not specifically limited in this embodiment. For example, the two grids in the multiple grids in the candidate grid cluster whose distance is greater than the first preset distance may be the two grids with the largest distance among the multiple grids.
[0088] Exemplarily, the distance between grids may be calculated by calculating the distance between the coordinates representing two grids based on the coordinates used to represent the grids, and using the calculated distance between the coordinates as the distance between the two grids.
[0089] In S3012, the line connecting two grids whose distance is greater than the first preset distance can be cut into L line segments. Among them, the L line segments can be L line segments of equal length or L line segments of unequal length, and this embodiment does not make any specific limitation on this. L≥2, the specific size of L can be set according to actual needs, for example, it can be set according to the distance between the two grids. The larger the distance between the two grids, the larger the corresponding size of L can be, and the smaller the distance between the two grids, the smaller the corresponding size of L can be. Optionally, L can also be determined based on the number of waybills in the candidate grid cluster. For example, the larger the number of waybills in the candidate grid cluster, the larger L, and the smaller the number of waybills in the candidate grid cluster, the smaller L. However, this embodiment does not make any specific limitation on this.
[0090] In an exemplary embodiment, L is determined based on a preset number of waybills and the number of waybills in the candidate grid cluster. That is, L can be adaptively changed based on the number of waybills in the candidate grid cluster. That is, each time a candidate grid cluster is recursively segmented, the number of segments can be dynamically and flexibly changed, balancing the accuracy and speed of the recursive segmentation. Alternatively, L can be calculated as follows: The integer is rounded upwards, with a minimum of 2; where Z1 is the number of waybills in the candidate grid cluster, that is, the sum of the number of waybills in each grid in the candidate grid cluster, and M is the preset number of waybills.
[0091] In S3013, the electronic device may determine L cluster center points based on the L line segments. For example, the center points of the L line segments may be taken to obtain L center points, and then the L center points may be used as the L cluster center points. It should be noted that this embodiment only uses the center points of the L line segments as an example. In a specific implementation, other points in the L line segments may also be taken as cluster center points.
[0092] In S302, the electronic device can determine the coordinate points representing multiple grids in the candidate grid cluster, and then calculate the distances between these coordinate points and L cluster center points respectively. Based on the calculated distances, the multiple grids in the candidate grid cluster are classified into the cluster center point closest to them, thereby obtaining L grid clusters.
[0093] In S303, the electronic device may determine whether the L grid clusters meet a preset first iteration end condition. The preset first iteration end condition may be set according to actual needs. Exemplarily, the first iteration end condition may be that the number of iterations reaches a preset number, or may also be that the L grid clusters obtained this time are the same or substantially the same as the L grid clusters obtained last time. When it is determined that the L grid clusters meet the preset first iteration end condition, it may be considered that L stable grid clusters are obtained, and the process proceeds to S305. When it is determined that the L grid clusters do not meet the preset first iteration end condition, it may be considered that the obtained L grid clusters are not stable enough, and the process proceeds to S304.
[0094] In S304, the electronic device may update the L cluster center points to the L cluster center points re-determined based on the L grid clusters. Exemplarily, for each grid cluster in the L grid clusters, the average value of the position may be calculated based on the position of each grid in the grid cluster, and the average value of the position may be used as the position of the new cluster center point re-determined based on the grid cluster. The position of the above-mentioned grid may be understood as the longitude and latitude coordinates representing the coordinate point of the grid. Optionally, the weighted average value of the position may be calculated based on the position of each grid in the grid cluster, and the weighted average value of the position may be used as the position of the new cluster center point re-determined based on the grid cluster. When the L cluster center points re-determined based on the L grid clusters are obtained, S302 is re-entered, that is, based on the distances between the multiple grids in the candidate grid cluster and the re-determined L cluster center points, the multiple grids in the candidate grid cluster are classified into the L cluster center points to obtain L grid clusters. Then proceed to S303: determine whether the L grid clusters obtained based on the re-determined L cluster center points meet the preset first iteration end condition, and iterate until the first iteration end condition is met, and then proceed to S305.
[0095] In S305 and S306, the electronic device may determine whether there is a grid cluster with a number of waybills greater than the preset number M of waybills among the L grid clusters that meet the first iteration end condition. If there is a grid cluster with a number of waybills greater than M, it indicates that there are grid clusters that need to be further segmented. The grid cluster with a number of waybills greater than M is then selected as a candidate grid cluster and the process proceeds to S301. If the electronic device determines that there is no grid cluster with a number of waybills greater than M among the L grid clusters that meet the first iteration end condition, it indicates that there are no grid clusters that need to be further segmented, and the process proceeds to S307.
[0096] Exemplarily, the electronic device can determine whether there is a grid cluster with a number of waybills greater than M and a number of grids greater than 1 among the L grid clusters that meet the first iteration end condition. If there is a grid cluster with a number of waybills greater than M and a number of grids greater than 1, the grid cluster with a number of waybills greater than M and a number of grids greater than 1 is used as a candidate grid cluster.
[0097] In S307, the electronic device determines whether a preset mesh segmentation termination condition is satisfied, and uses the obtained mesh cluster as the mesh cluster after recursive segmentation. The preset mesh segmentation termination condition can be set according to actual needs. When the preset mesh segmentation termination condition is satisfied, the electronic device can output the mesh cluster after recursive segmentation.
[0098] In an exemplary embodiment, the preset grid segmentation termination condition includes: all grid clusters after the current recursive segmentation process are first-class grid clusters, and the number of waybills in the first-class grid clusters is less than a preset number of waybills, M. In other words, if the number of waybills in all grid clusters after the current recursive segmentation process is less than M, the preset grid segmentation termination condition can be determined to be satisfied. If any grid cluster after the current recursive segmentation process has a number of waybills greater than M, the preset grid segmentation termination condition can be determined to be unsatisfied, and the recursive segmentation process is then repeated, with the grid clusters with a number of waybills greater than M being selected as candidate grid clusters.
[0099] In an exemplary embodiment, the preset mesh segmentation termination condition includes: each mesh cluster after the current recursive segmentation process is a second-type mesh cluster, and the number of meshes in the second-type mesh cluster is 1. In other words, when the number of meshes in each mesh cluster after the current recursive segmentation process is 1, the preset mesh segmentation termination condition can be determined to be satisfied. In this case, even if a mesh cluster exists with a number of waybills greater than M, since the number of meshes in this mesh cluster is 1, no further recursive mesh segmentation is required.
[0100] In an exemplary embodiment, the preset mesh segmentation termination condition includes: each mesh cluster after the current recursive segmentation process includes both first-type mesh clusters and second-type mesh clusters. In other words, the preset mesh segmentation termination condition is determined to be satisfied when either the number of waybills in each mesh cluster after the current recursive segmentation process is less than M or the number of meshes is 1. In other words, mesh clusters with less than M waybills and mesh clusters with 1 mesh do not require further recursive mesh segmentation.
[0101] Optionally, the preset grid segmentation termination condition may further include: the number of times the grid is recursively segmented reaches a preset number of times. The preset number of times may be set according to actual needs and is not specifically limited in this embodiment.
[0102] In this embodiment, during the recursive resegmentation of candidate grid clusters with a number of waybills greater than M, the two grids with the largest distance in the candidate grid cluster are selected. The line segment between the two grids with the largest distance is cut into L equal-length line segments, where L is at least 2. The center points of each of the L line segments are then calculated to obtain L cluster centers. The steps of classifying the grids in the candidate grid cluster to the cluster center closest to the L cluster centers based on their distances to each other are repeated to obtain L grid clusters, thereby obtaining L stable grid clusters. Recursive segmentation is continued until the number of waybills in each grid cluster is less than M, or until the cluster contains only grids. Recursive segmentation is terminated, and the recursively segmented grid clusters are output.
[0103] To understand the recursive segmentation process in this embodiment, please refer to Figure 5 , Figure 5 Schematic diagram of the grid clusters obtained after multiple recursive segmentation processes in this embodiment. Assume that the candidate grid clusters determined in S1301 from the multiple grid clusters include Figure 5 Grid clusters 1 and 2 in (a), after recursive segmentation of grid cluster 1, we get Figure 5 Grid clusters 1 and 2 in (b), Figure 5 In (b), the number of waybills in grid clusters 1 and 2 is greater than M, then Figure 5 The grid clusters 1 and 2 in (b) are both used as candidate grid clusters for further recursive segmentation. Figure 5 The grid cluster 1 in (b) is further recursively segmented to obtain Figure 5 Mesh clusters 1 and 2 in (c). Figure 5 The grid cluster 2 in (b) is further recursively segmented to obtain Figure 5 Mesh clusters 3 and 4 in (c). Figure 5 The number of waybills in grid clusters 3 and 4 in (c) is greater than M. Figure 5Grid clusters 3 and 4 in (c) are both used as candidate grid clusters for further recursive segmentation. Figure 5 The mesh cluster 3 in (c) is further recursively segmented to obtain mesh clusters 5 and 6 in 5(d). Figure 5 In (d), the number of waybills in grid cluster 5 is less than M. Figure 5 If the number of meshes in mesh cluster 6 in (d) is 1, the recursive segmentation process of mesh clusters 5 and 6 in 5(d) is stopped. Figure 5 The candidate grid cluster 1 in (a) is subjected to continuous recursive segmentation, and finally the grid clusters 1-8 in 5(d) are obtained. Figure 5 The mesh cluster 2 in (a) is subjected to continuous recursive segmentation, and finally the mesh clusters 9-19 in 5(d) are obtained. Therefore, the mesh clusters after the recursive segmentation are finally output as Figure 5 The grid in (d) is clustered 1-19. Assume that, Figure 5 In grid clusters 1-19 of (d), the number of grids in grid cluster 6 is 1 and the number of waybills is greater than M, then Figure 5 The mesh cluster 6 in (d) is determined as the target mesh cluster.
[0104] In an exemplary embodiment, the implementation of S120 can refer to Figure 6 ,include:
[0105] S601: Determine K cluster center points based on multiple grids, where K is greater than or equal to 2;
[0106] S602: Classify the multiple grids into K cluster centers according to the distances between the multiple grids and the K cluster centers, thereby obtaining K grid clusters;
[0107] S603: Determine whether the K grid clusters meet a preset second iteration end condition. If yes, execute S605; otherwise, execute S604.
[0108] S604: Update the K cluster center points to K cluster center points newly determined based on the K grid clusters, and execute S602 again.
[0109] S605: The obtained K grid clusters are used as a plurality of grid clusters after clustering processing.
[0110] The following Figure 6 The specific implementation of each step in the embodiment shown is described in detail:
[0111] In S601, the electronic device may determine K cluster center points based on the plurality of grids. For example, K grids may be selected from the plurality of grids and used as the K cluster center points. Specifically, K coordinate points representing the K grids may be determined and used as the K cluster center points.
[0112] In an exemplary embodiment, the implementation of the above S601 can be found in Figure 7 ,include:
[0113] S6011: Determine two grids in a plurality of grids whose distance is greater than a second preset distance.
[0114] S6012: Cut the line between two grids whose distance is greater than a second preset distance into K line segments.
[0115] S6013: Determine K cluster center points based on the K line segments.
[0116] The following Figure 7 The specific implementation of each step in the embodiment shown is described in detail:
[0117] In S6011, the electronic device may first calculate the distance between any two grids in the plurality of grids. Then, based on the distance between any two grids in the plurality of grids, the electronic device may select two grids in the plurality of grids whose distance is greater than a second preset distance. The second preset distance may be set as needed and is not specifically limited in this embodiment. For example, the two grids in the plurality of grids whose distance is greater than the second preset distance may be the two grids with the largest distance between them. The method for calculating the distance between grids has been described above and will not be repeated here to avoid repetition.
[0118] In S6012, the line connecting two grids whose distance is greater than the second preset distance can be cut into K line segments. Among them, the K line segments can be K line segments of equal length, or K line segments of unequal length, and this embodiment does not make specific restrictions on this. K≥2, the specific size of K can be set according to actual needs, for example, it can be set according to the distance between the two grids. The larger the distance between the two grids, the larger the corresponding size of K can be, and the smaller the distance between the two grids, the smaller the corresponding size of K can be. Optionally, K can also be determined based on the sum of the number of waybills of multiple grids. For example, the larger the sum of the number of waybills of multiple grids, the larger K is, and the smaller the sum of the number of waybills of multiple grids, the smaller K is. However, this embodiment does not make specific restrictions on this.
[0119] In an exemplary embodiment, K is determined based on the sum of the number of waybills in a preset grid and the number of waybills in multiple grids. In other words, K can be adaptively changed based on the sum of the number of waybills in multiple grids, balancing the accuracy and speed of clustering processing. Optionally, K can be calculated as follows: The number is rounded upwards to an integer, with a minimum of 2; where Z2 is the sum of the number of waybills in multiple grids, and M is the preset number of waybills.
[0120] In S6013, the electronic device may determine K cluster center points based on the K line segments. For example, the center points of the K line segments may be taken to obtain K center points, and then the K center points may be used as the K cluster center points. It should be noted that this embodiment only uses the center points of the K line segments as an example. In a specific implementation, other points in the K line segments may also be taken as cluster center points.
[0121] In S602, the electronic device may determine coordinate points representing multiple grids, and then calculate the distances between these coordinate points and K cluster center points respectively. Based on the calculated distances, the multiple grids may be classified into the cluster center points closest to them, thereby obtaining K grid clusters.
[0122] In S603, the electronic device may determine whether the K grid clusters meet a preset second iteration end condition. The preset second iteration end condition may be set according to actual needs. Exemplarily, the second iteration end condition may be that the number of iterations reaches a preset number, or may also be that the K grid clusters obtained this time are the same or substantially the same as the K grid clusters obtained last time. When it is determined that the K grid clusters meet the preset second iteration end condition, it can be considered that K stable grid clusters are obtained, and the process proceeds to S605. When it is determined that the K grid clusters do not meet the preset second iteration end condition, it can be considered that the obtained K grid clusters are not stable enough, and the process proceeds to S604.
[0123] In S604, the electronic device may update the K cluster centers to K cluster centers newly determined based on the K grid clusters. For example, for each grid cluster in the K grid clusters, an average position may be calculated based on the positions of each grid in the grid cluster, and the average position may be used as the position of the new cluster center newly determined based on the grid cluster. Optionally, a weighted average position may be calculated based on the positions of each grid in the grid cluster, and the weighted average position may be used as the position of the new cluster center newly determined based on the grid cluster. Once the K cluster centers newly determined based on the K grid clusters are obtained, the process re-enters S602, i.e., classifying the multiple grids into the K cluster centers based on their respective distances from the newly determined K cluster centers, thereby obtaining K grid clusters. The process then proceeds to S603, determining whether the K grid clusters obtained based on the newly determined K cluster centers meet a preset second iteration termination condition. This process continues until the second iteration termination condition is met, and the process then proceeds to S605.
[0124] In S605 , the electronic device determines that the K mesh clusters meet a preset second iteration end condition, and uses the obtained K mesh clusters as the multiple mesh clusters obtained by clustering the multiple meshes in S120 .
[0125] In an exemplary embodiment, the implementation of the above S140 can refer to Figure 8 ,include:
[0126] S801: Determine N cluster center points based on the merchant locations corresponding to each waybill in the target grid cluster, where N is greater than or equal to 2.
[0127] S802: Classify each waybill in the target grid cluster into the N cluster center points according to the distances between the merchant locations corresponding to each waybill in the target grid cluster and the N cluster center points, thereby obtaining N waybill clusters.
[0128] S803: Determine whether the N waybill clusters meet the preset third iteration end condition. If yes, execute S805; otherwise, execute S804.
[0129] S804: Update the N cluster center points to the N cluster center points newly determined based on the N waybill clusters, and execute S802 again.
[0130] S805: The obtained N waybill clusters are used as multiple waybill clusters after clustering processing.
[0131] The following Figure 8 The specific implementation of each step in the embodiment shown is described in detail:
[0132] In S801, the electronic device may determine N cluster center points based on the merchant locations corresponding to each waybill in the target grid cluster. For example, N merchant locations may be selected from the merchant locations corresponding to each waybill, and the points at which the N merchant locations are located may be used as the N cluster center points. N may be greater than or equal to 2 and less than the number of merchant locations corresponding to each waybill in the target grid cluster.
[0133] In an exemplary embodiment, the implementation of the above S801 can be found in Figure 9 ,include:
[0134] S8011: Determine two merchant locations whose distance is greater than a third preset distance among the merchant locations corresponding to each waybill in the target grid cluster.
[0135] S8012: Cut the line between two merchant locations whose distance is greater than a third preset distance into N line segments.
[0136] S8013: Determine N cluster center points based on the N line segments.
[0137] The following Figure 9 The specific implementation of each step in the embodiment shown is described in detail:
[0138] In S8011, the electronic device may first calculate the distance between any two merchant locations among the multiple merchant locations corresponding to each waybill in the target grid cluster. The distance between the merchant locations may be calculated based on the latitude and longitude coordinates corresponding to the merchant locations. Then, based on the distance between any two merchant locations among the multiple merchant locations, two merchant locations whose distance is greater than a third preset distance are selected from the multiple merchant locations. The third preset distance may be set according to actual needs and is not specifically limited in this embodiment. For example, the two merchant locations among the multiple merchant locations whose distance is greater than the third preset distance may be: the two merchant locations with the largest distance among the multiple merchant locations.
[0139] In S8012, the line between two merchant locations whose distance is greater than the third preset distance can be cut into N line segments. Among them, the N line segments can be N line segments of equal length, or N line segments of unequal length, and this embodiment does not make specific restrictions on this. N≥2, the specific size of N can be set according to actual needs, for example, it can be set according to the distance between the two merchant locations. The larger the distance between the two merchant locations, the larger the corresponding size of N can be, and the smaller the distance between the two merchant locations, the smaller the corresponding size of N can be. Optionally, N can also be determined based on the number of waybills in the target grid cluster. For example, the larger the number of waybills in the target grid cluster, the larger N, and the smaller the number of waybills in the target grid cluster, the smaller N. However, this embodiment does not make specific restrictions on this.
[0140] In an exemplary embodiment, N is determined based on the preset number of waybills and the number of waybills in the target grid cluster. That is, when the preset number of waybills is constant, N can be adaptively changed based on the number of waybills in the target grid cluster, balancing the accuracy and speed of clustering processing. Optionally, N can be calculated as follows: The integer is rounded upwards, with a minimum of 2; where Z3 is the number of waybills in the target grid cluster, that is, the sum of the number of waybills in each grid in the target grid cluster, and M is the preset number of waybills.
[0141] In S8013, the electronic device may determine N cluster center points based on the N line segments. For example, the center points of the N line segments may be taken to obtain N center points, which are then used as the N cluster center points. It should be noted that this embodiment uses the center points of the N line segments as an example. In a specific implementation, other points in the N line segments may also be taken as cluster center points.
[0142] In S802, the electronic device can calculate the distance between the merchant location corresponding to each waybill in the target grid cluster and the N cluster center points, and classify each waybill in the target grid cluster to the cluster center point closest to it based on the calculated distance, to obtain N waybill clusters.
[0143] In S803, the electronic device can determine whether the N waybill clusters meet the preset third iteration end condition. The third iteration end condition can be set according to actual needs. Exemplarily, the third iteration end condition can be that the number of iterations reaches a preset number, or it can also be: the N waybill clusters obtained this time are the same or substantially the same as the N waybill clusters obtained last time. When it is determined that the N waybill clusters meet the preset third iteration end condition, it can be considered that the N waybill clusters are obtained, and then enter S805. When it is determined that the N waybill clusters do not meet the third iteration end condition, it can be considered that the obtained N waybill clusters are not stable enough, and then enter S804.
[0144] In S804, the electronic device may update the N cluster center points to the N cluster center points re-determined based on the N waybill clusters. For example, for each waybill cluster in the N waybill clusters, an average value of the merchant locations may be calculated based on the merchant locations corresponding to each waybill in the waybill cluster. The average value of the merchant locations may be understood as the average value of the latitude and longitude coordinates of the merchant locations. The average value of the merchant locations is used as the position of the new cluster center point re-determined based on the waybill cluster.
[0145] Optionally, a weighted average of the merchant locations can be calculated based on the merchant locations corresponding to each waybill in the waybill cluster, and the weighted average of the merchant locations can be used as the location of the new cluster center point re-determined based on the waybill cluster. When the N cluster center points re-determined based on the N waybill clusters are obtained, S802 is re-entered, that is, based on the distance between the merchant locations corresponding to each waybill in the target grid cluster and the re-determined N cluster center points, each waybill in the target grid cluster is classified into the N cluster center points, thereby obtaining N waybill clusters. Then, S803 is again entered: whether the N waybill clusters obtained based on the re-determined N cluster center points meet the preset third iteration end condition, and the iteration is repeated until the third iteration end condition is met, and then S805 is entered.
[0146] In S805 , the electronic device determines that the N waybill clusters meet the preset third iteration end condition, and uses the obtained N waybill clusters as the multiple waybill clusters obtained by clustering the multiple waybills in the target grid cluster in S140 .
[0147] In an exemplary embodiment, after S140 above, the waybill splitting method further includes: determining whether there is a candidate waybill cluster among the multiple waybill clusters with a number of waybills greater than a preset number of waybills. If a candidate waybill cluster exists, recursively splitting the candidate waybill cluster until a preset waybill splitting end condition is met, thereby obtaining a recursively split waybill cluster. The corresponding implementation of S150 above includes: clustering and merging the grid clusters, the recursively split waybill clusters, and the waybill clusters other than the candidate waybill cluster among the multiple waybill clusters to obtain the waybill splitting results for each waybill in the area to be split.
[0148] In an exemplary embodiment, the above-mentioned recursive segmentation process is performed on the candidate waybill clusters until the preset waybill segmentation end condition is met. The implementation method of obtaining the recursively segmented waybill clusters can be referred to Figure 10 ,include:
[0149] S1001: Determine S cluster centers based on the merchant locations corresponding to each waybill in the candidate waybill cluster; where S is greater than or equal to 2.
[0150] S1002: Classify each waybill in the candidate waybill cluster into the S cluster center points according to the distance between the merchant location corresponding to each waybill in the candidate waybill cluster and the S cluster center points, thereby obtaining S waybill clusters.
[0151] S1003: Determine whether the S waybill clusters meet the preset fourth iteration end condition. If yes, execute S1005; otherwise, execute S1004.
[0152] S1004: Update the S cluster center points to the S cluster center points newly determined based on the S waybill clusters, and execute S1002 again.
[0153] S1005: Determine whether there is a waybill cluster with a number of waybill greater than a preset number of waybill among the S waybill clusters that meet the fourth iteration end condition. If yes, execute S1006; otherwise, execute S1007.
[0154] S1006: The waybill cluster with a number of waybills greater than the preset number of waybills is taken as a candidate waybill cluster, and S1001 is executed again.
[0155] S1007: Determine whether a preset waybill segmentation end condition is met, and use the obtained waybill cluster as the waybill cluster after recursive segmentation.
[0156] In this embodiment, S cluster center points are determined based on the merchant locations corresponding to each waybill in the candidate waybill cluster, where S is greater than or equal to 2; each waybill in the candidate waybill cluster is classified into S cluster center points based on the distances between the merchant locations corresponding to each waybill in the candidate waybill cluster and the S cluster center points, thereby obtaining S waybill clusters; if the S waybill clusters do not meet the fourth iteration end condition, the S cluster center points are updated to the S cluster center points newly determined based on the S waybill clusters, and the iteration is performed again based on the distances between the merchant locations corresponding to each waybill in the candidate waybill cluster and the S cluster center points. The step of classifying each waybill in the candidate waybill cluster into S cluster centers based on the distance between them to obtain S waybill clusters is repeated until the S waybill clusters meet the fourth iteration end condition; if there is a waybill cluster with more waybills than the preset number of waybills among the S waybill clusters that meet the fourth iteration end condition, the waybill cluster with more waybills than the preset number of waybills is selected as the candidate waybill cluster, and the step of determining S cluster centers based on the merchant locations corresponding to each waybill in the candidate waybill cluster is repeated until the preset waybill segmentation end condition is met, and the obtained waybill cluster is used as the waybill cluster after the recursive segmentation. By continuously recursively segmenting the candidate waybill clusters, and during the recursive processing, since the candidate waybill clusters may be in dynamic change, the S cluster centers determined based on the above-mentioned locations corresponding to multiple waybills in the candidate waybill cluster are also in dynamic change, which is conducive to balancing the accuracy and speed of waybill segmentation.
[0157] The following Figure 10 The specific implementation of each step in the embodiment shown is described in detail:
[0158] In S1001, the electronic device may determine S cluster center points based on the merchant locations corresponding to the multiple waybills in the candidate waybill cluster. For example, S merchant locations may be selected from the multiple merchant locations corresponding to the multiple waybills in the selected waybill cluster, and the S merchant locations may be used as the S cluster center points. S may be greater than or equal to 2 and less than the number of merchant locations corresponding to each waybill in the candidate waybill cluster.
[0159] In an exemplary embodiment, the implementation of the above S1001 may involve Figure 11 ,include:
[0160] S1101: Determine two merchant locations whose distance is greater than a fourth preset distance among the merchant locations corresponding to each waybill in the candidate waybill cluster.
[0161] S1102: Cut the line between two merchant locations whose distance is greater than a fourth preset distance into S line segments.
[0162] S1103: Determine S cluster center points based on the S line segments.
[0163] The following Figure 11 The specific implementation of each step in the embodiment shown is described in detail:
[0164] In S1101, the electronic device may first calculate the distance between any two merchant locations from the multiple merchant locations corresponding to each waybill in the candidate waybill cluster. Then, based on the distance between any two merchant locations from the multiple merchant locations, the electronic device may select two merchant locations from the multiple merchant locations whose distance is greater than a fourth preset distance. The fourth preset distance may be set as needed and is not specifically limited in this embodiment. For example, the two merchant locations from the multiple merchant locations whose distance is greater than the fourth preset distance may be the two merchant locations with the greatest distance from each other.
[0165] In S1102, the line between two merchant locations whose distance is greater than the fourth preset distance can be cut into S line segments. Among them, the S line segments can be S line segments of equal length or S line segments of unequal length, and this embodiment does not make any specific restrictions on this. S≥2, the specific size of S can be set according to actual needs, for example, it can be set according to the distance between the two merchant locations. The greater the distance between the two merchant locations, the larger the corresponding size of S can be, and the smaller the distance between the two merchant locations, the smaller the corresponding size of S can be. Optionally, S can also be determined based on the number of waybills in the candidate waybill cluster. For example, the greater the number of waybills in the candidate waybill cluster, the larger S is, and the smaller the number of waybills in the candidate waybill cluster, the smaller S is. However, this embodiment does not make any specific restrictions on this.
[0166] In an exemplary embodiment, S is determined based on the preset number of waybills and the number of waybills in the candidate waybills cluster. That is, when the preset number of waybills is constant, S can be adaptively changed based on the number of waybills in the candidate waybills cluster, balancing the accuracy and speed of the recursive segmentation process. Optionally, S can be calculated as follows: The integer is rounded upwards, with a minimum of 2; where Z4 is the number of waybills in the candidate waybill cluster, that is, the sum of the number of waybills in each grid in the candidate waybill cluster, and M is the preset number of waybills.
[0167] In S1103, the electronic device may determine S cluster center points based on the S line segments. For example, the center points of the S line segments may be taken to obtain S center points, which are then used as the S cluster center points. It should be noted that this embodiment uses the center points of the S line segments as an example. In a specific implementation, other points in the S line segments may also be taken as cluster center points.
[0168] In S1002, the electronic device can calculate the distance between the merchant location corresponding to each waybill in the candidate waybill cluster and the S cluster center points, and classify each waybill in the candidate waybill cluster to the cluster center point closest to it based on the calculated distance, to obtain S waybill clusters.
[0169] In S1003, the electronic device can determine whether the S waybill clusters meet the preset fourth iteration end condition. The fourth iteration end condition can be set according to actual needs. Exemplarily, the fourth iteration end condition can be that the number of iterations reaches a preset number, or it can also be: the S waybill clusters obtained this time are the same or substantially the same as the S waybill clusters obtained last time. When it is determined that the S waybill clusters meet the preset fourth iteration end condition, it can be considered that S waybill clusters are obtained, and then enter S1005. When it is determined that the S waybill clusters do not meet the fourth iteration end condition, it can be considered that the obtained S waybill clusters are not stable enough, and then enter S1004.
[0170] In S1004, the electronic device can update the S cluster center points to the S cluster center points re-determined based on the S waybill clusters. Among them, the implementation method of updating the S cluster center points to the S cluster center points re-determined based on the S waybill clusters is similar to the implementation method of updating the N cluster center points to the N cluster center points re-determined based on the N waybill clusters mentioned above. Please refer to the above description and will not be repeated here to avoid repetition. When the S cluster center points re-determined based on the S waybill clusters are obtained, re-enter S1002, that is: according to the distance between the merchant location corresponding to each waybill in the candidate waybill cluster and the re-determined S cluster center points, each waybill in the candidate waybill cluster is classified into the S cluster center points respectively, and S waybill clusters are obtained. Then proceed to S1003: determine whether the S waybill clusters obtained based on the re-determined S cluster center points meet the preset fourth iteration end condition, and iterate until the fourth iteration end condition is met, and then proceed to S1005.
[0171] In S1005 and S1006, the electronic device may determine whether there is a waybill cluster with a number of waybills greater than the preset number M of waybills among the S waybill clusters that meet the fourth iteration end condition. If there is a waybill cluster with a number of waybills greater than M, it indicates that there are waybill clusters that need to be further divided. The waybill cluster with a number of waybills greater than M is then selected as a candidate waybill cluster and the process proceeds to S1001. If the electronic device determines that there is no waybill cluster with a number of waybills greater than M among the S waybill clusters that meet the fourth iteration end condition, it indicates that there are no waybill clusters that need to be further divided, and the process proceeds to S1007.
[0172] In S1007, the electronic device determines that a preset waybill segmentation termination condition is satisfied, and uses the obtained waybill cluster as the waybill cluster after recursive segmentation. The preset waybill segmentation termination condition can be set according to actual needs. When the preset waybill segmentation termination condition is satisfied, the electronic device can output the recursively segmented waybill cluster.
[0173] In an exemplary embodiment, the preset condition for ending waybill segmentation includes: the number of waybills in each waybill cluster after the current recursive segmentation process is less than a preset number of waybills. In other words, when the number of waybills in each waybill cluster after the current recursive segmentation process is less than M, it can be determined that the preset condition for ending waybill segmentation has been met.
[0174] Optionally, the preset waybill splitting end condition may further include: the number of recursive waybill splitting times reaches a preset number. The preset number can be set according to actual needs and is not specifically limited in this embodiment.
[0175] In this embodiment, waybills are aggregated into grids for splitting, reducing the number of individual items to be analyzed and significantly improving speed. Furthermore, the multiple grid clusters obtained through clustering are recursively segmented according to the spatial distribution of the grids to obtain recursively segmented grid clusters. Furthermore, if a target grid cluster exists among the recursively segmented grid clusters, the waybills in the target grid cluster are clustered to obtain multiple waybill clusters. If a candidate waybill cluster with more than M waybills exists among the multiple waybill clusters, the candidate waybill cluster is recursively segmented according to the spatial distribution of the merchant locations to obtain recursively segmented waybill clusters. Finally, the final waybill splitting result is obtained by merging the recursively segmented waybill clusters, the recursively segmented grid clusters, and the waybill clusters and grid clusters that have not been recursively segmented. During the recursive segmentation process, dynamic and flexible setting methods are provided for the sizes of L and S, which not only improves the spatial aggregation of waybills in each waybill package after splitting, but also balances the accuracy and speed of waybill splitting through the dynamic configuration of L and S.
[0176] It should be noted that the above figures are merely illustrative of the processes included in the methods according to exemplary embodiments of the present application and are not intended to be limiting. It is readily understood that the processes illustrated in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0177] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0178] in, Figure 12 Schematic diagram of a document separation device according to an embodiment of the present application is shown. Figure 12 The order splitting device shown in the figure can be implemented as all or part of an electronic device through software, hardware or a combination of both, and can also be integrated into an electronic device as an independent module.
[0179] The above-mentioned order splitting device in the embodiment of the present application includes: a division module 1201, which is used to divide each waybill into multiple grids according to the merchant location corresponding to each waybill in the area to be split; a grid clustering module 1202, which is used to cluster the multiple grids to obtain multiple grid clusters; a determination module 1203, which is used to determine whether there is a target grid cluster among the multiple grid clusters; wherein the number of waybills in the target grid cluster is greater than the preset number of waybills; a waybill clustering module 1204, which is used to cluster the multiple waybills in the target grid cluster if there is a target grid cluster, to obtain multiple waybill clusters; a cluster merging module 1205, which is used to merge the grid clusters and the waybill clusters to obtain the order splitting results of each waybill in the area to be split.
[0180] In an exemplary embodiment, the number of grids in the target grid cluster is less than or equal to the preset number of grids and the number of waybills in the target grid cluster is greater than the preset number of waybills; the determination module 1203 includes: a first determination module, a grid recursive segmentation module and a second determination module; the first determination module is used to determine a candidate grid cluster among the multiple grid clusters based on the number of waybills of each of the grid clusters; wherein the number of waybills in the candidate grid cluster is greater than the preset number of waybills; the grid recursive segmentation module is used to recursively segment the candidate grid cluster until a preset grid segmentation end condition is met to obtain a recursively segmented grid cluster; the second determination module is used to determine whether the target grid cluster exists in the recursively segmented grid cluster.
[0181] In an exemplary embodiment, the grid recursive segmentation module is specifically configured to: determine L cluster center points based on multiple grids in the candidate grid cluster; wherein L is greater than or equal to 2; classify multiple grids in the candidate grid cluster into the L cluster center points based on the distances between the multiple grids in the candidate grid cluster and the L cluster center points, thereby obtaining L grid clusters; if the L grid clusters do not meet the first iteration end condition, update the L cluster center points to the L cluster center points re-determined based on the L grid clusters, and re-perform the method based on the distances between the multiple grids in the candidate grid cluster and the L cluster centers. The step of classifying the multiple grids in the candidate grid cluster into the L cluster center points to obtain L grid clusters is performed until the L grid clusters meet the first iteration end condition; if there is a grid cluster with more waybills than the preset number of waybills among the L grid clusters that meet the first iteration end condition, the grid cluster with more waybills than the preset number of waybills is used as the candidate grid cluster, and the step of determining the L cluster center points based on the multiple grids in the candidate grid cluster is performed again until the preset grid segmentation end condition is met, and the obtained grid cluster is used as the grid cluster after the recursive segmentation.
[0182] In an exemplary embodiment, the grid recursive segmentation module determines L cluster center points based on multiple grids in the candidate grid cluster, including: selecting two grids with a distance greater than a first preset distance from the multiple grids in the candidate grid cluster; cutting the line between the two grids with a distance greater than the first preset distance into L line segments; and determining the L cluster center points based on the L line segments.
[0183] In an exemplary embodiment, L is determined based on the preset number of waybills and the number of waybills of the candidate grid cluster.
[0184] In an exemplary embodiment, the preset grid segmentation termination condition includes: all grid clusters after the current recursive segmentation process are first-type grid clusters, or all grid clusters after the current recursive segmentation process are second-type grid clusters, or all grid clusters after the current recursive segmentation process include first-type grid clusters and second-type grid clusters;
[0185] The number of waybills in the first type of grid cluster is less than the preset number of waybills, and the number of grids in the second type of grid cluster is 1.
[0186] In an exemplary embodiment, the grid clustering module 1202 is specifically used to: determine K cluster center points based on the multiple grids, where K is greater than or equal to 2; classify the multiple grids into the K cluster center points based on the distances between the multiple grids and the K cluster center points, to obtain K grid clusters; if the K grid clusters do not meet the second iteration end condition, update the K cluster center points to K cluster center points re-determined based on the K grid clusters, and perform the step of classifying the multiple grids into the K cluster center points based on the distances between the multiple grids and the K cluster center points, to obtain K grid clusters again, until the K grid clusters meet the second iteration end condition, and use the obtained K grid clusters as the multiple grid clusters.
[0187] In an exemplary embodiment, the grid clustering module 1202 determines K cluster center points based on the multiple grids, including: determining two grids whose distance is greater than a second preset distance among the multiple grids; cutting the line between the two grids whose distance is greater than the second preset distance into K line segments; and determining K cluster center points based on the K line segments.
[0188] In an exemplary embodiment, K is determined based on the sum of the preset number of waybills and the number of waybills of the multiple grids.
[0189] In an exemplary embodiment, the waybill clustering module 1204 is specifically used to: determine N cluster center points based on the merchant locations corresponding to each waybill in the target grid cluster, where N is greater than or equal to 2; classify each waybill in the target grid cluster into the N cluster center points based on the distances between the merchant locations corresponding to each waybill in the target grid cluster and the N cluster center points, to obtain N waybill clusters; if the N waybill clusters do not meet the third iteration end condition, update the N cluster center points to the N cluster center points re-determined based on the N waybill clusters, and perform the step of classifying each waybill in the target grid cluster into the N cluster center points based on the distances between the merchant locations corresponding to each waybill in the target grid cluster and the N cluster center points, to obtain N waybill clusters again, until the N waybill clusters meet the third iteration end condition, and the obtained N waybill clusters are used as the multiple waybill clusters.
[0190] In an exemplary embodiment, the waybill clustering module 1204 determines N cluster center points based on the merchant locations corresponding to each of the waybills in the target grid cluster, including: determining two merchant locations whose distance is greater than a third preset distance among the merchant locations corresponding to each of the waybills in the target grid cluster; cutting the line between the two merchant locations whose distance is greater than the third preset distance into N line segments; and determining N cluster center points based on the N line segments.
[0191] In an exemplary embodiment, N is determined based on the preset number of waybills and the number of waybills of the target grid cluster.
[0192] In an exemplary embodiment, the waybill splitting device also includes: a third determination module and a waybill recursive segmentation module. After the waybill clustering module 1204 clusters the multiple waybills in the target grid cluster to obtain multiple waybill clusters, the third determination module is used to determine whether there is a candidate waybill cluster in the multiple waybill clusters whose number of waybills is greater than the preset number of waybills; the waybill recursive segmentation module is used to recursively segment the candidate waybill cluster if it exists, until the preset waybill segmentation end condition is met to obtain the recursively segmented waybill cluster; the cluster merging module 1205 is specifically used to cluster and merge the grid cluster, the recursively segmented waybill cluster and the multiple waybill clusters except the candidate waybill cluster to obtain the waybill splitting results of each waybill in the area to be split.
[0193] In an exemplary embodiment, the waybill recursive segmentation module is specifically used to: determine S cluster center points according to the merchant location corresponding to each waybill in the candidate waybill cluster; wherein S is greater than or equal to 2; classify each waybill in the candidate waybill cluster into the S cluster center points according to the distance between the merchant location corresponding to each waybill in the candidate waybill cluster and the S cluster center points, so as to obtain S waybill clusters; if the S waybill clusters do not meet the fourth iteration end condition, update the S cluster center points to the S cluster center points re-determined based on the S waybill clusters, and execute the segmentation according to the merchant location corresponding to each waybill in the candidate waybill cluster again. The step of classifying each waybill in the candidate waybill cluster into the S cluster center points to obtain S waybill clusters is performed until the S waybill clusters meet the fourth iteration end condition; if there is a waybill cluster with more waybills than the preset number of waybills in the S waybill clusters that meet the fourth iteration end condition, the waybill cluster with more waybills than the preset number of waybills is used as the candidate waybill cluster, and the step of determining the S cluster center points according to the merchant location corresponding to each waybill in the candidate waybill cluster is performed again until the preset waybill segmentation end condition is met, and the obtained waybill cluster is used as the waybill cluster after the recursive segmentation.
[0194] In an exemplary embodiment, the waybill recursive segmentation module determines S cluster center points based on the merchant locations corresponding to each waybill in the candidate waybill cluster, including: determining two merchant locations with a distance greater than a fourth preset distance among the merchant locations corresponding to each waybill in the candidate waybill cluster; cutting the line between the two merchant locations with a distance greater than the fourth preset distance into S line segments; and determining S cluster center points based on the S line segments.
[0195] In an exemplary embodiment, S is determined based on the preset number of waybills and the number of waybills in the candidate waybill cluster.
[0196] In an exemplary embodiment, the preset waybill segmentation termination condition includes: the number of waybills in each waybill cluster after the current recursive segmentation process is less than the preset number of waybills.
[0197] It should be noted that the order splitting device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the order splitting method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0198] In addition, the order splitting device and order splitting method embodiments provided in the above embodiments belong to the same concept. Therefore, for details not disclosed in the device embodiments of this application, please refer to the above-mentioned order splitting method embodiments of this application, and no further details will be given here.
[0199] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method of any of the above embodiments are implemented.
[0200] Figure 13 Schematically shows the structure of an electronic device according to an exemplary embodiment of the present application. Figure 13 As shown, the electronic device includes: a processor 1301 and a memory 1302 .
[0201] In an embodiment of the present application, the processor 1301 is the control center of the computer system, which can be a processor of a physical machine or a processor of a virtual machine. The processor 1301 may include one or more processing cores, such as a 4-core processor, a 9-core processor, etc. The processor 1301 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state; the coprocessor is a low-power processor for processing data in the standby state.
[0202] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments of the present application, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, which is used to be executed by the processor 1301 to implement the method in the embodiment of the present application.
[0203] In some embodiments, the electronic device 1300 further includes a peripheral device interface 1303 and at least one peripheral device. The processor 1301, memory 1302, and peripheral device interface 1303 may be connected via a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 1303 via a bus, signal lines, or circuit boards. Specifically, the peripheral device includes at least one of a display screen 1304, a camera 13013, and an audio circuit 1306.
[0204] The peripheral device interface 1303 can be used to connect at least one input / output (I / O)-related peripheral device to the processor 1301 and the memory 1302. In some embodiments of the present application, the processor 1301, the memory 1302, and the peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments of the present application, any one or two of the processor 1301, the memory 1302, and the peripheral device interface 1303 can be implemented on separate chips or circuit boards. This embodiment of the present application is not specifically limited to this.
[0205] The display screen 1304 is used to display a user interface (UI). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1304 is a touch screen display, the display screen 1304 also has the ability to collect touch signals on the surface or above the surface of the display screen 1304. The touch signal can be input as a control signal to the processor 1301 for processing. At this time, the display screen 1304 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments of the present application, the display screen 1304 can be one, set on the front panel of the electronic device 1300; in other embodiments of the present application, the display screen 1304 can be at least two, respectively set on different surfaces of the electronic device 1300 or in a folding design; in still other embodiments of the present application, the display screen 1304 can be a flexible display screen, set on the curved surface or folding surface of the electronic device 1300. Even the display screen 1304 can be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1304 can be made of materials such as a liquid crystal display (LCD) and an organic light-emitting diode (OLED).
[0206] Camera 1305 is used to capture images or videos. Optionally, camera 1305 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the electronic device, and the rear camera is arranged on the back of the electronic device. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments of the present application, camera 1305 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0207] Audio circuit 1306 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, convert the sound waves into electrical signals, and input them into processor 1301 for processing. For the purpose of stereo sound collection or noise reduction, multiple microphones may be provided, respectively, at different locations within electronic device 1300. The microphone may also be an array microphone or an omnidirectional microphone.
[0208] Power supply 1307 is used to power the various components of electronic device 1300. Power supply 1307 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1307 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0209] The electronic device structure block diagram shown in the embodiment of the present application does not constitute a limitation on the electronic device 1300. The electronic device 1300 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0210] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0211] The present application also provides a computer-readable storage medium having instructions stored therein that, when executed on a computer or processor, cause the computer or processor to perform one or more steps of the above-described embodiments. If the various components of the above-described order splitting device are implemented as software functional units and sold or used as independent products, they may be stored in the above-described computer-readable storage medium.
[0212] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The above-mentioned computer program product includes one or more computer instructions. When the above-mentioned computer program instructions are loaded and executed on a computer, the above-mentioned process or function according to the embodiment of the present application is generated in whole or in part. The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium or transmitted by the above-mentioned computer-readable storage medium. The above-mentioned computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The above-mentioned computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVDs)), or semiconductor media (for example, solid state disks (SSDs)).
[0213] It should be noted that the above description is of specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0214] The above is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, equivalent modifications made according to the claims of this application are still within the scope of protection of this application.
Claims
1. A method for splitting orders, characterized in that: The method comprises: Divide each waybill into multiple grids according to the merchant location corresponding to each waybill in the area to be divided; performing clustering processing on the plurality of grids to obtain a plurality of grid clusters; Determining whether a target grid cluster exists among the multiple grid clusters; wherein the number of waybills in the target grid cluster is greater than a preset number of waybills; If the target grid cluster exists, clustering the multiple waybills in the target grid cluster as clustering objects and the merchant locations corresponding to the multiple waybills as clustering basis, to obtain multiple waybill clusters; Determining a non-target grid cluster from the multiple grid clusters, and converting the non-target grid cluster into a waybill cluster; The converted waybill cluster is clustered and merged with the multiple waybill clusters obtained by clustering processing to obtain several merged waybill clusters, and the several merged waybill clusters are used as the waybill splitting results for each waybill in the area to be split.
2. The method according to claim 1, characterized in that The number of grids in the target grid cluster is less than or equal to the preset number of grids and the number of waybills in the target grid cluster is greater than the preset number of waybills; The determining whether a target grid cluster exists among the plurality of grid clusters includes: Determining a candidate grid cluster from the plurality of grid clusters according to the number of waybills of each grid cluster; wherein the number of waybills of the candidate grid cluster is greater than the preset number of waybills; Recursively segmenting the candidate grid clusters until a preset grid segmentation end condition is met, thereby obtaining recursively segmented grid clusters; It is determined whether the target mesh cluster exists in the recursively segmented mesh clusters.
3. The method according to claim 2, characterized in that The recursive segmentation process is performed on the candidate grid clusters until a preset grid segmentation end condition is satisfied to obtain the recursively segmented grid clusters, including: Determine L cluster center points based on multiple grids in the candidate grid cluster; where L is greater than or equal to 2; According to the distances between each of the multiple grids in the candidate grid cluster and the L cluster center points, the multiple grids in the candidate grid cluster are classified into the L cluster center points to obtain L grid clusters; If the L grid clusters do not satisfy the first iteration termination condition, updating the L cluster center points to L cluster center points re-determined based on the L grid clusters, and performing again the step of classifying the multiple grids in the candidate grid clusters into the L cluster center points according to the distances between the multiple grids in the candidate grid clusters and the L cluster center points to obtain L grid clusters, until the L grid clusters satisfy the first iteration termination condition; If there is a grid cluster in which the number of waybills is greater than the preset number of waybills among the L grid clusters that meet the first iteration end condition, the grid cluster in which the number of waybills is greater than the preset number of waybills is used as the candidate grid cluster, and the step of determining L cluster center points based on multiple grids in the candidate grid cluster is performed again until the preset grid segmentation end condition is met, and the obtained grid cluster is used as the grid cluster after the recursive segmentation.
4. The method according to claim 3, characterized in that The determining L cluster center points according to the plurality of grids in the candidate grid cluster includes: Selecting two grids whose distance is greater than a first preset distance from the plurality of grids in the candidate grid cluster; Cutting a line between two grids whose distance is greater than a first preset distance into L line segments; According to the L line segments, L cluster center points are determined.
5. The method according to claim 4, characterized in that The L is determined based on the preset number of waybills and the number of waybills of the candidate grid cluster.
6. The method according to claim 2, characterized in that The preset grid segmentation end conditions include: All grid clusters after the current recursive segmentation process are first-type grid clusters, or all grid clusters after the current recursive segmentation process are second-type grid clusters, or all grid clusters after the current recursive segmentation process include first-type grid clusters and second-type grid clusters; The number of waybills in the first type of grid cluster is less than the preset number of waybills, and the number of grids in the second type of grid cluster is 1.
7. The method according to claim 1, characterized in that The clustering of the plurality of grids to obtain a plurality of grid clusters includes: Determine K cluster center points based on the multiple grids, where K is greater than or equal to 2; Classifying the plurality of grids into the K cluster centers according to the distances between the plurality of grids and the K cluster centers, to obtain K grid clusters; In the case that the K grid clusters do not meet the second iteration end condition, the K cluster center points are updated to K cluster center points re-determined based on the K grid clusters, and the step of classifying the multiple grids into the K cluster center points according to the distances between the multiple grids and the K cluster center points to obtain K grid clusters is performed again until the K grid clusters meet the second iteration end condition, and the obtained K grid clusters are used as the multiple grid clusters.
8. The method according to claim 7, characterized in that The step of determining K cluster center points based on the multiple grids includes: Determining two grids in the plurality of grids whose distance is greater than a second preset distance; Cutting the line between two grids whose distance is greater than the second preset distance into K line segments; K cluster center points are determined based on the K line segments.
9. The method according to claim 8, characterized in that The K is determined based on the sum of the preset number of waybills and the number of waybills of the multiple grids.
10. The method according to any one of claims 1 to 9, characterized in that The clustering of the multiple waybills in the target grid cluster to obtain multiple waybill clusters includes: Determine N cluster center points according to the merchant locations corresponding to each waybill in the target grid cluster, where N is greater than or equal to 2; According to the distances between the merchant locations corresponding to the waybills in the target grid cluster and the N cluster center points, each waybill in the target grid cluster is classified into the N cluster center points to obtain N waybill clusters; If the N waybill clusters do not meet the third iteration end condition, the N cluster center points are updated to N cluster center points re-determined based on the N waybill clusters, and the step of classifying each waybill in the target grid cluster into the N cluster center points according to the distance between the merchant location corresponding to each waybill in the target grid cluster and the N cluster center points to obtain N waybill clusters is performed again, until the N waybill clusters meet the third iteration end condition, and the obtained N waybill clusters are used as the multiple waybill clusters.
11. The method according to claim 10, characterized in that The determining N cluster center points according to the merchant locations corresponding to the waybills in the target grid cluster includes: Determine, among the merchant locations corresponding to each of the waybills in the target grid cluster, two merchant locations whose distance is greater than a third preset distance; Cutting the line between the two merchant locations whose distance is greater than the third preset distance into N line segments; According to the N line segments, N cluster center points are determined.
12. The method according to claim 11, characterized in that The N is determined based on the preset number of waybills and the number of waybills of the target grid cluster.
13. The method according to any one of claims 1 to 9, characterized in that After clustering the multiple waybills in the target grid cluster to obtain multiple waybill clusters, the method further includes: Determine whether there is a candidate waybill cluster among the multiple waybill clusters, the number of waybill clusters being greater than the preset number of waybill clusters; If the candidate waybill cluster exists, recursively split the candidate waybill cluster until a preset waybill splitting end condition is met, thereby obtaining a recursively split waybill cluster; The clustering and merging the converted waybill cluster with the multiple waybill clusters obtained by clustering processing includes: The converted waybill cluster, the recursively segmented waybill cluster, and the waybill clusters other than the candidate waybill cluster among the multiple waybill clusters obtained by the clustering process are clustered and merged.
14. The method according to claim 13, wherein: The recursive segmentation process is performed on the candidate waybill cluster until a preset waybill segmentation end condition is met to obtain the recursively segmented waybill cluster, including: Determine S cluster center points based on the merchant locations corresponding to each waybill in the candidate waybill cluster; where S is greater than or equal to 2; According to the distances between the merchant locations corresponding to each waybill in the candidate waybill cluster and the S cluster center points, each waybill in the candidate waybill cluster is classified into the S cluster center points to obtain S waybill clusters; If the S waybill clusters do not meet the fourth iteration end condition, the S cluster center points are updated to S cluster center points re-determined based on the S waybill clusters, and the step of classifying each waybill in the candidate waybill cluster into the S cluster center points based on the distance between the merchant location corresponding to each waybill in the candidate waybill cluster and the S cluster center points to obtain S waybill clusters is performed again, until the S waybill clusters meet the fourth iteration end condition; If there is a waybill cluster with a number of waybills greater than the preset number of waybills among the S waybill clusters that meet the fourth iteration end condition, the waybill cluster with a number of waybills greater than the preset number of waybills will be used as the candidate waybill cluster, and the step of determining the S cluster center points based on the merchant locations corresponding to each waybill in the candidate waybill cluster will be performed again until the preset waybill segmentation end condition is met, and the obtained waybill cluster will be used as the waybill cluster after the recursive segmentation.
15. The method according to claim 14, characterized in that The determining S cluster center points according to the merchant locations corresponding to the waybills in the candidate waybill clusters includes: Determine, among the merchant locations corresponding to each of the waybills in the candidate waybill cluster, two merchant locations whose distance is greater than a fourth preset distance; Cutting the line between the two merchant locations whose distance is greater than a fourth preset distance into S line segments; According to the S line segments, S cluster center points are determined.
16. The method according to claim 15, characterized in that The S is determined based on the preset number of waybills and the number of waybills in the candidate waybill cluster.
17. The method according to claim 13, wherein The preset waybill splitting end conditions include: The number of waybills in each waybill cluster after this recursive segmentation process is less than the preset number of waybills.
18. A document separation device, characterized in that: The device comprises: A division module, configured to divide each waybill into multiple grids according to the merchant location corresponding to each waybill in the area to be divided; A grid clustering module, configured to perform clustering processing on the plurality of grids to obtain a plurality of grid clusters; a determination module, configured to determine whether a target grid cluster exists among the plurality of grid clusters; wherein the number of waybills in the target grid cluster is greater than a preset number of waybills; a waybill clustering module configured to, if the target grid cluster exists, cluster the multiple waybills in the target grid cluster using the multiple waybills in the target grid cluster as clustering objects and the merchant locations corresponding to the multiple waybills as clustering basis, thereby clustering the multiple waybills in the target grid cluster to obtain multiple waybill clusters; A cluster merging module is used to determine a non-target grid cluster from the multiple grid clusters and convert the non-target grid cluster into a waybill cluster; cluster and merge the converted waybill cluster with the multiple waybill clusters obtained by clustering processing to obtain several merged waybill clusters, and use the several merged waybill clusters as the waybill sorting results for each waybill in the area to be sorted.
19. A computer-readable storage medium storing a computer program, wherein when the computer program is executed, the method according to any one of claims 1 to 17 is implemented.
20. An electronic device, characterized in that: The electronic device comprises: a memory for storing executable program code; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 17.
21. A computer program product comprising instructions, which, when run on a computer or a processor, cause the computer or processor to perform the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
A method and apparatus for dividing a logistics region
CN109003028A
Service area dividing method and device
CN112053105A
Position data verification method and device and computing equipment
CN112258126A
Waybill scheduling method and device, computer storage medium and electronic equipment
CN112836987A
Task type-based vehicle and goods matching method, system and equipment and storage medium
CN114971458A