Grid clustering method and device, equipment and storage medium

By using the technology of hexagonal mesh and mesh density sorting in the mesh clustering method, the problem that traditional methods cannot adapt to curvature and non-rectangular terrain is solved, and more accurate and efficient clustering results are achieved.

CN119989015APending Publication Date: 2025-05-13SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510361586.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The traditional mesh clustering method cannot adapt to the curvature and non-rectangular terrain of the target area, resulting in errors in the clustering results.

Method used

The target area is divided layer by layer by layer by layer by layer, the grid density of each target grid is counted, and the density is sorted and clustered in the order of high to low density to form cluster clusters.

Benefits of technology

Through the hexagonal mesh clustering method, the curvature of the target area and the non-rectangular terrain can be more accurately adapted to the target area, improve the accuracy and efficiency of the clustering results, and avoid the boundary effect in the rectangular mesh clustering method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119989015A_ABST
    Figure CN119989015A_ABST
Patent Text Reader

Abstract

The invention provides a grid clustering method and device, equipment and a storage medium, and the method comprises the steps: carrying out the layer-by-layer grid division of a target region represented by a target image according to each resolution corresponding to the target image, and obtaining N target grids corresponding to the target region; counting the grid density corresponding to each target grid to obtain N grid densities; sorting the N target grids according to the sequence of the corresponding grid densities from high to low to form a grid sequence; and clustering the N target grids according to the sequence of the N target grids in the grid sequence and the grid density corresponding to each target grid to obtain M clusters. In the embodiment of the invention, the target area is subjected to grid division through the hexagonal grid, so that the deviation and error of the clustering result can be reduced; in this way, the curvature and the non-rectangular terrain of the target area are adapted through a hexagonal grid clustering method, and the accuracy of a clustering result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a grid clustering method, apparatus, device and storage medium. Background Art

[0002] With the continuous development of geographic information technology, the ability to acquire, store and process geographic data has been continuously improved, and the Geographic Information System (GIS) has been widely used in various fields. Cluster analysis algorithm is one of the important algorithms in the geographic information system. It is a method to find the similarity between data and classify the data accordingly to discover the useful information or knowledge hidden in the data.

[0003] The traditional grid clustering method divides the target area into multiple rectangular areas according to plane coordinates or longitude and latitude, and clusters the rectangular areas with similar area density. However, the traditional grid clustering method cannot adapt to the curvature and non-rectangular terrain of the target area, which leads to errors in the clustering results. Summary of the invention

[0004] The main purpose of the present application is to provide a grid clustering method, apparatus, computer device and storage medium, aiming to solve the technical problem that the traditional grid clustering method cannot adapt to the curvature and non-rectangular terrain of the target area, which leads to errors in the clustering results.

[0005] To achieve the above object, the present application provides a grid clustering method, the method comprising:

[0006] Dividing the target area represented by the target image into grids layer by layer according to the resolutions corresponding to the target image, to obtain N target grids corresponding to the target area; the target grids are hexagonal grids, and N is a positive integer greater than 1;

[0007] Count the grid densities corresponding to each target grid to obtain N grid densities;

[0008] Sorting the N target grids in descending order of corresponding grid densities to form a grid sequence;

[0009] According to the order of the N target grids in the grid sequence, the N target grids are clustered according to the grid density corresponding to each target grid to obtain M clusters, where M is a positive integer greater than 1 and less than N.

[0010] Optionally, the step of performing grid division layer by layer on the target area represented by the target image according to each resolution corresponding to the target image to obtain N target grids corresponding to the target area includes:

[0011] Obtaining each resolution corresponding to the target image;

[0012] According to the order of the resolutions from low to high, the target area represented by the target image is meshed layer by layer until the target area is meshed with a preset resolution, and then the meshing of the target area is stopped;

[0013] The grids obtained by dividing the target area into grids with a preset resolution are determined as N target grids corresponding to the target area.

