Geographical area clustering method, device, storage medium and electronic device
By introducing associated region combinations and non-associated region combinations as constraints in geographical region clustering, the problem that it is difficult to ensure global optimality in the prior art is solved, and the clustering effect is improved.
Patent Information
- Application Number
- CN202011224525.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-05
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2040-11-05
AI Technical Summary
The existing clustering algorithms for geographical area clustering are difficult to ensure global optimization, resulting in unsatisfactory clustering effects.
By determining the location and attribute information of the area to be clustered, the associated area combination and the non-associated area combination are determined and clustered as constraints to ensure local and global optimization.
The effect of geographical area clustering is improved, ensuring the local and global optimality of clustering results.
Smart Images

Figure CN112328880B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a geographical area clustering method, device, storage medium and electronic equipment. Background Art
[0002] With the vigorous development of clustering algorithms, they have made contributions in many fields such as data mining, statistics, and machine learning. In many fields such as shared vehicles, food delivery, and express delivery, it is necessary to cluster geographical areas to divide them into multiple operating areas for scheduling, task distribution, and other processing. Existing clustering algorithms for clustering geographical areas have the disadvantage of being difficult to ensure global optimality. Summary of the invention
[0003] In view of this, embodiments of the present invention provide a geographic area clustering method, device, storage medium and electronic device, aiming to simultaneously ensure local and global optimization to improve clustering effect.
[0004] In a first aspect, an embodiment of the present invention provides a geographical area clustering method, the method comprising:
[0005] Determine location information and attribute information corresponding to multiple areas to be clustered;
[0006] Determine a plurality of associated region combinations and a plurality of non-associated region combinations according to the location information and attribute information corresponding to each of the regions to be clustered, wherein the associated region combination includes two regions to be clustered that must be in the same cluster after clustering, and the non-associated region combination includes two regions to be clustered that must not be in the same cluster after clustering;
[0007] Each of the associated region combinations and non-associated region combinations is used as a constraint condition to cluster each of the regions to be clustered to determine a target clustering result, wherein the target clustering result includes a plurality of clusters, and each of the clusters includes a plurality of regions.
[0008] In a second aspect, an embodiment of the present invention provides a geographic area clustering device, the device comprising:
[0009] An information determination module, used to determine location information and attribute information corresponding to a plurality of areas to be clustered;
[0010] A region combination determination module, used to determine a plurality of associated region combinations and a plurality of non-associated region combinations according to the location information and attribute information corresponding to each of the regions to be clustered, wherein the associated region combination includes two regions to be clustered that must be in the same cluster after clustering, and the non-associated region combination includes two regions to be clustered that must not be in the same cluster after clustering;
[0011] The clustering module is used to cluster the regions to be clustered using the associated region combinations and the unassociated region combinations as constraints to determine a target clustering result, wherein the target clustering result includes a plurality of clusters, and each cluster includes a plurality of regions.
[0012] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium for storing computer program instructions, wherein the computer program instructions implement the method described in the first aspect when executed by a processor.
[0013] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method described in the first aspect.
[0014] The embodiment of the present invention determines the location information and attribute information corresponding to multiple areas to be clustered, so as to determine multiple associated area combinations and non-associated area combinations including two areas to be clustered according to the location information and attribute information corresponding to each area to be clustered. The associated area combination and the non-associated area combination are used as constraints to cluster the areas to be clustered to determine a target clustering result including multiple area sets. The embodiment of the present invention introduces associated area combinations and non-associated area combinations in the process of clustering geographic areas, and clusters the associated area combinations and non-associated area combinations as constraints, while ensuring local and global optimization to improve the clustering effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0016] Figure 1 A flowchart of a geographic area clustering method according to an embodiment of the present invention;
[0017] Figure 2 A schematic diagram of location information determined in an optional implementation manner of an embodiment of the present invention;
[0018] Figure 3 A schematic diagram of location information determined in another optional implementation manner of an embodiment of the present invention;
[0019] Figure 4 A schematic diagram of determining attribute information in an optional implementation manner of an embodiment of the present invention;
[0020] Figure 5 A schematic diagram of determining attribute information in another optional implementation manner of an embodiment of the present invention;
[0021] Figure 6A flowchart of a process for determining a combination of associated regions and a combination of unassociated regions according to an embodiment of the present invention;
[0022] Figure 7 A flowchart of determining a target clustering result in an iterative manner according to an embodiment of the present invention;
[0023] Figure 8 A schematic diagram of a geographic area clustering device according to an embodiment of the present invention;
[0024] Fig. 9 Schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention is described below based on embodiments, but the present invention is not limited to these embodiments. In the detailed description of the present invention below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present invention without the description of these details. In order to avoid confusing the essence of the present invention, known methods, processes, flows, components and circuits are not described in detail.
[0026] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0027] Unless the context clearly requires otherwise, words such as “include”, “including” and the like in the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as meaning “including but not limited to”.
[0028] In the description of the present invention, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0029] The geographic area clustering method described in the embodiment of the present invention can be applied to any device such as a terminal device or a server that can deploy a clustering framework for applying the geographic area clustering method of the embodiment of the present invention. The terminal device can be a general data processing terminal that can run computer programs and has an acceleration sensor, such as a smart phone or a tablet computer. The server can be a single server or a server cluster configured in a distributed manner. The geographic area clustering method is implemented by deploying a server corresponding to the clustering framework as an example for explanation. The server determines multiple areas to be clustered by receiving multiple geographic areas sent by the terminal device or directly obtaining multiple geographic areas stored in the database. The clustering framework deployed on the server side runs the geographic area clustering method of the embodiment of the present invention for clustering, and obtains a target clustering result including multiple clusters, wherein each cluster includes multiple geographic areas.
[0030] Furthermore, the geographic area clustering method of the embodiment of the present invention can be applied to any application scenario that requires clustering of multiple smaller geographic areas, such as shared vehicle scenarios, food delivery scenarios, and intra-city express delivery. The application of the geographic area clustering method to the shared vehicle scenario is used as an example for explanation. The geographic area can be a plurality of parking spots pre-determined by the shared vehicle platform. The plurality of parking spots are clustered by the geographic area clustering method to obtain a plurality of vehicle dispatching areas including at least one parking spot, so as to facilitate vehicle dispatching and management.
[0031] Figure 1 FIG. 1 is a flow chart of a geographical area clustering method according to an embodiment of the present invention. Figure 1 As shown, the geographical area clustering method of the embodiment of the present invention includes the following steps:
[0032] Step S100: Determine location information and attribute information corresponding to a plurality of areas to be clustered.
[0033] Specifically, multiple geographic areas are determined as areas to be clustered. When the geographic area clustering method of an embodiment of the present invention is implemented by a server, multiple geographic areas can be transmitted to the server as areas to be clustered through a terminal device connected to the server. Alternatively, the server can also directly obtain multiple pre-stored geographic areas as areas to be clustered from a local database or a connected database. For example, when an embodiment of the present invention is applied to the field of shared vehicles, each of the areas to be clustered can be a shared vehicle parking area pre-set by a shared vehicle platform server and stored in a local database or an external database.
[0034] Among them, each of the areas to be clustered has corresponding location information and attribute information. The location information can be determined according to any point in the corresponding area to be clustered, and is used to characterize the location of the area to be clustered. Further, the location information can be represented by a two-dimensional vector composed of longitude and latitude information, or by a three-dimensional vector corresponding to the position of the area to be clustered in the earth coordinate system. The attribute information may include at least one attribute of the corresponding area to be clustered, and each attribute can be selected according to the application scenario of the geographical area clustering method. Take the application of the embodiment of the present invention in the field of shared vehicles as an example for explanation. The area to be clustered is a shared vehicle parking area, and the attribute information may include attributes such as parking area type, peak parking time, peak vehicle use time, parking volume in each time period, and vehicle use volume in each time period. The parking area type can be determined by the type of facilities around the corresponding area to be clustered, and the peak parking time, peak vehicle use time, parking volume in each time period, and vehicle use volume in each time period can be determined according to the historical operation of the corresponding area to be clustered.
[0035] In the embodiment of the present invention, the process of determining the location information and attribute information corresponding to each to-be-clustered area may include the following steps:
[0036] Step S110: Acquire the longitude and latitude data corresponding to each of the to-be-clustered areas as location information.
[0037] Specifically, the area to be clustered may be an area with a regular shape or an irregular shape. In the embodiment of the present invention, any point in each area to be clustered may be pre-set as a feature point, and the longitude and latitude data of the feature point may be used as the longitude and latitude data of the area to be clustered. In other words, the longitude and latitude information of the feature point in the area to be clustered is directly determined as the location information. For example, when the area to be clustered is an irregular area, any point on the edge of the irregular area or a location point of a building included in the area may be determined as the corresponding feature point.
[0038] Figure 2 FIG. 1 is a schematic diagram of location information determined in an optional implementation manner of an embodiment of the present invention. Figure 2 As shown, the region to be clustered 20 may be a rectangular region. When the upper left corner vertex 21 of the region to be clustered 20 is preset as a feature point, the longitude and latitude information of the upper left corner vertex 21 of the region to be clustered 20 is obtained, and the longitude and latitude information is stored as the position information of the region to be clustered 20. Furthermore, the feature point may also be the center point of the region to be clustered 20, or a point in other regions to be clustered 30, such as the location point of a landmark building included therein, or on the edge of the region to be clustered 30.
[0039] Figure 3 FIG. 1 is a schematic diagram of location information determined in another optional implementation of an embodiment of the present invention. Figure 3 As shown, the area to be clustered 30 may be a circular area. When the center point 31 of the area to be clustered 30 is preset as a feature point, the longitude and latitude information of the center point 31 of the area to be clustered 30 is obtained, and the longitude and latitude information is stored as the location information of the area to be clustered 30. Furthermore, the feature point may also be a point in other areas to be clustered 30, such as the location point of a landmark building included in the area to be clustered 30, or a point on the edge of the area to be clustered 30.
[0040] Step S120: determining corresponding attribute information according to facilities in a preset area around each of the areas to be clustered.
[0041] Specifically, the attribute information corresponding to each of the areas to be clustered includes at least the type of the area to be clustered, and the type of the area to be clustered can be determined based on the facilities in the surrounding preset area and a pre-set determination rule. In an embodiment of the present invention, the determination rule may be to determine the type of facility closest to the location of the area to be clustered as the type of the area to be clustered, or to first determine the types of facilities within a range of a preset threshold distance from the area to be clustered, and determine the type of facility with the largest number as the type of the area to be clustered. Among them, the facility may be a building facility including an independent building or multiple buildings, or a facility including natural resources such as a lakeside or a forest, and the type may be a community, a shopping mall, a building, an amusement park, etc.
[0042] The application of the embodiment of the present invention in the field of shared vehicles is used as an example for explanation. The area to be clustered is a parking area for shared vehicles, and the type of the parking area can be determined according to the type of facilities closest to the parking area or the type of facilities within a preset range of the parking area. For example, when the facility closest to the parking area is a building, the type of the parking area is determined to be a building parking area. Alternatively, when the predetermined range of the parking area includes one building and two residential areas, the type of the parking area is determined to be a residential area parking area.
[0043] Figure 4 FIG. 1 is a schematic diagram of determining attribute information in an optional implementation manner of an embodiment of the present invention. Figure 4 As shown, the facilities around the areas to be clustered 1, 2, 3, 4, 5, 6 and 7 include Building A, Shopping Mall B, Community C and Park D. Take the example that the attribute information only includes the type of the corresponding area to be clustered, and the type corresponding to each area to be clustered is determined by the type of the nearest facility. The nearest facility to the areas to be clustered 1 and 2 is Building A, that is, the type "building" of Building A is used as the attribute information of the areas to be clustered 1 and 2; the nearest facility to the areas to be clustered 3 and 4 is Shopping Mall B, that is, the type "shopping mall" of Shopping Mall B is used as the attribute information of the areas to be clustered 3 and 4; the nearest facility to the area to be clustered 5 is Community C, that is, the type "community" of Community C is used as the attribute information of the area to be clustered 5; the nearest facility to the areas to be clustered 6 and 7 is Park D, that is, the type "park" of Park D is used as the attribute information of the areas to be clustered 6 and 7.
[0044] Figure 5 FIG. 1 is a schematic diagram of determining attribute information in another optional implementation method of an embodiment of the present invention. Figure 5As shown, the facilities around the area to be clustered 50 include community A, shopping mall B, community C and park D. Take the example that the attribute information only includes the type corresponding to the area to be clustered 50, and the type corresponding to each area to be clustered 50 is determined by the facility type of each facility within a preset range. Determine the preset area 51 corresponding to the area to be clustered 50, for example, take the location of the area to be clustered 50 as the center of the circle, and determine the preset distance as the radius to obtain the circular preset area 51. The preset area 51 includes three facilities, community A, community B and park D, of which two facilities are of community type and one facility is of park type. Therefore, it can be determined that the most common facility type in the corresponding preset area 51 is the attribute information of the area to be clustered 50, that is, the attribute information of the area to be clustered 50 is "community".
[0045] Furthermore, the attribute information of each region to be clustered may also include other information besides the type of the region to be clustered.
[0046] Step S200: determining a plurality of associated region combinations and a plurality of non-associated region combinations according to the location information and attribute information corresponding to each of the to-be-clustered regions.
[0047] Specifically, after determining the location information and attribute information of each area to be clustered, the relationship between the areas to be clustered after clustering is determined based on the location information and attribute information of each area to be clustered, so as to determine a plurality of associated area combinations for representing areas to be clustered that must be in the same cluster and a plurality of non-associated area combinations for representing areas to be clustered that must not be in the same cluster. In other words, each associated area combination includes two areas to be clustered that must be in the same cluster after clustering, and each non-associated area combination includes two areas to be clustered that must not be in the same cluster after clustering.
[0048] Figure 6 This is a flow chart of the process of determining the associated area combination and the non-associated area combination according to the embodiment of the present invention. Figure 6 As shown, in an embodiment of the present invention, the process of determining associated regions and unassociated regions in a plurality of regions to be clustered to determine a plurality of associated region combinations and unassociated region combinations includes the following steps:
[0049] Step S210: determining a first region to be clustered and a second region to be clustered among a plurality of regions to be clustered.
[0050] Specifically, after determining a plurality of regions to be clustered, a region to be clustered is selected as the first region to be clustered from the plurality of regions to be clustered by a preset selection method such as random selection, sequential selection or conditional selection, and the other regions to be clustered other than the first region to be clustered are determined as the second regions to be clustered. After determining the first region to be clustered and the plurality of second regions to be clustered, the relationship between the first region to be clustered and each second region to be clustered is determined, that is, whether the current first region to be clustered is associated with each second region to be clustered, or whether it is not associated with each second region to be clustered. Further, after determining the relationship between the current first region to be clustered and each second region to be clustered, the first region to be clustered and the second region to be clustered are re-determined from the plurality of regions to be clustered to re-determine the relationship between the current first region to be clustered and each second region to be clustered, until the relationship between all regions to be clustered and other regions is determined.
[0051] Step S220: Determine the position distance between the first region to be clustered and each second region to be clustered according to the corresponding position information.
[0052] Specifically, after determining the current first area to be clustered and the second area to be clustered, determine the position information corresponding to the first area to be clustered and each second area to be clustered, so as to calculate the position distance between the first clustering area and each second area to be clustered. Optionally, the position distance can be determined by calculating the Euclidean distance between the position of the first area to be clustered and the position of the second area to be clustered. Take the example of determining a first area to be clustered and three second areas to be clustered among four areas to be clustered. When the position information of the first area to be clustered is (x1, y1), and the position information of a single second area to be clustered is (x2, y2), (x3, y3) and (x4, y4) respectively, the position distances of each second area to be clustered and the first area to be clustered are respectively and
[0053] Step S230: Determine a corresponding relationship set for representing the corresponding relationship between attribute information.
[0054] Specifically, the corresponding relationship set is determined by obtaining the corresponding relationship set transmitted by the terminal device or the corresponding relationship set pre-stored in the database, and the corresponding relationship set is used to characterize whether each attribute relationship corresponds, including multiple attribute information groups consisting of two attribute information with corresponding relationships. Among them, the corresponding relationship between each attribute information can be preset according to the needs of the application scenario and stored in the form of "attribute information-attribute information". Take the application of the embodiment of the present invention in the shared vehicle scenario as an example for explanation. When the attribute information includes an attribute type, the corresponding relationship set may include multiple attribute type groups consisting of two attribute types with corresponding relationships. In actual application, during the morning rush hour, users usually take vehicles from parking spots near the community and park them at parking spots near the school or the building. Therefore, the attribute type "community" forms a corresponding relationship with the attribute types "school" and "building", respectively, and the corresponding relationship set may include two attribute type groups of "community-building" and "community-school".
[0055] Step S240: Determine whether the attribute information of the first region to be clustered corresponds to the attribute information of each second region to be clustered according to the corresponding relationship set.
[0056] Specifically, after determining the correspondence set, it is determined whether the attribute information of the first area to be clustered and each second area to be clustered corresponds to each other according to the correspondence between each attribute information in the correspondence set. Take the following attribute information groups consisting of two attribute information with corresponding relationships in the correspondence set as an example for explanation. When the attribute information corresponding to the current first area to be clustered is "school", and the attribute information corresponding to the second area to be clustered 1, the second area to be clustered 2, and the second area to be clustered 3 are "community", "shopping mall", and "building" respectively, it is determined according to the correspondence set that the attribute information of the first area to be clustered corresponds to that of the second area to be clustered 1, and there is no correspondence with the attribute information of the second area to be clustered 2 and the second area to be clustered 3.
[0057] Step S250: In response to the position distance between the second region to be clustered and the first region to be clustered being less than a preset threshold and the attribute information being in a corresponding relationship, determining that the second region to be clustered and the first region to be clustered are an associated region combination.
[0058] Specifically, after calculating the position distance between the first region to be clustered and each second region to be clustered, and the corresponding relationship between the attribute information of the first region to be clustered and each second region to be clustered, the relationship between the first region to be clustered and the second region to be clustered is further determined based on the corresponding relationship between the position distance and the attribute information. In an embodiment of the present invention, when there is a second region to be clustered and the first region to be clustered, the position distance is less than a preset threshold, and the attribute information is a corresponding relationship, it is determined that the second region to be clustered and the first region to be clustered are in a corresponding relationship. That is, the first region to be clustered and the second region to be clustered in the corresponding relationship can form a corresponding associated region combination.
[0059] Take the example of determining a first area to be clustered and three second areas to be clustered among four areas to be clustered. When the location distances between the first area to be clustered and the second area to be clustered 1, the second area to be clustered 2, and the second area to be clustered 3 are 10, 27, and 13 respectively, and the attribute information of the first area to be clustered and the second area to be clustered 1 and the second area to be clustered 2 are non-corresponding, and the attribute information of the first area to be clustered and the second area to be clustered 3 is corresponding. When the preset threshold is 15, it is determined that the first area to be clustered and the second area to be clustered 3 are geographical areas in the same cluster after clustering, that is, a corresponding associated area combination can be formed according to the first area to be clustered and the second area to be clustered 3.
[0060] Further, in response to the position distance between the second region to be clustered and the first region to be clustered being greater than a preset threshold and the attribute information being non-corresponding, it is determined that the second region to be clustered and the first region to be clustered are a non-associated region combination. That is, when the position distance between the second region to be clustered and the first region to be clustered is greater than a preset threshold and the attribute information is non-corresponding, it is determined that the second region to be clustered and the first region to be clustered are non-corresponding, that is, the first region to be clustered and the second region to be clustered in the non-corresponding relationship can form a non-associated region combination.
[0061] Still take the example of determining a first area to be clustered and three second areas to be clustered among four areas to be clustered. When the location distances between the first area to be clustered and the second area to be clustered 1, the second area to be clustered 2, and the second area to be clustered 3 are 10, 27, and 13 respectively, and the attribute information of the first area to be clustered and the second area to be clustered 1 and the second area to be clustered 2 are non-corresponding, and the attribute information of the first area to be clustered and the second area to be clustered 3 is corresponding. When the preset threshold is 15, it is determined that the first area to be clustered and the second area to be clustered 2 are geographical areas that are not in the same cluster after clustering, that is, a non-associated area combination can be formed based on the first area to be clustered and the second area to be clustered 2.
[0062] Step S300: clustering the to-be-clustered regions using the associated region combinations and the unassociated region combinations as constraint conditions to determine a target clustering result.
[0063] Specifically, after determining a plurality of associated area combinations and non-associated area combinations, each of the associated area combinations and non-associated area combinations is used as a constraint condition, and each of the areas to be clustered is clustered to obtain a clustering result. In order to ensure the clustering effect, each of the areas to be clustered can be clustered multiple times, and the error of this clustering process is calculated after each clustering, so as to determine that the current clustering result is the target clustering result when the error value meets the preset condition. The target clustering result includes multiple clusters, and each of the clusters includes multiple geographical areas. In an embodiment of the present invention, the algorithm for clustering the areas to be clustered is a convex clustering algorithm, that is, each cluster obtained after clustering is a convex hull containing multiple geographical areas, and each convex hull does not intersect. Optionally, the convex clustering algorithm can be a clustering algorithm such as the BIRCH algorithm (balanced iterative reduction clustering algorithm) and the K-means algorithm.
[0064] Figure 7 FIG. 4 is a flow chart of an embodiment of the present invention for iteratively determining target clustering results. Figure 7 As shown, the process of determining the target clustering result in the embodiment of the present invention is an iterative process, and includes the following steps:
[0065] Step S310: using the associated region combinations and the non-associated region combinations as constraint conditions, clustering the regions to be clustered in the current iteration process to obtain a plurality of region sets.
[0066] Specifically, each of the associated area combinations and non-associated area combinations is used as a constraint condition, and each area to be clustered is clustered in this iterative process through a pre-set clustering algorithm to obtain multiple area sets, and the area sets are clusters obtained by this clustering. Among them, the clustering algorithm in the embodiment of the present invention is a convex clustering algorithm, that is, the clusters obtained after clustering by the BIRCH algorithm (balanced iterative reduction clustering algorithm) and the K-means algorithm are all convex hulls containing multiple geographical areas, and the convex hulls corresponding to each type of cluster do not intersect.
[0067] Step S320: Calculate the corresponding error value based on the current clustering result according to a preset convex function.
[0068] Specifically, after determining the clustering result of this time, the error value corresponding to the clustering result of this time is calculated according to a preset convex function. Optionally, the convex function for calculating the error value is the following function:
[0069]
[0070] in, is the error value, k is the number of clusters obtained after clustering in this iterative process, that is, the number of regional sets, π c is one of the k clusters, M is the associated combination set including all associated area combinations, C is the non-associated combination set l including all non-associated area combinations i is x i The corresponding cluster label, ω ij is the regularization penalty caused by violating the association and non-association constraints. Optionally, the method for calculating the clustering result error value in the embodiment of the present invention may be an alternating direction method of multipliers (ADMM).
[0071] Step S330: The error value meets a preset condition.
[0072] Specifically, it is determined whether the error value obtained in the current iteration process meets the preset condition, so as to enter the next iteration process when the preset condition is not met, that is, re-execute step S310 and perform clustering again. In an optional implementation of the embodiment of the present invention, the preset condition may be a preset error threshold, and when the error value obtained after clustering in the current iteration process is less than the error threshold, it is determined that the error value meets the preset condition. In another optional implementation of the embodiment of the present invention, the preset condition may also be a preset number of iterations threshold and an error drop value with an initial value of 0, and when the error value obtained in each iteration process decreases or remains unchanged compared with the error value obtained in the previous iteration, the error drop value is increased by one, and when the error value obtained in the iteration process increases compared with the error value obtained in the previous iteration, the error drop value is reset to zero, until the error drop value reaches the preset number of iterations threshold, it is determined that the current error value meets the preset condition. It should be understood that the preset condition may also be other conditions for constraining the error value to determine the best clustering effect, which is not limited in the embodiment of the present invention.
[0073] Step S340: determine that the current clustering result is the target clustering result.
[0074] Specifically, when it is determined in step S330 that the error value obtained in the current iteration process meets the preset condition, the current clustering result is determined to be the target clustering result. That is, regional division is performed based on the multiple clusters obtained after the current clustering to determine the larger geographical area corresponding to each cluster, including the multiple smaller geographical areas in the corresponding cluster.
[0075] The geographic area clustering method of the embodiment of the present invention introduces associated area combinations and unassociated area combinations in the process of clustering geographic areas, and clusters the associated area combinations and unassociated area combinations as constraints, while ensuring local and global optimality to improve the clustering effect.
[0076] Figure 8 FIG. 1 is a schematic diagram of a geographic area clustering device according to an embodiment of the present invention. Figure 8 As shown, the geographic area clustering device includes an information determination module 80 , an area combination determination module 81 and a clustering module 82 .
[0077] Specifically, the information determination module 80 is used to determine the location information and attribute information corresponding to the multiple areas to be clustered. The area combination determination module 81 is used to determine multiple associated area combinations and multiple non-associated area combinations according to the location information and attribute information corresponding to each of the areas to be clustered, wherein the associated area combination includes two areas to be clustered that must be in the same cluster after clustering, and the non-associated area combination includes two areas to be clustered that must not be in the same cluster after clustering. The clustering module 82 is used to cluster each of the areas to be clustered using each of the associated area combinations and non-associated area combinations as constraints to determine a target clustering result, wherein the target clustering result includes multiple clusters, and each of the clusters includes multiple areas.
[0078] Furthermore, the information determination module 80 includes:
[0079] A location determination submodule, used to obtain the longitude and latitude data corresponding to each of the to-be-clustered areas as location information;
[0080] The attribute information determination submodule is used to determine corresponding attribute information according to facilities in a preset area around each of the areas to be clustered.
[0081] Furthermore, the area combination determination module 81 includes:
[0082] A region determination submodule, used to determine a first region to be clustered among the multiple regions to be clustered, and to determine other regions to be clustered other than the first region to be clustered as second regions to be clustered;
[0083] A position determination submodule, used to determine the position distance between the first area to be clustered and each of the second areas to be clustered according to the corresponding position information;
[0084] A set determination submodule, used to determine a corresponding relationship set used to characterize the corresponding relationship between attribute information;
[0085] a correspondence determination submodule, configured to determine whether the attribute information of the first region to be clustered and each of the second regions to be clustered correspond to each other according to the correspondence set;
[0086] The first combination determination submodule is used to determine that the second area to be clustered and the first area to be clustered are an associated area combination in response to the position distance between the second area to be clustered and the first area to be clustered being less than a preset threshold and the attribute information is in a corresponding relationship.
[0087] Furthermore, the area combination determination module 81 further includes:
[0088] The second combination determination submodule is used to determine that the second area to be clustered and the first area to be clustered are a non-associated area combination in response to the position distance between the second area to be clustered and the first area to be clustered being greater than a preset threshold and the attribute information is non-corresponding.
[0089] Furthermore, the clustering module 82 includes:
[0090] Used to iteratively perform the following steps:
[0091] A clustering submodule, for clustering the regions to be clustered in the current iteration process by taking the associated region combinations and the unassociated region combinations as constraint conditions to obtain a plurality of region sets;
[0092] An error determination submodule, used to calculate a corresponding error value based on the current clustering result according to a preset convex function;
[0093] The result determination module is used to determine the current clustering result as the target clustering result in response to the error value satisfying a preset condition.
[0094] Furthermore, the error value of the clustering result can be calculated by an alternating direction multiplier method.
[0095] The embodiment of the present invention introduces associated region combinations and non-associated region combinations in the process of clustering geographic regions, and clusters the associated region combinations and non-associated region combinations as constraints, while ensuring local and global optimization to improve clustering effect.
[0096] Fig. 9 FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present invention. Fig. 9 As shown, Fig. 9The electronic device shown is a general address query device, which includes a general computer hardware structure, which at least includes a processor 90 and a memory 91. The processor 90 and the memory 91 are connected via a bus 92. The memory 91 is suitable for storing instructions or programs executable by the processor 90. The processor 90 can be an independent microprocessor or a collection of one or more microprocessors. Thus, the processor 90 executes the instructions stored in the memory 91, thereby executing the method flow of the embodiment of the present invention as described above to realize the processing of data and the control of other devices. The bus 92 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to the display controller 93 and the display device and the input / output (I / O) device 94. The input / output (I / O) device 94 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a somatosensory input device, a printer, and other devices known in the art. Typically, the input / output device 94 is connected to the system via an input / output (I / O) controller 95.
[0097] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices (equipment) or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] The present application is described with reference to flowcharts of methods, apparatuses (devices) and computer program products according to embodiments of the present application. It should be understood that each process in the flowchart can be implemented by computer program instructions.
[0099] These computer program instructions may be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device that implements the process Figure 1 A function specified in a process or multiple processes.
[0100] These computer program instructions may also be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce the instructions for implementing the process Figure 1 A device that specifies functions in a process or multiple processes.
[0101] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.
[0102] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by specifying relevant hardware through a program, and the program is stored in a storage medium, including several instructions for a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0103] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A geographical area clustering method, characterized in that: The method comprises: Determine location information and attribute information corresponding to a plurality of areas to be clustered, wherein the attribute information includes type information determined according to the types of facilities around the areas to be clustered; Determine a plurality of associated region combinations and a plurality of non-associated region combinations according to the location information and attribute information corresponding to each of the regions to be clustered, wherein the associated region combination includes two regions to be clustered that must be in the same cluster after clustering, and the non-associated region combination includes two regions to be clustered that must not be in the same cluster after clustering; Taking each of the associated region combinations and the non-associated region combinations as constraint conditions, clustering each of the to-be-clustered regions to determine a target clustering result, wherein the target clustering result includes a plurality of clusters, and each of the clusters includes a plurality of regions; Among them, the position distance between the two to-be-clustered areas in the associated area combination is less than a preset threshold, and the attribute information is in a corresponding relationship; the position distance between the two to-be-clustered areas in the non-associated area combination is greater than a preset threshold, and the attribute information is in a non-corresponding relationship.
2. The method according to claim 1, characterized in that The step of determining the location information and attribute information corresponding to the plurality of regions to be clustered includes: Acquire the longitude and latitude data corresponding to each of the to-be-clustered areas as location information; Corresponding attribute information is determined according to facilities in a preset area around each of the areas to be clustered.
3. The method according to claim 1, characterized in that The step of determining a plurality of associated area combinations and a plurality of non-associated area combinations according to the location information and attribute information corresponding to each of the to-be-clustered areas comprises: Determine a first region to be clustered among the multiple regions to be clustered, and simultaneously determine other regions to be clustered other than the first region to be clustered as second regions to be clustered; Determine the position distance between the first region to be clustered and each of the second regions to be clustered according to the corresponding position information; Determine a corresponding relationship set for representing the corresponding relationship between attribute information; Determining whether the attribute information of the first region to be clustered and each of the second regions to be clustered corresponds to each other according to the corresponding relationship set; In response to the position distance between the second region to be clustered and the first region to be clustered being less than a preset threshold and the attribute information being in a corresponding relationship, it is determined that the second region to be clustered and the first region to be clustered are an associated region combination.
4. The method according to claim 3, characterized in that The determining of a plurality of associated area combinations and a plurality of non-associated area combinations according to the location information and attribute information corresponding to each of the to-be-clustered areas further comprises: In response to the position distance between the second region to be clustered and the first region to be clustered being greater than a preset threshold and the attribute information being non-corresponding, it is determined that the second region to be clustered and the first region to be clustered are a non-associated region combination.
5. The method according to claim 1, characterized in that: The clustering of the to-be-clustered regions using the associated region combinations and the unassociated region combinations as constraint conditions to determine a target clustering result includes: Perform the following steps iteratively: Taking each of the associated region combinations and the non-associated region combinations as constraint conditions, clustering each of the regions to be clustered in the current iteration process to obtain a plurality of region sets; Calculate the corresponding error value based on the current clustering result according to the preset convex function; In response to the error value satisfying a preset condition, determining the current clustering result as a target clustering result.
6. The method according to claim 5, characterized in that The error value of the clustering result can be calculated by an alternating direction multiplier method.
7. A geographical area clustering device, characterized in that: The device comprises: An information determination module, used to determine location information and attribute information corresponding to a plurality of areas to be clustered, wherein the attribute information includes type information determined according to the types of facilities around the areas to be clustered; A region combination determination module, used to determine a plurality of associated region combinations and a plurality of non-associated region combinations according to the location information and attribute information corresponding to each of the regions to be clustered, wherein the associated region combination includes two regions to be clustered that must be in the same cluster after clustering, and the non-associated region combination includes two regions to be clustered that must not be in the same cluster after clustering; A clustering module, used for clustering the to-be-clustered regions using the associated region combinations and the unassociated region combinations as constraint conditions to determine a target clustering result, wherein the target clustering result includes a plurality of clusters, and each of the clusters includes a plurality of regions; Among them, the position distance between the two to-be-clustered areas in the associated area combination is less than a preset threshold, and the attribute information is in a corresponding relationship; the position distance between the two to-be-clustered areas in the non-associated area combination is greater than a preset threshold, and the attribute information is in a non-corresponding relationship.
8. The device according to claim 7, characterized in that The information determination module comprises: A location determination submodule, used to obtain the longitude and latitude data corresponding to each of the to-be-clustered areas as location information; The attribute information determination submodule is used to determine corresponding attribute information according to facilities in a preset area around each of the areas to be clustered.
9. The device according to claim 7, characterized in that The area combination determination module includes: A region determination submodule, used to determine a first region to be clustered among the multiple regions to be clustered, and to determine other regions to be clustered other than the first region to be clustered as second regions to be clustered; A position determination submodule, used to determine the position distance between the first area to be clustered and each of the second areas to be clustered according to the corresponding position information; A set determination submodule, used to determine a corresponding relationship set used to characterize the corresponding relationship between attribute information; a correspondence determination submodule, configured to determine whether the attribute information of the first region to be clustered and each of the second regions to be clustered correspond to each other according to the correspondence set; The first combination determination submodule is used to determine that the second area to be clustered and the first area to be clustered are an associated area combination in response to the position distance between the second area to be clustered and the first area to be clustered being less than a preset threshold and the attribute information is in a corresponding relationship.
10. The device according to claim 9, characterized in that The region combination determination module also includes: The second combination determination submodule is used to determine that the second area to be clustered and the first area to be clustered are a non-associated area combination in response to the position distance between the second area to be clustered and the first area to be clustered being greater than a preset threshold and the attribute information is non-corresponding.
11. The device according to claim 7, characterized in that The clustering module comprises: Used to iteratively perform the following steps: A clustering submodule, for clustering the regions to be clustered in the current iteration process by taking the associated region combinations and the unassociated region combinations as constraint conditions to obtain a plurality of region sets; An error determination submodule, used to calculate a corresponding error value based on the current clustering result according to a preset convex function; The result determination module is used to determine the current clustering result as the target clustering result in response to the error value satisfying a preset condition.
12. The device according to claim 11, characterized in that The error value of the clustering result can be calculated by an alternating direction multiplier method.
13. A computer-readable storage medium for storing computer program instructions, characterized in that: The computer program instructions implement the method according to any one of claims 1 to 6 when executed by a processor.
14. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Quick target association method based on clustering analysis
CN103617163A
Target area and user determining method, device and equipment
CN108271120A