Location data partitioning method, device, computer equipment and storage medium
By clustering and business division processing of location data, the problem of difficulty in dividing large-scale location data is solved, and higher accuracy and processing effects are achieved.
Patent Information
- Application Number
- CN201911256413.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-10
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2039-12-10
AI Technical Summary
With the rapid increase in the scale of position data, it is difficult for the prior art to accurately divide position data, resulting in poor division processing effects.
By clustering the position data to be divided, the data scale is reduced, and then the candidate point data is divided according to the preset business constraints to obtain the business unit corresponding to the position data.
It effectively reduces the data scale of location data, improves the accuracy and processing effect of location data division, and meets business constraints for division processing.
Smart Images

Figure CN112948512B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for dividing location data. Background Art
[0002] With the widespread application of Internet technology, various online business systems such as online shopping platforms and social media platforms have greatly facilitated people's work and life. However, the amount of data processed and generated by various business systems is increasing, and it is becoming increasingly difficult to analyze data to improve the quality of business services. For example, in the field of logistics, in order to carry out regional centralized management, it is necessary to divide and select locations from the huge amount of location data involved in logistics in order to provide better physical services. However, with the rapid increase in the scale of location data, such as reaching a data volume of hundreds of thousands or millions, the difficulty of dividing and processing location data increases, and the accuracy of location data division is limited, resulting in poor results in the division and processing of location data. Summary of the invention
[0003] Based on this, it is necessary to provide a location data division method, device, computer equipment and storage medium that can achieve location data division processing effects in response to the above technical problems.
[0004] A method for dividing position data, the method comprising:
[0005] Obtaining location data to be divided;
[0006] Perform clustering processing on the location data, and obtain candidate point data according to the clustering processing results;
[0007] The candidate point data is processed for business division according to the preset business constraints to obtain the business units corresponding to the location data.
[0008] In one embodiment, clustering is performed on the location data, and candidate point data obtained according to the clustering result includes:
[0009] Determining the number of clustering results for location data;
[0010] Perform clustering processing on the location data to obtain clustering processing results whose number is the same as the number of clustering results;
[0011] The candidate point data is obtained according to the clustering processing results.
[0012] In one embodiment, clustering is performed on the location data to obtain clustering results having the same number as the number of clustering results, including:
[0013] The location data is clustered into cluster data clusters with the same number as the clustering results through the K-means clustering algorithm;
[0014] Determine the cluster center of each cluster data cluster and the business data volume corresponding to each position data included in each cluster data cluster;
[0015] Determine the sum of the product of the business data volume and the distance between the cluster center corresponding to each position data and each position data;
[0016] When the product sum meets the preset clustering end condition, the clustering processing result is obtained according to each clustering data cluster.
[0017] In one embodiment, obtaining candidate point data according to the clustering processing result includes:
[0018] The business data volume corresponding to each location data is superimposed on the cluster center corresponding to each location data, and the superimposed and updated cluster center is used as the candidate point data.
[0019] In one embodiment, it also includes:
[0020] When the product sum does not meet the clustering end condition, the number of clusters is increased by one to obtain the updated number of clusters;
[0021] When the number of clustering times reaches a preset clustering times threshold, a clustering processing result is obtained according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum.
[0022] In one embodiment, the candidate point data is processed for business division according to the preset business constraint conditions, and the business units corresponding to the location data obtained include:
[0023] Get preset business constraints;
[0024] Based on the integer programming algorithm, the candidate point data is processed by integer programming according to the business constraints to obtain the integer programming result;
[0025] When the number of integer programming results is greater than 1, determining the target programming result from the integer programming results according to a preset programming screening condition; the programming screening condition includes at least one of an undivided business data volume condition and a business data volume and distance product sum condition;
[0026] The candidate point data is divided and processed according to the target planning results to obtain the business units corresponding to the location data.
[0027] In one of the embodiments, the service constraint condition includes at least one of a unit service data volume constraint, a unit size constraint, and a unit number constraint of the service unit.
[0028] In one embodiment, it also includes:
[0029] Performing verification analysis on the candidate point data included in the business unit to obtain verification analysis results;
[0030] When the verification analysis result is that the verification fails, the candidate point data that fails the verification is divided and updated to obtain an updated business unit.
[0031] A location data partitioning device, the device comprising:
[0032] A location data acquisition module, used to acquire location data to be divided;
[0033] A data clustering processing module is used to perform clustering processing on the location data and obtain candidate point data according to the clustering processing results;
[0034] The business constraint division module is used to perform business division processing on the candidate point data according to the preset business constraint conditions to obtain the business units corresponding to the location data.
[0035] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Obtaining location data to be divided;
[0037] Perform clustering processing on the location data, and obtain candidate point data according to the clustering processing results;
[0038] The candidate point data is processed for business division according to the preset business constraints to obtain the business units corresponding to the location data.
[0039] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0040] Obtaining location data to be divided;
[0041] Perform clustering processing on the location data, and obtain candidate point data according to the clustering processing results;
[0042] The candidate point data is processed for business division according to the preset business constraints to obtain the business units corresponding to the location data.
[0043] The above-mentioned location data division method, device, computer equipment and storage medium first cluster the location data to be divided, reduce the data scale of the location data according to the location data to be divided, and then perform business division processing on the candidate point data according to the preset business constraints to obtain the business units corresponding to the location data. By reducing the data scale of the location data and then performing business division in combination with the business constraints, it is possible to avoid excessive difficulty in division due to excessive data scale, and the division processing is performed when the business constraints are met, which can ensure the accuracy of the location data division and improve the division processing effect of the location data. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A diagram of an application environment of a location data partitioning method in one embodiment;
[0045] Figure 2 A schematic diagram of a flow chart of a location data partitioning method in one embodiment;
[0046] Figure 3 A schematic diagram of a process of clustering location data in one embodiment;
[0047] Figure 4 A schematic diagram showing a business unit in an embodiment;
[0048] Figure 5 is a flow chart of a location data partitioning method in another embodiment;
[0049] Figure 6 is a structural block diagram of a location data partitioning device in one embodiment;
[0050] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] The location data partitioning method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 sends the position data to be divided to the server 104, and the server 104 first performs clustering processing on the position data to be divided, and then performs business division processing on the candidate point data according to the preset business constraints based on the position data to be divided, to obtain the business unit corresponding to the position data, and feeds back the division result to the terminal 102. In addition, the terminal 102 can also directly perform position data division processing on the position data to be divided to obtain the division result; the server 104 can also directly obtain the position data to be divided from the database and perform subsequent position data division processing, and send the obtained division processing result to the terminal 102. Among them, the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0053] In one embodiment, Figure 2 As shown, a location data partitioning method is provided, which is applied to Figure 1 The terminal or server in the example is used to illustrate, including the following steps:
[0054] Step S202, obtaining the location data to be divided.
[0055] The location data is the data that needs to be divided and processed, and specifically can be coordinate data. In the field of logistics, the location data can be considered as the location of the business user, that is, the business user can be represented by the location data, and the processing of the business user can be achieved by processing the location data.
[0056] Step S204: clustering the position data, and obtaining candidate point data according to the clustering processing result.
[0057] After obtaining the location data to be divided, clustering processing is performed. Specifically, multiple clustering can be performed through a clustering algorithm, such as the k-means clustering algorithm, the Mean-Shift clustering algorithm, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm or the agglomerative hierarchical clustering algorithm, and the candidate point data is obtained according to the clustering processing results. Among them, the k-means clustering algorithm uses distance as the evaluation index of similarity, that is, the closer the distance between two objects, the greater their similarity. The algorithm believes that a cluster is composed of objects that are close in distance, so obtaining compact and independent clusters is the ultimate goal; the Mean-Shift clustering algorithm is an algorithm based on sliding windows to find dense areas of data points. It is a centroid-based algorithm that updates the candidate points of the center point to the mean of the points in the sliding window to locate the center point of each group / class, and then removes similar windows from these candidate windows to finally form a center point set and corresponding grouping; the DBSCAN algorithm defines a cluster as the largest set of density-connected points, which can divide areas with sufficiently high density into clusters, and can find clusters of any shape in a noisy spatial database; the basic idea of the agglomerative hierarchical clustering algorithm is to calculate the similarity between nodes through a certain similarity measure, and sort them from high to low by similarity, and gradually reconnect the nodes to form a tree diagram hierarchy to obtain the clustering result.
[0058] The candidate point data is clustered according to the location data to determine the cluster center. By clustering each location data to the corresponding candidate point data, the data volume of the location data can be effectively reduced. For example, when the data volume of the location data postcode is 100,000, the task volume of location data division processing is large and difficult, and it is difficult to perform effective division processing. By clustering the 100,000 postcodes, such as successfully clustering them into 1,000 candidate point data, the data volume of the location data is effectively reduced based on the division processing of the 1,000 candidate point data.
[0059] Step S206, performing business division processing on the candidate point data according to the preset business constraint conditions to obtain business units corresponding to the division of the position data.
[0060] After obtaining the candidate point data, the candidate point data is processed for business division according to the preset business constraints. The business constraints are determined according to the needs of the actual application scenario. The business unit is the unit area to which each candidate point data belongs after division. Business services can be provided according to the unit area, such as setting up service outlets. For example, in the field of logistics, corresponding business constraints can be set according to the business needs of logistics when selecting a site, such as constraints on the size of logistics items. The business division of candidate point data is processed based on business constraints. Specifically, the business division of candidate point data can be processed based on integer programming algorithms, so that each candidate point data is reasonably divided according to the predetermined business constraints, and the business unit corresponding to the location data is obtained, which ensures the accuracy of location data division and improves the location data division processing effect.
[0061] In the above-mentioned location data division method, the location data to be divided is first clustered, and the data scale of the location data is reduced according to the location data to be divided. Then, the candidate point data is divided into business units according to the preset business constraints to obtain the business units corresponding to the location data. By reducing the data scale of the location data and then combining the business constraints for business division, it is possible to avoid excessive difficulty in division due to excessive data scale, and the division processing that meets the business constraints can ensure the accuracy of the location data division and improve the division processing effect of the location data.
[0062] In one embodiment, clustering is performed on the location data, and obtaining candidate point data based on the clustering processing results includes: determining the number of clustering results of the location data; clustering is performed on the location data to obtain clustering processing results whose number is the same as the number of clustering results; and obtaining candidate point data based on the clustering processing results.
[0063] In this embodiment, the location data is clustered to obtain a certain number of clustering results, and candidate point data is obtained from the clustering results. Specifically, when the location data is clustered, the number of clustering results of the location data is determined. The number of clustering results is the number of clustering results that need to be clustered, which reflects the clustering compression amplitude of the location data clustering, that is, the degree of reduction of the size of the location data. In specific implementation, the number of clustering results is set according to the data volume of the actual location data, such as a specific value can be pre-set, or a predetermined proportional value. After determining the number of clustering results of the location data, the location data is clustered according to the number of clustering results to obtain the same number of clustering results as the number of clustering results, that is, the number of clustering results obtained is the number of clustering results. Finally, the candidate point data is obtained according to the clustering results. Specifically, the candidate point data corresponding to each clustering result can be determined from each clustering result. For example, the cluster center corresponding to all the location data in each clustering result can be used as the candidate point data, and the location data corresponding to the clustering result is represented by the candidate point data corresponding to each clustering result. For example, the business volume of each location data corresponding to the clustering result can be superimposed on the candidate point data to achieve mapping between the candidate point data and each location data, thereby achieving effective compression of the data volume of the location data.
[0064] In one embodiment, Figure 3 As shown, the location data clustering process, that is, performing clustering process on the location data, obtains clustering process results having the same number as the number of clustering results, including:
[0065] Step S302: clustering the location data into clustered data clusters having the same number as the number of clustering results by using a K-means clustering algorithm.
[0066] In this embodiment, the location data is clustered by a K-means clustering algorithm, i.e., a k-means clustering algorithm, to obtain the same number of clustered data clusters as the number of clustering results, and a clustering processing result is obtained based on the clustered data clusters. Specifically, the location data is clustered into the same number of clustered data clusters as the number of clustering results by the K-means clustering algorithm. The K-means clustering algorithm is an iterative clustering analysis algorithm, and its steps are to randomly select K objects as initial cluster centers, and then calculate the distance between each object and each seed cluster center, and assign each object to the cluster center closest to it. The cluster centers and the objects assigned to them represent a cluster. Each time a sample is assigned, the cluster center of the cluster will be recalculated based on the existing objects in the cluster. This process will be repeated until a certain termination condition is met. Specifically, the K value of the K-means clustering algorithm is set to a certain number of clustering results, and the location data is obtained by the K-means clustering algorithm. K cluster data clusters.
[0067] Step S304: determine the cluster center of each clustered data cluster and the business data volume corresponding to each position data included in each clustered data cluster.
[0068] The cluster center of each cluster data cluster is determined. The cluster center is the cluster center corresponding to the location data clustering by the K-means clustering algorithm. The amount of business data corresponding to each location data included in each cluster data cluster is the amount of business data corresponding to the user of each location data, such as the amount of logistics pieces in the logistics field. The amount of business data can be historical data recorded in the business system.
[0069] Step S306, determining the sum of the product of the business data volume and the distance between the cluster center corresponding to each location data and each location data.
[0070] Calculate the amount of business data corresponding to each location data included in each cluster data cluster, and the product of the distance between the cluster center corresponding to each location data and each location data, and count the sum of the products of each location data. The sum of products integrates the distance between each cluster center and the corresponding location data, and uses the amount of business data of each location data as a weight, which can effectively reflect the clustering effect of clustering processing. If the sum of products is smaller, it means that in the corresponding cluster data cluster, the distance between the obtained cluster center and each location data with a large amount of business data is closer, indicating that the clustering effect of the cluster data cluster is better, and the sum of products can be used as a clustering indicator to determine the end of clustering.
[0071] Step S308: when the product sum meets the preset clustering end condition, a clustering processing result is obtained according to each clustering data cluster.
[0072] When the product sum meets the preset clustering end condition, such as the product sum is less than a certain index threshold, or the product sum is the minimum product sum among all clustering times, it is considered that the preset clustering end condition is met, the clustering process is terminated, and the product sum corresponding to the clustering that meets the preset clustering end condition is used as the required clustering data cluster, and the clustering process result is obtained according to each clustering data cluster. Among them, the index threshold can be set according to the empirical value. If the product sum is less than a certain index threshold, it is considered that the preset clustering end condition is met, and the clustering result that meets the clustering effect requirements can be obtained without traversing all clustering processes, that is, the distance between the obtained cluster center and the location data with large business data volume is small enough. On the other hand, since the product sum is obtained by summing the product of the business data volume and the distance between the cluster center and each location data corresponding to each location data, when the product sum is the minimum product sum among all clustering times and it is considered that the preset clustering end condition is met, the clustering process result corresponding to the closest distance between the cluster center and the location data with large business data volume can be found from all clustering processes, that is, the clustering process result with the best clustering effect is found. By taking the product that meets the clustering end condition and the corresponding clustering to obtain each clustering data cluster as the required clustering data cluster, the candidate point data can be determined based on the clustering processing result with the best clustering effect, and accurate candidate point data can be obtained. Then, business division processing is performed based on the candidate point data, which can effectively improve the division processing effect of the location data.
[0073] In addition, if the product sum does not meet the preset clustering end condition, the next clustering is performed until the clustering ends.
[0074] In one embodiment, obtaining candidate point data according to the clustering processing result includes: superimposing the business data volume corresponding to each position data to the cluster center corresponding to each position data, and using the superimposed and updated cluster center as the candidate point data.
[0075] In this embodiment, the business data volume of the user corresponding to each location data is superimposed on the cluster center corresponding to each location data to obtain candidate point data. The business data volume is the amount of historical data related to the business, such as the historical quantity of pieces in the logistics field. The larger the business data volume, the more business services the location data corresponds to. The business data volume corresponding to each location data is superimposed on the cluster center corresponding to each location data, so that the superimposed and updated cluster center includes all the business data volumes of the cluster data cluster to which it belongs. The superimposed and updated cluster center is used as the candidate point data, and the candidate point data is used as the object after clustering processing of the cluster data cluster to which it belongs.
[0076] In one embodiment, it also includes: when the product sum does not meet the clustering end condition, the clustering number is increased by one to obtain an updated clustering number; when the clustering number reaches a preset clustering number threshold, the clustering processing result is obtained according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum.
[0077] When the product sum does not meet the clustering end condition, it indicates that the current clustering process is not finished and the next clustering process is required. Then the clustering times are increased by one to obtain the updated clustering times, which is the number of clustering processes. When the clustering times reaches the preset clustering times threshold, it indicates that the maximum clustering times is reached, and the clustering is terminated. The clustering processing results are obtained according to the clustering data clusters corresponding to the product sums with the smallest values in the product sums, that is, the clustering data clusters obtained according to the minimum score and the corresponding clustering process are used as the clustering processing results. Among them, the clustering times threshold can be set according to actual needs.
[0078] In one embodiment, the business division processing of the candidate point data is performed according to the preset business constraint conditions to obtain the business units corresponding to the division of the location data, including: obtaining the preset business constraint conditions; performing integer programming processing on the candidate point data according to the business constraint conditions based on an integer programming algorithm to obtain integer programming results; when the number of integer programming results is greater than 1, determining the target planning results from the integer programming results according to the preset planning screening conditions; the planning screening conditions include at least one of the conditions of the amount of undivided business data and the product and sum of the business data amount and the distance; dividing the candidate point data according to the target planning results to obtain the business units corresponding to the division of the location data.
[0079] In this embodiment, integer programming is performed on the obtained candidate point data according to predetermined business constraints based on an integer programming algorithm, and a target planning result is determined and divided according to the integer programming result to obtain business units corresponding to the location data.
[0080] Specifically, when the candidate point data is processed for business division, the preset business constraint conditions are obtained. The business constraint conditions are pre-set according to the business requirements of the actual application scenario. Specifically, the server 104 can read the corresponding preset business constraint conditions from the memory. For example, in the field of logistics, the business constraint conditions may include unit business data volume constraints, unit size constraints, or unit number constraints. Each candidate point data is the cluster center of the cluster data cluster, which is a separate data point. It is superimposed with the business data volume of all position data in the corresponding cluster data cluster. The business constraint condition is generally an integer indicator condition, such as unit business data volume constraints. Based on the integer programming algorithm, the candidate point data is processed for integer programming according to the business constraint conditions, and the integer programming result that satisfies the corresponding business constraint conditions can be quickly obtained. Among them, some or all of the variables in the integer programming are integers, and the integer programming algorithm includes branch and bound method, cutting plane method, implicit enumeration method, etc., which can be selected according to actual needs. After obtaining the integer programming result, the number of integer programming results is determined. When the number of integer programming results is greater than 1, it indicates that further selection operations are required, and the target planning result is determined from the integer programming results according to the preset planning screening conditions. Among them, the planning screening conditions include at least one of the conditions of the amount of undivided business data and the sum of the product of the business data amount and the distance; the condition of the amount of undivided business data can be an integer planning result of selecting the smallest amount of undivided business data, and the condition of the sum of the product of the business data amount and the distance can be an integer planning result of selecting the smallest sum of products, and the sum of products is obtained by summing the business data amount and the product of the distance between the cluster center corresponding to each location data and each location data. The target planning result is the selected required integer planning result, and the candidate point data is divided and processed according to the target planning result to obtain the business unit corresponding to the location data. The business unit is the unit area to which each candidate point data belongs after division. In addition, if it is detected that there is undivided candidate point data, it will be divided into the nearest business unit. Specifically, the nearest business unit to the candidate point data can be determined according to the distance between the candidate point data and the center of each business unit. After the location data is divided to determine the corresponding business unit, each business unit and the location data in the business unit can also be visualized, such as Figure 4 FIG. 1 is a schematic diagram showing location data after being divided in one embodiment.
[0081] In one embodiment, the service constraint condition includes at least one of a unit service data volume constraint, a unit size constraint, and a unit number constraint of the service unit.
[0082] Among them, the unit business data volume of the business unit is the sum of the business data volumes of all the location data included in the unit area to which each candidate point data belongs after the data is divided, and the unit business data volume constraint can be a smaller value for the unit business data volume; the unit size is the area size of the business unit, and the unit size constraint can be that the area radius of the business unit does not exceed a certain radius threshold; the number of units is the number of business units after division, and the unit number constraint can be that the number of units takes a smaller value. By performing business constraint division by at least one of the unit business data volume constraint, the unit size constraint, and the unit number constraint of the business unit, the accuracy of location data division can be ensured, and the division processing effect of location data can be improved.
[0083] In one embodiment, it also includes: performing verification analysis on each candidate point data included in the business unit to obtain a verification analysis result; when the verification analysis result is verification failure, dividing and updating the candidate point data that failed the verification to obtain an updated business unit.
[0084] In this embodiment, each candidate data in the divided business unit can also be verified and analyzed to reasonably correct the division result, so as to further improve the division processing effect of the position data. Specifically, after obtaining the business unit corresponding to the division of the position data, the candidate point data included in the business unit is verified and analyzed to obtain the verification analysis result. For example, the distance between each candidate point data and the business unit to which it belongs and the adjacent business unit can be compared to determine whether the division of each candidate point data is reasonable. When the verification analysis result is that the verification fails, the candidate point data that fails the verification is divided and updated, such as being divided into the business unit with the closest distance to obtain an updated business unit.
[0085] In one embodiment, Figure 5 As shown, a location data partitioning method is provided, comprising:
[0086] Step S502, obtaining the location data to be divided;
[0087] Step S504, determining the number of clustering results of the location data;
[0088] Step S506, clustering the location data into clustered data clusters having the same number as the number of clustering results by using a K-means clustering algorithm;
[0089] Step S508, determining the cluster center of each clustered data cluster and the business data volume corresponding to each position data included in each clustered data cluster;
[0090] Step S510, determining the sum of the products of the business data volume and the distances between the cluster center corresponding to each location data and each location data; judging whether the sum of the products meets the preset clustering end condition, if yes, executing step S514, if not, executing step S512;
[0091] Step S512, adding one to the number of clustering times to obtain an updated number of clustering times; determining whether the number of clustering times reaches the clustering times threshold, if yes, executing step S516, if no, executing step S506;
[0092] Step S514, obtaining a clustering processing result according to each clustering data cluster;
[0093] Step S516, obtaining a clustering processing result according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum;
[0094] Step S518: superimpose the business data volume corresponding to each position data to the cluster center corresponding to each position data, and use the superimposed and updated cluster center as candidate point data.
[0095] In this embodiment, a cyclic clustering process is performed on the position data by using a K-means clustering algorithm, and candidate point data is obtained according to the cluster center of each cluster data cluster in the clustering process result.
[0096] Step S520, obtaining preset business constraints;
[0097] Step S522, performing integer programming processing on the candidate point data based on the integer programming algorithm according to the business constraints to obtain an integer programming result;
[0098] Step S524, when the number of integer programming results is greater than 1, determining the target programming result from the integer programming results according to a preset planning screening condition;
[0099] Step S526, dividing the candidate point data according to the target planning result to obtain the business units corresponding to the location data.
[0100] In this embodiment, integer programming is performed on the obtained candidate point data according to predetermined business constraints based on an integer programming algorithm, and a target planning result is determined and divided according to the integer programming result to obtain business units corresponding to the location data.
[0101] Step S528, performing verification analysis on each candidate point data included in the business unit to obtain a verification analysis result;
[0102] Step S530: When the verification analysis result is that the verification fails, the candidate point data that fails the verification is divided and updated to obtain an updated business unit.
[0103] In this embodiment, each candidate data in the divided business unit is verified and analyzed to reasonably correct the division result, thereby further improving the division processing effect of the location data.
[0104] It should be understood that although Figure 2-3 The steps in the flowchart of , 5 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-3 At least part of the steps in 5 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0105] In one embodiment, Figure 6 As shown, a location data partitioning device is provided, including a location data acquisition module 602, a data clustering processing module 604 and a business constraint partitioning module 606, wherein:
[0106] The location data acquisition module 602 is used to acquire the location data to be divided;
[0107] The data clustering processing module 604 is used to perform clustering processing on the location data and obtain candidate point data according to the clustering processing results;
[0108] The business constraint division module 606 is used to perform business division processing on the candidate point data according to the preset business constraint conditions to obtain business units corresponding to the division of the position data.
[0109] In one embodiment, the data clustering processing module 604 includes a result number determination module, a position data clustering module and a candidate point determination module; wherein: the result number determination module is used to determine the number of clustering results of the position data; the position data clustering module is used to perform clustering processing on the position data to obtain clustering processing results whose number is the same as the number of clustering results; the candidate point determination module is used to obtain candidate point data based on the clustering processing results.
[0110] In one embodiment, the location data clustering module includes a K-means clustering module, a cluster parameter determination module, an index calculation module and a clustering result acquisition module; wherein: the K-means clustering module is used to cluster the location data into cluster data clusters of the same number as the number of clustering results through the K-means clustering algorithm; the cluster parameter determination module is used to determine the cluster center of each cluster data cluster and the amount of business data corresponding to each location data included in each cluster data cluster; the index calculation module is used to determine the sum of the products of the business data amount and the distance between the cluster center corresponding to each location data and each location data; the clustering result acquisition module is used to obtain the clustering processing results according to each cluster data cluster when the sum of the products meets the preset clustering end condition.
[0111] In one embodiment, the candidate point determination module includes a cluster center processing module for superimposing the business data volume corresponding to each position data to the cluster center corresponding to each position data, and using the superimposed and updated cluster center as the candidate point data.
[0112] In one embodiment, it also includes a clustering number update module and a clustering number comparison module; wherein: the clustering number update module is used to increase the clustering number by one to obtain an updated clustering number when the product sum does not meet the clustering end condition; the clustering number comparison module is used to obtain the clustering processing result according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum when the clustering number reaches a preset clustering number threshold.
[0113] In one embodiment, the business constraint partitioning module 606 includes a constraint condition acquisition module, an integer programming processing module, a target programming determination module and a business unit determination module; wherein: the constraint condition acquisition module is used to obtain preset business constraint conditions; the integer programming processing module is used to perform integer programming processing on the candidate point data according to the business constraint conditions based on the integer programming algorithm to obtain integer programming results; the target programming determination module is used to determine the target programming results from the integer programming results according to the preset planning screening conditions when the number of integer programming results is greater than 1; the planning screening conditions include at least one of the conditions of the amount of undivided business data and the product and sum of the business data amount and the distance; the business unit determination module is used to partition the candidate point data according to the target planning results to obtain the business units corresponding to the location data.
[0114] In one embodiment, the service constraint condition includes at least one of a unit service data volume constraint, a unit size constraint, and a unit number constraint of the service unit.
[0115] In one embodiment, it also includes a verification processing module and a business unit update module; wherein: the verification processing module is used to perform verification analysis on each candidate point data included in the business unit to obtain a verification analysis result; the business unit update module is used to divide and update the candidate point data that failed the verification when the verification analysis result is verification failure, to obtain an updated business unit.
[0116] For the specific definition of the position data partitioning device, please refer to the definition of the position data partitioning method above, which will not be repeated here. Each module in the above-mentioned position data partitioning device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0117] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for dividing location data is implemented.
[0118] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0119] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0120] Obtaining location data to be divided;
[0121] Perform clustering processing on the location data, and obtain candidate point data according to the clustering processing results;
[0122] The candidate point data is processed for business division according to the preset business constraints to obtain the business units corresponding to the location data.
[0123] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the number of clustering results of the position data; performing clustering processing on the position data to obtain clustering processing results whose number is the same as the number of clustering results; and obtaining candidate point data based on the clustering processing results.
[0124] In one embodiment, when the processor executes the computer program, the following steps are also implemented: clustering the location data into the same number of clustering data clusters as the number of clustering results through the K-means clustering algorithm; determining the cluster center of each clustering data cluster and the amount of business data corresponding to each location data included in each clustering data cluster; determining the sum of the products of the business data amount and the distances between the cluster center corresponding to each location data and each location data; when the sum of the products meets the preset clustering end condition, obtaining the clustering processing results according to each clustering data cluster.
[0125] In one embodiment, when the processor executes the computer program, the following steps are also implemented: superimposing the business data volume corresponding to each position data to the cluster center corresponding to each position data, and using the superimposed and updated cluster center as candidate point data.
[0126] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the product sum does not meet the clustering end condition, the clustering number is increased by one to obtain an updated clustering number; when the clustering number reaches a preset clustering number threshold, the clustering processing result is obtained according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum.
[0127] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining preset business constraints; performing integer programming processing on the candidate point data according to the business constraints based on an integer programming algorithm to obtain integer programming results; when the number of integer programming results is greater than 1, determining the target planning results from the integer programming results according to preset planning screening conditions; the planning screening conditions include at least one of the conditions of the amount of undivided business data and the product and sum of the business data amount and the distance; dividing the candidate point data according to the target planning results to obtain the business units corresponding to the division of the location data.
[0128] In one embodiment, when the processor executes the computer program, the following steps are also implemented: performing verification analysis on each candidate point data included in the business unit to obtain a verification analysis result; when the verification analysis result is that the verification fails, dividing and updating the candidate point data that failed the verification to obtain an updated business unit.
[0129] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0130] Obtaining location data to be divided;
[0131] Perform clustering processing on the location data, and obtain candidate point data according to the clustering processing results;
[0132] The candidate point data is processed for business division according to the preset business constraints to obtain the business units corresponding to the location data.
[0133] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the number of clustering results of the position data; performing clustering processing on the position data to obtain clustering processing results whose number is the same as the number of clustering results; and obtaining candidate point data based on the clustering processing results.
[0134] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: clustering the location data into the same number of clustering data clusters as the number of clustering results through the K-means clustering algorithm; determining the cluster center of each clustering data cluster and the amount of business data corresponding to each location data included in each clustering data cluster; determining the sum of the products of the business data amount and the distances between the cluster center corresponding to each location data and each location data; when the sum of the products meets the preset clustering end condition, obtaining the clustering processing results according to each clustering data cluster.
[0135] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: superimposing the business data volume corresponding to each position data to the cluster center corresponding to each position data, and using the superimposed and updated cluster center as candidate point data.
[0136] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the product sum does not meet the clustering end condition, the clustering number is increased by one to obtain an updated clustering number; when the clustering number reaches a preset clustering number threshold, the clustering processing result is obtained according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum.
[0137] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining preset business constraints; performing integer programming processing on the candidate point data according to the business constraints based on the integer programming algorithm to obtain integer programming results; when the number of integer programming results is greater than 1, determining the target planning results from the integer programming results according to preset planning screening conditions; the planning screening conditions include at least one of the conditions of the amount of undivided business data and the product and sum of the business data amount and the distance; dividing the candidate point data according to the target planning results to obtain the business units corresponding to the division of the location data.
[0138] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: verification analysis is performed on each candidate point data included in the business unit to obtain a verification analysis result; when the verification analysis result is that the verification fails, the candidate point data that failed the verification is divided and updated to obtain an updated business unit.
[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0140] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0141] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for dividing location data, the method comprising: Obtaining location data to be divided; The location data is the location of the service user; Clustering the location data into cluster data clusters having the same number as the number of clustering results by using a K-means clustering algorithm; Determining the cluster center of each of the clustered data clusters and the amount of business data corresponding to each position data included in each of the clustered data clusters; Determine the sum of the products of the business data volume and the distances between the cluster centers corresponding to the respective location data and the respective location data; When the sum of the products is less than a preset indicator threshold, a clustering processing result is obtained according to each of the clustering data clusters; Superimpose the business data volume corresponding to each position data to the cluster center corresponding to each position data, and use the superimposed and updated cluster center as the candidate point data; Obtaining preset business constraints; the business constraints include at least one of a business unit business data volume constraint, a unit size constraint, and a unit number constraint; wherein the business unit business data volume is the sum of the business data volumes of all position data included in the corresponding unit area after the candidate point data is divided; the unit size constraint includes that the area radius of the business unit does not exceed the radius threshold; the number of units is the number of business units after division; Performing integer programming processing on the candidate point data according to the business constraints based on an integer programming algorithm to obtain an integer programming result; When the number of the integer programming results is greater than 1, determining the target programming result from the integer programming results according to a preset programming screening condition; the programming screening condition includes at least one of an undivided business data volume condition and a business data volume and distance product sum condition; Divide the candidate point data according to the target planning result to obtain the business units corresponding to the location data; Divide the undivided candidate point data into the closest business units; The business units obtained by division and the location data included in the business units are visualized.
2. The method according to claim 1, characterized in that The method further comprises: The number of clustering results of the location data is determined.
3. The method according to claim 1, characterized in that Also includes: When the product sum does not meet the clustering end condition, the clustering number is increased by one to obtain an updated clustering number; When the number of clustering times reaches a preset clustering times threshold, a clustering processing result is obtained according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum.
4. The method according to any one of claims 1 to 3, characterized in that: The integer programming algorithm includes a branch and bound method, a cutting plane method or an implicit enumeration method.
5. The method according to claim 1, characterized in that Also includes: Performing verification analysis on each candidate point data included in the business unit to obtain a verification analysis result; When the verification analysis result is that the verification fails, the candidate point data that fails the verification is divided and updated to obtain an updated business unit.
6. A location data partitioning device, characterized in that: The device comprises: A location data acquisition module, used to acquire location data to be divided; the location data is the location of the service user; A data clustering processing module, used to cluster the location data into cluster data clusters of the same number as the number of clustering results by using a K-means clustering algorithm; determine the cluster center of each cluster data cluster and the amount of business data corresponding to each location data included in each cluster data cluster; determine the sum of the products of the business data amount and the distance between the cluster center corresponding to each location data and each location data; when the sum of the products is less than a preset indicator threshold, obtain a clustering processing result according to each cluster data cluster; superimpose the amount of business data corresponding to each location data to the cluster center corresponding to each location data, and use the superimposed and updated cluster center as candidate point data; A business constraint partitioning module is used to obtain preset business constraint conditions; the business constraint conditions include at least one of a unit business data volume constraint, a unit size constraint and a unit number constraint of a business unit; wherein the unit business data volume of a business unit is the sum of the business data volumes of all position data included in the corresponding unit area after the candidate point data is partitioned; the unit size constraint includes that the area radius of the business unit does not exceed the radius threshold; the number of units is the number of business units after the partition; integer programming is performed on the candidate point data according to the business constraint conditions based on an integer programming algorithm to obtain an integer programming result; when the number of the integer programming results is greater than 1, a target programming result is determined from the integer programming results according to a preset planning screening condition; the planning screening condition includes at least one of an unpartitioned business data volume condition and a business data volume and distance product sum condition; the candidate point data is partitioned according to the target planning result to obtain the business unit corresponding to the partition of the position data; the unpartitioned candidate point data is partitioned into the business unit with the closest distance; the business unit obtained by the partition and the position data included in the business unit are visualized.
7. The device according to claim 6, characterized in that The data clustering processing module is also used to determine the number of clustering results of the location data.
8. The device according to claim 6, characterized in that The device also includes: A clustering times updating module, used for, when the product sum does not satisfy the clustering end condition, increasing the clustering times by one to obtain an updated clustering times; The clustering times comparison module is used to obtain the clustering processing result according to each clustering data cluster corresponding to the product sum with the smallest value in each product sum when the clustering times reaches a preset clustering times threshold.
9. The device according to claim 6, characterized in that The device also includes: A verification processing module, used to perform verification analysis on each candidate point data included in the business unit to obtain a verification analysis result; The business unit updating module is used to divide and update the candidate point data that failed the verification when the verification analysis result is verification failure, so as to obtain an updated business unit.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
A method and apparatus for dividing a logistics region
CN109003028A