[0014] Optionally, after dividing the target area represented by the target image into grids layer by layer according to the resolutions corresponding to the target image to obtain N target grids corresponding to the target area, the method further includes:

[0015] Assign a unique identifier to each target grid;

[0016] After counting the grid densities corresponding to each target grid to obtain N grid densities, the method further includes:

[0017] Create a density lookup table;

[0018] Establishing a mapping relationship between a grid density corresponding to each target grid and a unique identifier corresponding to each target grid;

[0019] The mapping relationship is stored in the density lookup table.

[0020] Optionally, clustering the N target grids in the grid sequence according to the grid density corresponding to each target grid to obtain M clusters includes:

[0021] Determine the target grid that is ranked first in the grid sequence as the first grid;

[0022] Generate a cluster according to the grid density corresponding to the first grid and the grid density corresponding to the plurality of second grids; the plurality of second grids are associated with the first grid, and the first grid is located at the center of the grid formed by the cluster;

[0023] Deleting the first grid and the plurality of second grids from the grid sequence;

[0024] Return step: determine the target grid that is first sorted in the grid sequence as the first grid, until the first grid is the last grid in the grid sequence.

[0025] Optionally, generating a cluster according to a grid density corresponding to the first grid and grid densities corresponding to the plurality of second grids includes:

[0026] determining the first grid and a plurality of second grids adjacent to the first grid as candidate clusters;

[0027] Determine the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster;

[0028] When the grid density corresponding to the candidate cluster is lower than or equal to the preset threshold, a new candidate cluster is generated based on the target grids adjacent to the candidate cluster, and the process returns to the step of: determining the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster;

[0029] When the grid density corresponding to the candidate cluster is higher than a preset threshold, the candidate cluster is determined as a clustering cluster.

[0030] Optionally, generating a new candidate cluster based on a target grid adjacent to the candidate cluster includes:

[0031] Determine the target grids adjacent to the candidate cluster as a plurality of second grids;

[0032] A new candidate cluster is generated according to the candidate cluster and the plurality of second grids.

[0033] Optionally, when the grid density corresponding to the candidate cluster is higher than a preset threshold, determining the candidate cluster as a cluster cluster includes:

[0034] When the grid density corresponding to the candidate cluster is higher than a preset threshold, acquiring a plurality of second grids adjacent to the candidate cluster;

[0035] The second grids whose grid areas are smaller than the preset area among the plurality of second grids are merged into the cluster.

[0036] In addition, to achieve the above purpose, the present application also provides a grid clustering device, including:

[0037] A division module, used for performing grid division layer by layer on a target area represented by the target image according to each resolution corresponding to the target image, to obtain N target grids corresponding to the target area; the target grid is a hexagonal grid, and N is a positive integer greater than 1;

[0038] A statistical module is used to count the grid density corresponding to each target grid to obtain N grid densities;

[0039] A sorting module, used for sorting the N target grids in descending order of corresponding grid density to form a grid sequence;

[0040] The clustering module is used to cluster the N target grids in the grid sequence according to the grid density corresponding to each target grid, so as to obtain M clusters, where M is a positive integer greater than 1 and less than N.

[0041] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0042] The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the grid clustering methods proposed in the embodiments of the present application are implemented.

[0043] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0044] The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of any one of the grid clustering methods proposed in the embodiments of the present application are implemented.

[0045] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0046] The present application provides a grid clustering method, apparatus, device and storage medium, the method comprising: performing grid division layer by layer on a target area represented by a target image according to each resolution corresponding to the target image, to obtain N target grids corresponding to the target area; the target grid is a hexagonal grid, N is a positive integer greater than 1; counting the grid density corresponding to each target grid, to obtain N grid densities; sorting the N target grids in order from high to low according to the corresponding grid density, to form a grid sequence; clustering the N target grids according to the order of the N target grids in the grid sequence and the grid density corresponding to each target grid, to obtain M cluster clusters, M is a positive integer greater than 1 and less than N. In an embodiment of the present application, the target area is gridded by hexagonal grids. The hexagonal grids are more symmetrical and uniform than the rectangular grids, and can reduce the deviation and error of the clustering results. Furthermore, a grid sequence is formed according to the corresponding grid densities. According to the order of the N target grids in the grid sequence, the N target grids are clustered according to the grid density corresponding to each target grid to obtain M cluster clusters, thereby adapting to the curvature and non-rectangular terrain of the target area by the hexagonal grid clustering method, thereby improving the accuracy of the clustering results.

