A shared site selection method based on hybrid clustering algorithm
Through hybrid clustering algorithm and fitting curve function optimization, the problems of low transportation efficiency and high cost in shared site selection are solved, and more accurate site positioning and improved computing efficiency are achieved.
Patent Information
- Application Number
- CN202210638433.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-06-07
AI Technical Summary
In the process of express delivery into villages, it is difficult to accurately locate shared stations, resulting in low transportation efficiency and high costs.
A hybrid clustering algorithm is used to cluster the express delivery address data in combination with DBSCAN and K-means algorithms to obtain candidate shared site addresses, and the site locations are optimized by fitting curve functions.
It improves the accuracy and computational efficiency of shared site selection, reduces the amount of calculation, and ensures the stability and reliability of the results.
Smart Images

Figure CN115099737B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of shared site site selection, and in particular to a shared site site selection method based on a hybrid clustering algorithm. Background Art
[0002] In the process of bringing express delivery to villages, the location of shared stations is a key challenge. The volume of express parcels in rural areas is small and dispersed, and vehicles are difficult to access, resulting in low transportation efficiency and high costs. Currently, express delivery partnerships are an effective way to bring express delivery to rural areas. In these partnerships, buses only travel on highways and do not enter villages. Therefore, shared stations are typically built along highways, with the partnering bus company setting up bus stops near these locations. Therefore, the location of shared stations has become a key research issue in express delivery partnerships. Summary of the Invention
[0003] The following is a brief summary of one or more aspects to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceivable aspects and is neither intended to identify key or critical elements of all aspects nor to define the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that will be provided later.
[0004] The purpose of the present invention is to solve the above problems. It provides a shared site location selection method based on a hybrid clustering algorithm. The stored express delivery address dataset is obtained as a sample point dataset. The DBSCAN algorithm and the K-means algorithm are combined as a hybrid clustering algorithm to cluster the sample point dataset to obtain multiple shared site candidate addresses. Then, a fitting curve function is used to optimize each shared site candidate address to determine the optimal shared site address.
[0005] The technical solution of the present invention is:
[0006] The present invention provides a shared site selection method based on a hybrid clustering algorithm, comprising the following steps:
[0007] Get the express delivery address dataset;
[0008] Obtain a sample point dataset based on the express delivery address dataset;
[0009] A hybrid clustering algorithm is used to cluster the sample point dataset to obtain multiple candidate shared site addresses;
[0010] Optimize the candidate addresses of each shared site and determine the best shared site address.
[0011] According to an embodiment of the shared site selection method based on the hybrid clustering algorithm of the present invention, the express delivery address data set is serialized storage data, and the serialized express delivery address data is deserialized to obtain a sample point data set.
[0012] According to an embodiment of the shared site selection method based on the hybrid clustering algorithm of the present invention, the sample points are two-dimensional vectors composed of the longitude and latitude of the courier delivery address.
[0013] According to an embodiment of the shared site location selection method based on a hybrid clustering algorithm of the present invention, the hybrid clustering algorithm uses the DBSCAN algorithm to cluster the sample point data set to obtain cluster sets, and then uses the K-means algorithm to iteratively calculate the cluster center of each cluster as the candidate address of the shared site.
[0014] According to an embodiment of the shared site selection method based on the hybrid clustering algorithm of the present invention, the hybrid clustering algorithm uses the DBSCAN algorithm to cluster the sample point data set, including the following steps:
[0015] Obtain a sample point data set, and mark all sample points in the sample point data set as unvisited;
[0016] Randomly select an unvisited sample point from the sample point dataset and mark it as visited;
[0017] Determine whether the domain of the selected sample point data has at least MinPts objects; if so, create a new cluster and add the selected sample point to the new cluster; if not, mark the selected sample point as noise, and determine whether all sample points in the sample point data set are marked as visited; where MinPts is the minimum number of sample points contained in the domain;
[0018] Obtain a domain sample point set according to the domain range of the selected sample points;
[0019] Randomly select a domain sample point from the domain sample point set;
[0020] Determine whether the selected domain sample point is in an unvisited state; if so, mark the selected domain sample point as a visited state; if not, randomly select a domain sample point;
[0021] Determine whether the domain of the selected domain sample point has at least MinPts objects; if so, add the objects in the domain of the domain sample point to the new cluster; if not, determine whether the selected domain sample point belongs to other task clusters;
[0022] Determine whether the selected domain sample point belongs to other task clusters; if so, mark all domain sample points in the domain sample point set as visited; if not, add the selected domain sample point to the new cluster;
[0023] Determine whether all sample points in the sample point data set are marked as visited; if so, end the algorithm and obtain the cluster; if not, randomly select an unvisited sample point from the sample point data set for clustering.
[0024] According to an embodiment of the shared site selection method based on the hybrid clustering algorithm of the present invention, the hybrid clustering algorithm adopts the K-means algorithm to iteratively calculate the cluster center of each cluster, including the following steps:
[0025] Get the clusters obtained by the DBSCAN algorithm;
[0026] Randomly select a cluster from the set of clusters;
[0027] Calculate the cluster center of the selected cluster;
[0028] Determine whether all clusters in the cluster set have completed cluster center calculation; if so, end the algorithm and output the cluster centers of all clusters; if not, randomly select a cluster from the cluster set for calculation again.
[0029] According to an embodiment of the shared site selection method based on the hybrid clustering algorithm of the present invention, the K-means algorithm calculates the cluster center P0 of each cluster through the following steps:
[0030] Define the cluster center P0 as (lng0, lat0); where lng0 is the longitude vector of the cluster center and lat0 is the dimension vector of the cluster center;
[0031] Calculate the sample points P in the cluster i (lng i ,lat i ) to the cluster center P0, the calculation formula is as follows:
[0032]
[0033] Where i represents the i-th sample point, and n represents the number of sample points;
[0034] Calculate the sample points P in the cluster i The sum of the Euclidean distances to the cluster center P0 is distance(lng0,lat0), which is calculated as follows:
[0035]
[0036] The sample point with the smallest mean distance to other points in the cluster is calculated based on the sum of Euclidean distances, and the value of the cluster center P0(lng0,lat0) is determined.
[0037] According to an embodiment of the shared site site selection method based on the hybrid clustering algorithm of the present invention, after obtaining multiple cluster centers as candidate shared site addresses, the shared site site selection method based on the hybrid clustering algorithm optimizes each candidate shared site address using a fitting curve function, including the following steps:
[0038] Based on the data of each cluster, a nearby road is intercepted and multiple longitude and latitude points are extracted on the road;
[0039] Fit the longitude and latitude points to obtain the fitting curve function;
[0040] Based on the cluster center of each cluster and the fitting curve function, the optimization objective function is determined;
[0041] Determine the optimal shared site address based on the optimization objective function.
[0042] According to an embodiment of the shared site selection method based on the hybrid clustering algorithm of the present invention, the optimization objective function is the distance from the cluster center of each cluster to each longitude and latitude point on the fitting curve function, and the calculation formula is as follows:
[0043] Mindis i (lng0,lat0)=(x i -lng0) 2 +(f(x) i -lat0) 2
[0044] ; where x i is the longitude of latitude and longitude point i,
[0045] f(x) i Indicates longitude as x i The latitude corresponding to the longitude and latitude point,
[0046] Mindis i (lng0, lat0) represents the square of the shortest distance from the cluster center (lng0, lat0) of the i-th cluster to the highway.
[0047] According to an embodiment of the shared site location selection method based on the hybrid clustering algorithm of the present invention, the optimization objective function obtains the best shared site address by calculating the minimum value of the optimization objective function value.
[0048] Compared with the prior art, the present invention has the following beneficial effects: the present invention adopts a hybrid clustering algorithm that combines the DBSCAN algorithm and the K-means algorithm, which solves the problem of a large number of iterations and the easy generation of partial errors caused by the simple use of the K-means algorithm, and can more accurately locate the center point of the express address cluster. In addition, the present invention also uses a fitting curve function to optimize the candidate addresses of shared sites, and determines the optimal shared site address by solving the shortest distance from the cluster center to the highway. On the one hand, it avoids calculating the distance from all sample points to the highway, greatly reducing the amount of calculation; on the other hand, by fitting the curve of the highway, the calculation of the shortest distance from the cluster center to the highway is converted into a problem of solving the extreme value of the optimization function, making the results of the candidate addresses of the shared site stable and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The above features and advantages of the present invention will be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or characteristics may have the same or similar reference numerals.
[0050] Figure 1 FIG. 1 is a flow chart illustrating an embodiment of a shared site selection method using a hybrid clustering algorithm according to the present invention.
[0051] Figure 2 FIG. 1 is a flow chart illustrating an embodiment of clustering using the DBSCAN algorithm according to the present invention.
[0052] Figure 3 FIG. 1 is a flow chart illustrating an embodiment of the present invention of using the K-means algorithm to obtain cluster centers. DETAILED DESCRIPTION
[0053] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. Note that the various aspects described below with reference to the accompanying drawings and specific embodiments are merely exemplary and should not be construed as limiting the scope of protection of the present invention.
[0054] An embodiment of a shared site selection method based on a hybrid clustering algorithm is disclosed herein. Figure 1 This is a flow chart showing an embodiment of a shared site selection method based on a hybrid clustering algorithm of the present invention. Figure 1 ,The following is a detailed description of each step of the shared site ,selection method based on the hybrid clustering algorithm.
[0055] Step S1: Obtain a data set of courier delivery addresses.
[0056] Step S2: Obtain a sample point dataset based on the express delivery address dataset.
[0057] In this embodiment, the express delivery address dataset is the express delivery address data sent from a certain administrative town to an administrative village within a year. These express delivery addresses have accurate longitude and latitude, and these express delivery address datasets are serialized and stored to facilitate analysis in subsequent work.
[0058] In one implementation, Python's pickle module is used to serialize the information related to the delivery address data and save it to external memory for permanent storage to ensure data integrity. When clustering is required, the stored delivery address dataset can be deserialized to obtain the corresponding sample point dataset.
[0059] In addition, in this embodiment, the sample point is a two-dimensional vector composed of the longitude and latitude of the express delivery address. The set of all sample points obtained by deserializing the express delivery address dataset is defined as the sample point dataset D = {P1, P2...P i}, each sample point is defined in turn as:
[0060] P1(lng1,lat1),P2(lng2,lat2)…P i (lng i ,lat i ).
[0061] Among them, P i Represents the i-th sample point in the sample point data set D, lng i Indicates the longitude of the express delivery address corresponding to the i-th sample point, lat i Indicates the latitude of the express delivery address corresponding to the i-th sample point.
[0062] Step S3: cluster the sample point dataset using a hybrid clustering algorithm to obtain multiple candidate shared site addresses.
[0063] The clustering algorithm is composed of several patterns. Usually, a pattern is a vector of measurement, or a point in a multidimensional space. The clustering algorithm is based on similarity. The patterns in a cluster have more similarities than the patterns in different clusters. Since the DBSCAN clustering algorithm can only cluster and cannot find the cluster center of the cluster, and the K-means clustering algorithm can find the centroid, the number of iterations is large and it is easy to produce partial errors. Therefore, in this embodiment, the candidate points are solved by combining DBSCAN and K-means. The sample point data set is first clustered using the DBSCAN algorithm, and then the K-means algorithm is used to iteratively calculate the cluster center of each cluster as the candidate address of the shared site, so that the center point of the rural express cluster can be located more accurately.
[0064] Specifically, in this embodiment, the hybrid clustering algorithm utilizes the density-reachable property of the DBSCAN algorithm to cluster the geographic location dataset of the sample points into several clusters according to the distribution radius. Figure 2 This is a flow chart showing an embodiment of clustering using the DBSCAN algorithm of the present invention. Figure 2 ,The following is a detailed description of the steps of clustering using the DBSCAN algorithm.
[0065] Step C1: Obtain a sample point dataset and mark all sample points in the sample point dataset as unvisited.
[0066] Specifically, input the sample point data set D, and all the sample points P1, P2…P i Marked as "unvisited", indicating unvisited status.
[0067] Step C2: Randomly select an unvisited sample point from the sample point dataset and mark it as visited.
[0068] Randomly select a sample point p marked as "unvisited" or "visited" from the sample point data set D.
[0069] Step C3: Determine whether the domain of the selected sample point has at least MinPts objects; if so, create a new cluster and add the selected sample point to the new cluster; if not, mark the selected sample point as noise, and determine whether all sample points in the sample point dataset are marked as visited.
[0070] In this embodiment, if there are at least MinPts objects in the ε-domain of the sample point p, a new cluster H is created and the selected sample point p is added to the new cluster H. Otherwise, the selected sample point is marked as noise, and it is determined whether all sample points in the sample point data set are marked as visited to determine whether to terminate the algorithm.
[0071] Step C4: Obtain a domain sample point set according to the domain range of the selected sample point.
[0072] Step C5: Randomly select a domain sample point from the domain sample point set.
[0073] In this embodiment, the set of sample points in the ε-domain of the sample point p is defined as the domain sample point set C, and a domain sample point p' is randomly selected from the domain sample point set C for clustering.
[0074] Step C6: Determine whether the selected domain sample point is in an unvisited state; if so, mark the selected domain sample point as a visited state; if not, randomly select a domain sample point.
[0075] For each domain sample point p' in the domain sample point set C, if the domain sample point p' is marked as "unvisited", change the mark of the domain sample point p' to "visited". If the domain sample point p' is marked as "visited", it is necessary to randomly select a domain sample point from the domain sample point set C.
[0076] Step C7: Determine whether the E domain of the selected domain sample point has at least MinPts objects; if so, add the domain object of the domain sample point to the new cluster; if not, determine whether the selected domain sample point belongs to other task clusters.
[0077] Step C8: Determine whether the selected domain sample point belongs to other task clusters; if so, mark all domain sample points in the domain sample point set as visited; if not, add the selected domain sample point to the new cluster.
[0078] In this embodiment, after a domain sample point p' is marked as "visited," if its ε-domain has at least MinPts objects, these objects are added to the new cluster H. Otherwise, it is necessary to determine whether the domain sample point p' belongs to another cluster. If so, all domain sample points in the domain sample point set C are marked as visited. If not, the selected domain sample point p' is added to the new cluster H.
[0079] Step C9: Determine whether all sample points in the sample point data set are marked as visited; if so, end the algorithm and obtain a cluster; if not, randomly select an unvisited sample point from the sample point data set for clustering.
[0080] Repeat the above steps C2-C8 until all sample points in the sample point dataset D are marked as "visited", and finally obtain several classified clusters: H1, H2...H n .
[0081] In this embodiment, after the DBSCAN algorithm is used to cluster the sample point data set to obtain the cluster set, the data set of each cluster is used as a new input, and the iterative aggregation of the K-means algorithm is used to calculate the cluster center position of each cluster, which is used as the candidate point of the shared site. Figure 3 This is a flow chart showing an embodiment of the present invention of using the K-means algorithm to obtain cluster centers. Figure 3,The following is a detailed description of the steps of obtaining cluster centers using the K-means algorithm.
[0082] Step D1: Obtain the clusters obtained according to the DBSCAN algorithm.
[0083] Step D2: Randomly select a cluster from the cluster set.
[0084] In this embodiment, the clusters obtained by using the DBSCAN algorithm are subjected to K-means clustering with a K value of 1, and the cluster center of each cluster is obtained as a candidate shared site point.
[0085] Step D3: Calculate the cluster centers of the selected clusters.
[0086] In this embodiment, the K-means algorithm calculates the cluster center P0 of each cluster through the following steps:
[0087] Step D31: Define the cluster center P0 as (lng0, lat0); where lng0 is the longitude vector of the cluster center, and lat0 is the dimensional vector of the cluster center.
[0088] In this embodiment, from each cluster H1, H2...H n The point with the smallest mean distance to other points in the cluster is calculated as the cluster center P0(lng0,lat0). Among them, lng0 is the longitude vector of the cluster center, and lat0 is the dimension vector of the cluster center.
[0089] Step D32: Calculate the sample points P in the cluster i (lng i ,lat i ) to the cluster center P0, the calculation formula is as follows:
[0090]
[0091] Where i represents the i-th sample point, and n represents the number of sample points;
[0092] Step D33: Calculate the sample points P in the cluster i The sum of the Euclidean distances to the cluster center P0 is distance(lng0,lat0), which is calculated as follows:
[0093]
[0094] In this embodiment, the cluster center (lng0, lat0) of each cluster is obtained by performing partial derivative and extreme value operations on distance (lng0, lat0) as a candidate shared site point.
[0095] Step D4: Determine whether all clusters in the cluster set have completed cluster center calculation; if so, end the algorithm and output the cluster centers of all clusters; if not, randomly select a cluster from the cluster set for calculation again.
[0096] Specifically, when each cluster H1, H2…H n After all cluster centers are calculated, the cluster centers of each cluster are output as candidate shared site points.
[0097] Step S4: Optimize the candidate addresses of each shared site and determine the best shared site address.
[0098] In this embodiment, after a hybrid clustering algorithm is used to obtain multiple cluster centers as candidate shared site addresses, each candidate shared site address is optimized by fitting a curve function, including the following steps:
[0099] Step S41: intercept a section of a nearby road based on the data of each cluster, and extract a plurality of longitude and latitude points on the road.
[0100] Specifically, in this embodiment, a section of the road is intercepted for each cluster of data, and then m longitude and latitude points are selected on the road, and their longitude and latitude are obtained to obtain a set of longitude and latitude point data:
[0101] r1(lng1,lat1),r2(lng2,lat2)…r m (lng m ,lat m ).
[0102] Among them, r i represents a latitude and longitude point selected on the road, r i (lng i ,lat i ) represents the latitude and longitude point r i The longitude and latitude of , i = 1, 2,…, m-1.
[0103] Step S42: Fitting the longitude and latitude points to obtain a fitting curve function.
[0104] In this embodiment, after selecting the longitude and latitude point data, these data are fitted n times to obtain the fitting curve function of the highway: f(x)=a0+a1x+a2x 2 +…+a n x n Among them, a0, a2,…, a n Represents the parameters of the polynomial to be determined, x represents the longitude of a point on the road, and f(x) represents the latitude of this point on the road.
[0105] When solving the fitting curve function f(x), we can get a0, a1, ..., a by solving the minimum value of the following formula n , and then solve the fitting curve function f(x), the formula is as follows:
[0106]
[0107] Among them, Q(a0,a1,…,a n ) represents the variables a0, a1, ..., a n n-variable function, by solving Q(a0,a1,…,a n ) to obtain the minimum value of a0,a1,…,a n The specific value of is then applied to the above fitting curve function f(x) for solution.
[0108] Step S43: Determine the optimization objective function based on the cluster center of each cluster and the fitting curve function.
[0109] In this embodiment, the distance from the cluster center of each cluster to each longitude and latitude point on the fitting curve function is used as the optimization objective function, and the optimal site address is obtained by using the function extreme value method. The optimization objective function is:
[0110] Mindis i (lng0,lat0)=(x i -lng0) 2 +(f(x) i -lat0) 2
[0111] Among them, x i is the longitude of latitude and longitude point i, f(x) i Indicates longitude as x i The latitude and longitude points corresponding to Mindis i (lng0, lat0) represents the square of the shortest distance from the cluster center (lng0, lat0) of the i-th cluster to the highway. i By solving the minimum value of (lng0, lat0), we can obtain the latitude and longitude point on the highway closest to the cluster center. Due to the cooperation between the transportation and express companies, buses only travel on the highway and do not enter the village. Therefore, this latitude and longitude point can be used as the terminal service station and built as a shared station along the highway. The cooperating bus company will set up a bus stop near this station.
[0112] In addition, in this implementation, the contents related to clustering algorithms, optimization functions and related solution formulas are all implemented through Pycharm.
[0113] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0114] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. A skilled person may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.
[0115] The various illustrative logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein may be implemented or performed using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
[0116] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read and write information from / to the storage medium. In an alternative, the storage medium may be integrated into the processor. The processor and storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and storage medium may reside in a user terminal as discrete components.
[0117] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or code. Computer-readable media include both computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. A storage medium may be any available medium accessed by a computer. By way of example and not limitation, such computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that is accessed by a computer. Any connection is also properly referred to as a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks typically reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0118] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A shared site selection method based on a hybrid clustering algorithm, characterized in that: The following steps are involved: Get the express delivery address dataset; Obtain a sample point dataset based on the express delivery address dataset; A hybrid clustering algorithm is used to cluster the sample point dataset to obtain multiple candidate shared site addresses; Optimize candidate addresses of each shared site and determine the best shared site address; The hybrid clustering algorithm uses the DBSCAN algorithm to cluster the sample point data set to obtain clusters, and then uses the K-means algorithm to iteratively calculate the cluster center of each cluster. , as a candidate address for a shared site; The shared site selection method based on the hybrid clustering algorithm obtains multiple cluster centers. After being selected as candidate shared site addresses, the fitting curve function is used to optimize each candidate shared site address, including the following steps: Based on the data of each cluster, a nearby road is intercepted and multiple longitude and latitude points are extracted on the road; Fit the longitude and latitude points to obtain the fitting curve function; Based on the cluster center of each cluster and fitting curve function to determine the optimization objective function; Determine the best shared site address according to the optimization objective function, wherein the optimization objective function obtains the best shared site address by calculating the minimum value of the optimization objective function value; The optimization objective function is the cluster center of each cluster The distance to each longitude and latitude point on the fitting curve function is calculated as follows: in, is the longitude of latitude and longitude point i, Indicates longitude as The latitude corresponding to the longitude and latitude point, Represents the cluster center of the i-th cluster The square of the shortest distance to the road, is the cluster center The longitude vector of is the cluster center dimensional vector.
2. The shared site selection method based on the hybrid clustering algorithm according to claim 1, characterized in that: The express delivery address data set is serialized storage data, and the serialized express delivery address data is deserialized to obtain a sample point data set.
3. The shared site selection method based on hybrid clustering algorithm according to claim 2, characterized in that: The sample point is a two-dimensional vector consisting of the longitude and latitude of the courier delivery address.
4. The shared site selection method based on hybrid clustering algorithm according to claim 1, characterized in that: The hybrid clustering algorithm uses the DBSCAN algorithm to cluster the sample point data set, including the following steps: Obtain a sample point data set, and mark all sample points in the sample point data set as unvisited; Randomly select an unvisited sample point from the sample point dataset and mark it as visited; Determine whether the domain of the selected sample point data has at least MinPts objects; if so, create a new cluster and add the selected sample point to the new cluster; if not, mark the selected sample point as noise, and determine whether all sample points in the sample point data set are marked as visited; where MinPts is the minimum number of sample points contained in the domain; Obtain a domain sample point set according to the domain range of the selected sample points; Randomly select a domain sample point from the domain sample point set; Determine whether the selected domain sample point is in an unvisited state; if so, mark the selected domain sample point as a visited state; if not, randomly select a domain sample point; Determine whether the domain of the selected domain sample point has at least MinPts objects; if so, add the objects in the domain of the domain sample point to the new cluster; if not, determine whether the selected domain sample point belongs to other task clusters; Determine whether the selected domain sample point belongs to other task clusters; if so, mark all domain sample points in the domain sample point set as visited; if not, add the selected domain sample point to the new cluster; Determine whether all sample points in the sample point data set are marked as visited; if so, end the algorithm and obtain the cluster; if not, randomly select an unvisited sample point from the sample point data set for clustering.
5. The shared site selection method based on hybrid clustering algorithm according to claim 1, characterized in that: The hybrid clustering algorithm uses the K-means algorithm to iteratively calculate the cluster center of each cluster The following steps are involved: Get the clusters obtained by the DBSCAN algorithm; Randomly select a cluster from the set of clusters; Calculate the cluster center of the selected cluster ; Determine whether all clusters in the cluster set have completed the cluster center Calculate; if so, end the algorithm and output the cluster centers of all clusters ; If not, a cluster is randomly selected from the cluster set for recalculation.
6. The shared site selection method based on hybrid clustering algorithm according to claim 5, characterized in that: The K-means algorithm calculates the cluster center of each cluster through the following steps: : Calculate each sample point in the cluster To cluster center The Euclidean distance is calculated as follows: Among them, i represents the i-th sample point, n represents the number of sample points, Represents the i-th sample point The longitude of the corresponding courier delivery address, Represents the i-th sample point The latitude of the corresponding courier delivery address; Calculate each sample point in the cluster To cluster center The sum of the Euclidean distances , the calculation formula is as follows: Calculate the sample point with the smallest mean distance from other points in the cluster based on the sum of Euclidean distances to determine the cluster center value.
Citation Information
Patent Citations
Logistics service website layout method and system based on address longitude and latitude clustering
CN111563630A