[0047] In addition, the hexagonal grid is denser than the rectangular grid and can better cover different areas, thus reflecting spatial information more accurately; the hexagonal grid clustering method is relatively simple and easy to use, does not require the number of clusters or parameters to be set in advance, and can automatically determine the optimal clustering results; this method can also quickly process large-scale data and has good efficiency and scalability; the hexagonal grid can effectively deal with boundary problems and avoid the boundary effect that occurs in the rectangular grid clustering method. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0050] Figure 2 is a flow chart of a grid clustering method provided in an embodiment of the present application;

[0051] Figure 3 is a schematic diagram of grid division provided in an embodiment of the present application;

[0052] Figure 4 This is one of the schematic diagrams of clustering provided in the embodiments of the present application;

[0053] Figure 5 This is the second schematic diagram of the cluster provided in the embodiment of the present application;

[0054] Figure 6 This is the third schematic diagram of the cluster provided in the embodiment of the present application;

[0055] Figure 7 It is a structural schematic diagram of an embodiment of a grid clustering device provided in an embodiment of the present application;

[0056] Figure 8 It is a basic structural block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The grid clustering method provided in the embodiment of the present application is applied to a grid clustering device. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" in the specification and claims of the present application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned figures are used to distinguish different objects, not to describe a specific order.

[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0059] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0060] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0061] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social online platform software, etc.

[0062] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.

[0063] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0064] It should be noted that the grid clustering method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the grid clustering device is generally arranged in the server / terminal device.

[0065] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0066] Please refer to Figure 2 , shows a flow chart of an embodiment of the grid clustering method proposed in the present application. The embodiment of the present application can acquire and process relevant data based on artificial intelligence technology. The grid clustering method provided in the embodiment of the present application includes the following steps:

[0067] S210 , dividing a target area represented by the target image into grids layer by layer according to each resolution corresponding to the target image, to obtain N target grids corresponding to the target area.

[0068] In this step, an image representing the target area is acquired, and the image is determined as the target image.

[0069] It should be understood that the target image corresponds to multiple resolutions, and the clarity of the target area represented by the target image at each resolution is different. Generally speaking, the higher the resolution, the higher the clarity.

[0070] In this step, the target area represented by the target image is gridded layer by layer according to the resolutions corresponding to the target image. Specifically, the target area can be gridded once according to one resolution to achieve multi-level division of the target area, and the grids obtained by the last level division of the target area are determined as the N target grids corresponding to the target area.

[0071] It should be noted that the above target grid is a hexagonal grid, that is, in this step, the target area is divided into grids layer by layer through hexagonal grids; N is a positive integer greater than 1.

[0072] S220, counting the grid density corresponding to each target grid to obtain N grid densities.

[0073] It should be noted that the grid density is related to the geographical features, building density and population density of the area represented by the target grid. If the building density and population density of an area are higher, the grid density corresponding to the grid representing the area will be higher.

[0074] In this step, the grid density corresponding to each target grid can be counted to obtain N grid densities. Optionally, for a hexagonal grid, topological processing is performed on the hexagonal grid and the density points, specifically, the boundaries and nodes of the grid are generated as topological elements, and the positions of the density points are also generated as topological elements. Then, a topological relationship between the grid and the density points is established for spatial query, and a spatial query is performed on each grid to query all the points contained in the grid, and the number of points is counted as the density in the grid. The above-mentioned density points are related to the geographical features, building density and population density of the area represented by the grid.

[0075] S230 , sorting the N target grids in descending order of corresponding grid densities to form a grid sequence.

[0076] In this step, after obtaining the N grid densities corresponding to the N target grids, the N target grids are sorted in descending order of the corresponding grid densities, and the sorted N target grids form a grid sequence. That is, the grid density corresponding to the target grid sorted first in the grid sequence is the highest, and the grid density corresponding to the target grid sorted last in the grid sequence is the lowest.

[0077] S240 , clustering the N target grids in the grid sequence according to the grid density corresponding to each target grid to obtain M clusters.

[0078] In this step, after obtaining the grid sequence, the N target grids are clustered according to the grid density corresponding to each target grid in the order of the N target grids in the grid sequence, that is, the target grid with the highest density is clustered first, and then each target grid is clustered in turn according to the order of each target grid in the grid sequence to obtain M clusters, where M is a positive integer greater than 1 and less than N.

[0079] Optionally, after obtaining the M clusters, the M clusters are stored in a database.

[0080] In an embodiment of the present application, the target area is gridded by hexagonal grids. The hexagonal grids are more symmetrical and uniform than the rectangular grids, and can reduce the deviation and error of the clustering results. Furthermore, a grid sequence is formed according to the corresponding grid densities. According to the order of the N target grids in the grid sequence, the N target grids are clustered according to the grid density corresponding to each target grid to obtain M cluster clusters, thereby adapting to the curvature and non-rectangular terrain of the target area by the hexagonal grid clustering method, thereby improving the accuracy of the clustering results.

[0081] In addition, the hexagonal grid is denser than the rectangular grid and can better cover different areas, thus reflecting spatial information more accurately; the hexagonal grid clustering method is relatively simple and easy to use, does not require the number of clusters or parameters to be set in advance, and can automatically determine the optimal clustering results; this method can also quickly process large-scale data and has good efficiency and scalability; the hexagonal grid can effectively deal with boundary problems and avoid the boundary effect that occurs in the rectangular grid clustering method.

[0082] Optionally, the step of performing grid division layer by layer on the target area represented by the target image according to each resolution corresponding to the target image to obtain N target grids corresponding to the target area includes:

[0083] Obtaining each resolution corresponding to the target image;

[0084] According to the order of the resolutions from low to high, the target area represented by the target image is meshed layer by layer until the target area is meshed with a preset resolution, and then the meshing of the target area is stopped;

[0085] The grids obtained by dividing the target area into grids with a preset resolution are determined as N target grids corresponding to the target area.

[0086] In this embodiment, each resolution corresponding to the target image and a preset resolution corresponding to the target image are obtained. It should be understood that the preset resolution is a custom-set resolution, and optionally, the preset resolution is the highest resolution corresponding to the target image.

[0087] In this embodiment, the target area is first divided into hierarchical grids at the lowest resolution, and then the resolution is selected in order from low to high, and the target area is divided into hierarchical grids for the second time, until the target area is divided into grids at a preset resolution, and the grids obtained by dividing the target area into grids at the preset resolution are determined as the N target grids corresponding to the target area.

[0088] That is, the hexagonal grid corresponding to a higher level is finer than the hexagonal grid corresponding to a lower level, and the area of ​​the target grid obtained by the lower resolution is larger than the area of ​​the target grid obtained by the higher resolution. For ease of understanding, please refer to Figure 3 , Figure 3 is a schematic diagram of grid division provided in an embodiment of the present application, Figure 3 A scene is shown where the target area is divided into a hexagonal grid.

[0089] In this embodiment, the target area is gridded layer by layer at each resolution to obtain the hexagonal grid corresponding to the target area at each resolution. Different levels represent different spatial scales, thereby ensuring that the grid clustering method provided in the embodiment of the present application can adapt to areas with different geographical features. In addition, the hierarchical division of the target area by hexagonal grids can adapt to the curvature indicated by the target area, thereby improving the accuracy of the grid clustering results.

[0090] Optionally, after dividing the target area represented by the target image into grids layer by layer according to the resolutions corresponding to the target image to obtain N target grids corresponding to the target area, the method further includes:

[0091] Assign a unique identifier to each target grid;

[0092] After counting the grid densities corresponding to each target grid to obtain N grid densities, the method further includes:

[0093] Create a density lookup table;

[0094] Establishing a mapping relationship between a grid density corresponding to each target grid and a unique identifier corresponding to each target grid;

[0095] The mapping relationship is stored in the density lookup table.

[0096] In this embodiment, after obtaining N target grids, a unique identifier is assigned to each target grid. Optionally, the unique identifier is a 64-bit binary number.

[0097] After obtaining the grid density corresponding to each target grid through statistics, a density query table is created to establish a mapping relationship between each grid density and a unique identifier corresponding to each target grid, and the mapping relationship is stored in the density query table.

[0098] In this embodiment, by creating a density query table for characterizing the mapping relationship between the grid density and the unique identifier, it is convenient for the user to query the grid density corresponding to different target grids in the density query table in a timely manner.

[0099] Optionally, clustering the N target grids in the grid sequence according to the grid density corresponding to each target grid to obtain M clusters includes:

[0100] Determine the target grid that is ranked first in the grid sequence as the first grid;

[0101] Generate a cluster according to the grid density corresponding to the first grid and the grid density corresponding to the plurality of second grids; the plurality of second grids are associated with the first grid, and the first grid is located at the center of the grid formed by the cluster;

[0102] Deleting the first grid and the plurality of second grids from the grid sequence;

[0103] Return step: determine the target grid that is first sorted in the grid sequence as the first grid, until the first grid is the last grid in the grid sequence.

[0104] In this embodiment, the target grid that is ranked first in the grid sequence is determined as the first grid.

[0105] The target grid associated with the first grid is determined as the second grid, wherein the second grid includes the target grid adjacent to the first grid. For specific implementation methods of determining the second grid, please refer to the subsequent embodiments. Figure 4 ,exist Figure 4 In the illustrated scene, the hexagonal grid located in the center is the first grid, and the six target grids adjacent to the first grid are the second grids.

[0106] A cluster is generated according to the grid density corresponding to the first grid and the grid density corresponding to the multiple second grids, and the first grid and the multiple second grids are deleted from the grid sequence, so as to complete a clustering process of the first grid and the multiple second grids. For the specific implementation method, please refer to the subsequent embodiments.

[0107] Subsequently, the target grid that is ranked first in the grid sequence is determined as the first grid, and the above steps are repeated to continue clustering the new first grid and the new second grid until the clustering process is completed for all the target grids in the grid sequence, and M cluster clusters are obtained.

[0108] See also Figure 5 , Figure 5 A schematic diagram of multiple clusters.

[0109] In this embodiment, N target grids are clustered according to the grid density corresponding to each target grid to obtain M cluster clusters, that is, hexagonal grids in the same category are regarded as the same cluster, thereby realizing the clustering of geographic data. The above method has low computational complexity, improves the efficiency of grid clustering, and the clustering result has a visual technical effect.

[0110] The following specifically describes the implementation method of performing a clustering process on the target grid:

[0111] Optionally, generating a cluster according to a grid density corresponding to the first grid and grid densities corresponding to the plurality of second grids includes:

[0112] determining the first grid and a plurality of second grids adjacent to the first grid as candidate clusters;

[0113] Determine the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster;

[0114] When the grid density corresponding to the candidate cluster is lower than or equal to the preset threshold, a new candidate cluster is generated based on the target grids adjacent to the candidate cluster, and the process returns to the step of: determining the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster;

[0115] When the grid density corresponding to the candidate cluster is higher than a preset threshold, the candidate cluster is determined as a clustering cluster.

[0116] In this embodiment, the first grid and a plurality of second grids adjacent to the first grid are determined as candidate clusters. Figure 4 , Figure 4 A schematic diagram of a candidate cluster.

[0117] Calculate the sum of the grid densities corresponding to the target grids included in the candidate cluster, and determine the sum as the grid density corresponding to the candidate cluster. Compare the size relationship between the grid density and the preset threshold. If the grid density corresponding to the candidate cluster is lower than or equal to the preset threshold, it means that the candidate cluster does not meet the clustering requirements and does not include all target grids of the same category; then add the target grids adjacent to the candidate cluster to the candidate cluster to generate a new candidate cluster.

[0118] The sum of the grid densities corresponding to the target grids included in the candidate cluster is calculated again, and the grid density corresponding to the candidate cluster is updated; when the grid density corresponding to the candidate cluster is lower than or equal to the preset threshold, the above steps are repeated until the grid density corresponding to the candidate cluster is higher than the preset threshold.

[0119] It should be understood that when the grid density corresponding to the candidate cluster is higher than a preset threshold, it means that the candidate cluster meets the clustering requirement, that is, includes all target grids of the same category, and the candidate cluster is determined as a cluster cluster.

[0120] In this embodiment, when the grid density corresponding to the candidate cluster is higher than the preset threshold, the candidate cluster is determined as a cluster cluster, and the preset threshold is used to divide the cluster clusters, and the outliers and noise in the data are adaptively processed, so that the clustering results have better robustness and reliability.

[0121] Optionally, generating a new candidate cluster based on a target grid adjacent to the candidate cluster includes:

[0122] Determine the target grids adjacent to the candidate cluster as a plurality of second grids;

[0123] A new candidate cluster is generated according to the candidate cluster and the plurality of second grids.

[0124] In this embodiment, the target grids adjacent to the candidate cluster are determined as a plurality of second grids, and the plurality of second grids are added to the candidate cluster to generate a new candidate cluster. In other words, the target grids adjacent to the second grids are added to the candidate cluster.

[0125] Optionally, when the grid density corresponding to the candidate cluster is higher than a preset threshold, determining the candidate cluster as a cluster cluster includes:

[0126] When the grid density corresponding to the candidate cluster is higher than a preset threshold, acquiring a plurality of second grids adjacent to the candidate cluster;

[0127] The second grids whose grid areas are smaller than the preset area among the plurality of second grids are merged into the cluster.

[0128] By determining the candidate clusters whose corresponding grid density is higher than the preset threshold as cluster clusters, clustering processing of the target grid is achieved. However, there may still be narrow and long areas in the target area that are not clustered, that is, target grids with smaller areas are ignored and not all target grids are clustered, which leads to inaccurate clustering results.

[0129] In order to solve the above technical problems, in this embodiment, when the grid density corresponding to the candidate cluster is higher than a preset threshold, multiple second grids adjacent to the candidate cluster are obtained, and the second grids with a grid area smaller than the preset area among the multiple second grids are merged into the clustering cluster, so as to realize clustering processing of target grids with smaller areas and improve the accuracy of the clustering results.

[0130] like Figure 6 As shown, Figure 6It shows multiple clusters after clustering the target grids with smaller areas.

[0131] See also Figure 7 , an embodiment of the present application provides a grid clustering device 700, the grid clustering device 700 comprising:

[0132] A division module 710 is used to divide the target area represented by the target image into grids layer by layer according to the resolutions corresponding to the target image, so as to obtain N target grids corresponding to the target area; the target grids are hexagonal grids, and N is a positive integer greater than 1;

[0133] A statistics module 720 is used to count the grid density corresponding to each target grid to obtain N grid densities;

[0134] A sorting module 730 is used to sort the N target grids in descending order of corresponding grid density to form a grid sequence;

[0135] The clustering module 740 is used to cluster the N target grids in the grid sequence according to the grid density corresponding to each target grid, to obtain M clusters, where M is a positive integer greater than 1 and less than N.

[0136] Optionally, the division module 710 is specifically configured to:

[0137] Obtaining each resolution corresponding to the target image;

[0138] According to the order of the resolutions from low to high, the target area represented by the target image is meshed layer by layer until the target area is meshed with a preset resolution, and then the meshing of the target area is stopped;

[0139] The grids obtained by dividing the target area into grids with a preset resolution are determined as N target grids corresponding to the target area.

[0140] Optionally, the grid clustering device 700 further includes:

[0141] an allocation module, for assigning a unique identifier to each target grid;

[0142] The grid clustering device 700 further includes:

[0143] Create a module for creating a density query table;

[0144] An establishing module, used to establish a mapping relationship between a grid density corresponding to each target grid and a unique identifier corresponding to each target grid;

[0145] A storage module is used to store the mapping relationship in the density query table.

[0146] Optionally, the clustering module 740 is specifically configured to:

[0147] Determine the target grid that is ranked first in the grid sequence as the first grid;

[0148] Generate a cluster according to the grid density corresponding to the first grid and the grid density corresponding to the plurality of second grids; the plurality of second grids are associated with the first grid, and the first grid is located at the center of the grid formed by the cluster;

[0149] Deleting the first grid and the plurality of second grids from the grid sequence;

[0150] Return step: determine the target grid that is first sorted in the grid sequence as the first grid, until the first grid is the last grid in the grid sequence.

[0151] Optionally, the clustering module 740 is further specifically configured to:

[0152] determining the first grid and a plurality of second grids adjacent to the first grid as candidate clusters;

[0153] Determine the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster;

[0154] When the grid density corresponding to the candidate cluster is lower than or equal to the preset threshold, a new candidate cluster is generated based on the target grids adjacent to the candidate cluster, and the process returns to the step of: determining the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster;

[0155] When the grid density corresponding to the candidate cluster is higher than a preset threshold, the candidate cluster is determined as a clustering cluster.

[0156] Optionally, the clustering module 740 is further specifically configured to:

[0157] Determine the target grids adjacent to the candidate cluster as a plurality of second grids;

[0158] A new candidate cluster is generated according to the candidate cluster and the plurality of second grids.

[0159] Optionally, the clustering module 740 is further specifically configured to:

[0160] When the grid density corresponding to the candidate cluster is higher than a preset threshold, acquiring a plurality of second grids adjacent to the candidate cluster;

[0161] The second grids whose grid areas are smaller than the preset area among the plurality of second grids are merged into the cluster.

[0162] To solve the above technical problems, the present application also provides a computer device. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.

[0163] The computer device 8 includes a memory 81, a processor 82, and a network interface 83 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 8 with components 81-83, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0164] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0165] The memory 81 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 81 can be an internal storage unit of the computer device 8, such as a hard disk or memory of the computer device 8. In other embodiments, the memory 81 can also be an external storage device of the computer device 8, such as a plug-in hard disk equipped on the computer device 8, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 81 can also include both the internal storage unit of the computer device 8 and its external storage device. In this embodiment, the memory 81 is generally used to store the operating system and various application software installed on the computer device 8, such as the program code of the grid clustering method, etc. In addition, the memory 81 can also be used to temporarily store various types of data that have been output or are to be output.

[0166] The processor 82 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 82 is generally used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is used to run the program code stored in the memory 81 or process data, such as running the program code of the grid clustering method.

[0167] The network interface 83 may include a wireless network interface or a wired network interface. The network interface 83 is generally used to establish a communication connection between the computer device 8 and other electronic devices.

[0168] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores the grid clustering program, and the grid clustering program can be executed by at least one processor so that the at least one processor performs the steps of the grid clustering method as described above.

[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware online platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0170] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0171] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A grid clustering method, characterized in that: The method comprises: Dividing the target area represented by the target image into grids layer by layer according to the resolutions corresponding to the target image, to obtain N target grids corresponding to the target area; the target grids are hexagonal grids, and N is a positive integer greater than 1; Count the grid densities corresponding to each target grid to obtain N grid densities; Sorting the N target grids in descending order of corresponding grid densities to form a grid sequence; According to the order of the N target grids in the grid sequence, the N target grids are clustered according to the grid density corresponding to each target grid to obtain M clusters, where M is a positive integer greater than 1 and less than N.

2. The method according to claim 1, characterized in that The step of dividing the target area represented by the target image into grids layer by layer according to the resolutions corresponding to the target image to obtain N target grids corresponding to the target area includes: Obtaining each resolution corresponding to the target image; According to the order of the resolutions from low to high, the target area represented by the target image is meshed layer by layer until the target area is meshed with a preset resolution, and then the meshing of the target area is stopped; The grids obtained by dividing the target area into grids with a preset resolution are determined as N target grids corresponding to the target area.

3. The method according to claim 1, characterized in that After dividing the target area represented by the target image into grids layer by layer according to the resolutions corresponding to the target image to obtain N target grids corresponding to the target area, the method further includes: Assign a unique identifier to each target grid; After counting the grid densities corresponding to each target grid to obtain N grid densities, the method further includes: Create a density lookup table; Establishing a mapping relationship between a grid density corresponding to each target grid and a unique identifier corresponding to each target grid; The mapping relationship is stored in the density lookup table.

4. The method according to claim 1, characterized in that: The N target grids are clustered according to the order of the N target grids in the grid sequence and the grid density corresponding to each target grid to obtain M clusters, including: Determine the target grid that is ranked first in the grid sequence as the first grid; Generate a cluster according to the grid density corresponding to the first grid and the grid density corresponding to the plurality of second grids; the plurality of second grids are associated with the first grid, and the first grid is located at the center of the grid formed by the cluster; Deleting the first grid and the plurality of second grids from the grid sequence; Return step: determine the target grid that is first sorted in the grid sequence as the first grid, until the first grid is the last grid in the grid sequence.

5. The method according to claim 4, characterized in that The step of generating a cluster according to the grid density corresponding to the first grid and the grid densities corresponding to the plurality of second grids comprises: determining the first grid and a plurality of second grids adjacent to the first grid as candidate clusters; Determine the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster; When the grid density corresponding to the candidate cluster is lower than or equal to the preset threshold, a new candidate cluster is generated based on the target grids adjacent to the candidate cluster, and the process returns to the step of: determining the sum of the grid densities corresponding to the target grids included in the candidate cluster as the grid density corresponding to the candidate cluster; When the grid density corresponding to the candidate cluster is higher than a preset threshold, the candidate cluster is determined as a clustering cluster.

6. The method according to claim 5, characterized in that The generating a new candidate cluster based on the target grids adjacent to the candidate cluster comprises: Determine the target grids adjacent to the candidate cluster as a plurality of second grids; A new candidate cluster is generated according to the candidate cluster and the plurality of second grids.

7. The method according to claim 5, characterized in that When the grid density corresponding to the candidate cluster is higher than a preset threshold, determining the candidate cluster as a cluster cluster includes: When the grid density corresponding to the candidate cluster is higher than a preset threshold, acquiring a plurality of second grids adjacent to the candidate cluster; The second grids whose grid areas are smaller than the preset area among the plurality of second grids are merged into the cluster.

8. A grid clustering device, characterized in that: include: A division module, used for performing grid division layer by layer on a target area represented by the target image according to each resolution corresponding to the target image, to obtain N target grids corresponding to the target area; The target grid is a hexagonal grid, and N is a positive integer greater than 1; A statistical module is used to count the grid density corresponding to each target grid to obtain N grid densities; A sorting module, used for sorting the N target grids in descending order of corresponding grid density to form a grid sequence; The clustering module is used to cluster the N target grids in the grid sequence according to the grid density corresponding to each target grid, so as to obtain M clusters, where M is a positive integer greater than 1 and less than N.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the grid clustering method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the grid clustering method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • OD data drawing method

    CN120339452A

  • A method for rendering od data

    CN120339452B

  • Image feature point clustering method and device, storage medium and computer equipment

    CN121582619A