Geohash-based spatial data processing method, device and electronic device

Through the Geohash-based spatial data processing method, spatial data objects are hierarchically divided and compared, which solves the problem of high computational complexity in large-scale spatial data processing, and achieves more efficient computing performance and resource utilization.

CN114691691BActive Publication Date: 2025-05-13HANGZHOU DT DREAM TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210336552.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-05-13
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

When processing large amounts of spatial data, the computational complexity is high, resulting in poor computing performance. Especially when comparing the positional relationship between spatial data objects, there are problems of waste of resources and inefficiency.

Method used

The spatial data processing method based on Geohash is adopted to divide the spatial data objects at different levels through the preset Geohash length range, obtain the target Geohash grid, and compare the spatial data objects according to these grids to determine their spatial position relationship.

Benefits of technology

Reduce resource waste caused by invalid comparison, improve the effectiveness of spatial data comparison, optimize computing performance, and improve overall computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114691691B_ABST
    Figure CN114691691B_ABST
Patent Text Reader

Abstract

The present application discloses a spatial data processing method, device and electronic device based on Geohash, which relates to the field of big data, and specifically to the field of geographic data information. The method includes: obtaining multiple spatial data objects to be processed; dividing each spatial data object into different levels according to a preset Geohash length range, and obtaining at least one target Geohash grid after the division process; comparing multiple spatial data objects according to at least one target Geohash grid; and determining the spatial position relationship between the spatial objects corresponding to each of the multiple spatial data objects according to the comparison result. This solution can optimize the computing performance in the spatial data processing process and improve the overall computing efficiency by reducing the waste of resources caused by invalid comparison of spatial data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data, specifically to the field of geographic data information, and in particular to a spatial data processing method, device and electronic device based on Geohash. Background Art

[0002] Spatial data is a special type of data. It refers to all data with spatial coordinates, such as architectural design drawings, mechanical design drawings and various maps, which are represented in digital form acceptable to computers to indicate the shape, size, location and distribution characteristics of spatial objects. Spatial data has been widely used in various industries and sectors of society, such as urban planning, transportation, banking, aerospace, etc. With the development of science and society, people have become more and more aware of the importance of spatial data for the development of social economy and the improvement of people's living standards, which has also accelerated the pace of people's acquisition and application of spatial data.

[0003] In the application scenario of map spatial data, it is necessary to first manage the map spatial data and determine the legitimacy of the spatial data by comparing the positional relationships between the spatial data, such as whether there is an inclusion relationship between two roads. However, when the amount of spatial data involved in the calculation is large, since the relationship comparison calculation is a pairwise calculation of the spatial data, the calculation complexity is large and the calculation performance is poor. Summary of the invention

[0004] The present application provides a spatial data processing method, device and electronic device based on Geohash.

[0005] According to a first aspect of the present application, a spatial data processing method based on geocoding Geohash is provided, comprising:

[0006] Acquire multiple spatial data objects to be processed;

[0007] According to a preset Geohash length range, each of the spatial data objects is segmented at different levels to obtain at least one target Geohash grid after segmentation;

[0008] comparing the plurality of spatial data objects according to the at least one target Geohash grid;

[0009] The spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects is determined according to the comparison result.

[0010] In some embodiments of the present application, the Geohash length range includes multiple Geohash lengths; and the step of segmenting each of the spatial data objects at different levels according to the preset Geohash length range to obtain at least one target Geohash grid after segmentation includes:

[0011] According to the ascending order of the plurality of Geohash lengths, each of the spatial data objects is hierarchically segmented to obtain at least one target Geohash grid after segmentation.

[0012] As an implementation manner, the step of hierarchically segmenting each of the spatial data objects in the ascending order of the plurality of Geohash lengths to obtain at least one target Geohash grid after segmentation includes:

[0013] For each of the spatial data objects, segment the spatial data object according to the minimum value among the multiple Geohash lengths;

[0014] Obtaining a first Geohash grid corresponding to the spatial data object;

[0015] Determine, according to the coding of the spatial data object and the first Geohash grid, the area ratio of the spatial object corresponding to the spatial object falling into the first Geohash grid;

[0016] According to the area ratio, determining a first Geohash grid to be segmented in the first Geohash grid;

[0017] According to other lengths among the plurality of Geohash lengths, the first Geohash grid to be segmented is segmented, and according to the segmentation result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid, a second Geohash grid corresponding to the spatial data object is determined;

[0018] The second Geohash grids corresponding to the plurality of spatial data objects are determined as the at least one target Geohash grid.

[0019] In some embodiments of the present application, determining a first Geohash grid to be segmented in the first Geohash grid according to the area ratio includes:

[0020] The area ratio is compared with a preset threshold, and a first Geohash grid corresponding to an area ratio less than the threshold is determined as a first Geohash grid to be segmented.

[0021] In some embodiments of the present application, the segmenting of the first Geohash grid to be segmented according to other lengths among the multiple Geohash lengths includes:

[0022] Determine a first minimum value from the other lengths, use the first minimum value as a new minimum value, and use part of the spatial data objects falling into the first Geohash grid to be segmented as new spatial data objects;

[0023] Return to executing the step of segmenting the spatial data object according to the minimum value among the multiple Geohash lengths;

[0024] Until the Geohash length used for the current segmentation is the maximum value among the multiple Geohash lengths, or the area ratio of the spatial data object falling into the current first Geohash grid is greater than or equal to the threshold.

[0025] In some embodiments of the present application, the litigation compares the plurality of spatial data objects according to the at least one target Geohash grid, including:

[0026] For each target Geohash grid in the at least one target Geohash grid, determining whether there is a first target Geohash grid in the at least one target Geohash grid whose accuracy is less than that of the target Geohash grid, and the target Geohash grid falls into the first target Geohash grid;

[0027] In response to the presence of the first target Geohash grid in the at least one target Geohash grid, determining target spatial data objects corresponding to the target Geohash grid and the first target Geohash grid respectively;

[0028] In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining a target spatial data object corresponding to the target Geohash grid;

[0029] The target spatial data objects are compared pairwise.

[0030] According to a second aspect of the present application, a spatial data processing device based on Geohash is provided, comprising:

[0031] A first acquisition module, used for acquiring a plurality of spatial data objects to be processed;

[0032] A second acquisition module is used to segment each of the spatial data objects at different levels according to a preset Geohash length range, and obtain at least one target Geohash grid after segmentation;

[0033] a comparison module, configured to compare the plurality of spatial data objects according to the at least one target Geohash grid;

[0034] The determination module is used to determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison result.

[0035] In some embodiments of the present application, the Geohash length range includes multiple Geohash lengths; and the second acquisition module is specifically used to:

[0036] According to the ascending order of the plurality of Geohash lengths, each of the spatial data objects is hierarchically segmented to obtain at least one target Geohash grid after segmentation.

[0037] As an implementation manner, the second acquisition module includes:

[0038] A first segmentation unit is used to segment each of the spatial data objects according to a minimum value among the multiple Geohash lengths;

[0039] An acquisition unit, used for acquiring a first Geohash grid corresponding to each of the spatial data objects;

[0040] A first determining unit, configured to determine, according to the coding of each of the spatial data objects and the first Geohash grid, a proportion of an area of ​​a spatial object corresponding to the spatial data object that falls within the first Geohash grid;

[0041] A second determining unit, configured to determine a first Geohash grid to be segmented in the first Geohash grid according to the area proportion;

[0042] A second segmentation unit is used to segment the first Geohash grid to be segmented according to other lengths among the multiple Geohash lengths;

[0043] A third determining unit is used to determine a second Geohash grid corresponding to the spatial data object according to a segmentation processing result of the first Geohash grid to be segmented and an unsegmented grid in the first Geohash grid;

[0044] The fourth determining unit is used to determine the second Geohash grid corresponding to each of the plurality of spatial data objects as the at least one target Geohash grid.

[0045] In some embodiments of the present application, the second determining unit is specifically configured to:

[0046] The area ratio is compared with a preset threshold, and a first Geohash grid corresponding to an area ratio less than the threshold is determined as a first Geohash grid to be segmented.

[0047] In some embodiments of the present application, the second segmentation unit is specifically used for:

[0048] Determine a first minimum value from the other lengths, use the first minimum value as a new minimum value, and use part of the spatial data objects falling into the first Geohash grid to be segmented as new spatial data objects;

[0049] Wherein, the first segmentation unit is further used to segment the new spatial data object according to the new minimum value;

[0050] Until the Geohash length used for the current segmentation is the maximum value among the multiple Geohash lengths, or the area ratio of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.

[0051] In some embodiments of the present application, the comparison module is specifically used to:

[0052] For each target Geohash grid in the at least one target Geohash grid, determining whether there is a first target Geohash grid in the at least one target Geohash grid whose accuracy is less than that of the target Geohash grid, and the target Geohash grid falls into the first target Geohash grid;

[0053] In response to the presence of the first target Geohash grid in the at least one target Geohash grid, determining target spatial data objects corresponding to the target Geohash grid and the first target Geohash grid respectively;

[0054] In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining a target spatial data object corresponding to the target Geohash grid;

[0055] The target spatial data objects are compared pairwise.

[0056] According to a third aspect of the present application, an electronic device is provided, including:

[0057] at least one processor; and

[0058] a memory communicatively connected to the at least one processor; wherein,

[0059] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect above.

[0060] According to a fourth aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect above.

[0061] According to the technical solution of the present application, based on the preset Geohash length range, the multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and the multiple spatial data objects are compared according to the at least one target Geohash grid to determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects. This solution can reduce the waste of resources caused by invalid comparison of spatial data, improve the effectiveness of pairwise comparison of spatial data, thereby optimizing the computing performance in the spatial data processing process and improving the overall computing efficiency.

[0062] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0064] Figure 1 A flowchart of a spatial data processing method based on Geohash provided in an embodiment of the present application;

[0065] Figure 2 This is a schematic diagram of the principle of Geohash encoding in an embodiment of the present application;

[0066] Figure 3 This is an example diagram of comparing spatial data according to the target Geohash grid in an embodiment of the present application;

[0067] Figure 4 A flowchart of another spatial data processing method based on Geohash provided in an embodiment of the present application;

[0068] Figure 5 A flowchart of another spatial data processing method based on Geohash provided in an embodiment of the present application;

[0069] Figure 6a , Figure 6b , Figure 6c , Figure 6d They are respectively example diagrams of the first Geohash grid corresponding to the segmentation processing of the spatial data object at different levels in the embodiments of the present application; Figure 6e This is an example diagram of the target Geohash grid corresponding to all spatial data objects after segmentation processing in the embodiment of the present application;

[0070] Figure 7 A structural block diagram of a spatial data processing device based on Geohash provided in an embodiment of the present application;

[0071] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present application is shown. DETAILED DESCRIPTION

[0072] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0073] It should be noted that spatial data is a special type of data. It refers to all data with spatial coordinates, such as architectural design drawings, mechanical design drawings and various maps, which are represented in digital form acceptable to computers to indicate the shape, size, location and distribution characteristics of spatial objects. Spatial data has been widely used in various industries and sectors of society, such as urban planning, transportation, banking, aerospace, etc. With the development of science and society, people have become more and more aware of the importance of spatial data for the development of social economy and the improvement of people's living standards, which has also accelerated the pace of people's acquisition and application of spatial data.

[0074] In the application scenario of map spatial data, it is necessary to first manage the map spatial data and determine the legitimacy of the spatial data by comparing the positional relationships between the spatial data, such as whether there is an inclusion relationship between two roads. However, when the amount of spatial data involved in the calculation is large, since the relationship comparison calculation is a pairwise calculation of the spatial data, the calculation complexity is large and the calculation performance is poor.

[0075] In order to solve the above problems, the present application provides a spatial data processing method, device and electronic device based on Geohash.

[0076] Figure 1 The flowchart of a spatial data processing method based on Geohash provided in the embodiment of the present application. It should be noted that the spatial data processing method based on Geohash in the embodiment of the present application can be applied to the spatial data processing device based on Geohash in the embodiment of the present application, and the device can be applied to electronic devices. Figure 1 As shown, the method may include the following steps:

[0077] Step 101: Acquire multiple spatial data objects to be processed.

[0078] In some embodiments of the present application, the multiple spatial data objects to be processed refer to the spatial data to be verified for the positional relationship between the spatial objects corresponding to them in the scenario of geospatial data management, such as the coordinate information of the spatial objects. Each spatial data object is the spatial data of the spatial object to which it corresponds. For example, if the spatial object corresponding to the spatial data object is a park, then the spatial data object is the spatial data of the park; if the spatial object corresponding to the spatial data object is a lake, then the spatial data object is the spatial data of the lake.

[0079] In some embodiments of the present application, a user can upload files corresponding to multiple spatial data objects to be processed based on an interactive interface for data upload through a terminal device with a spatial data object upload function, and obtain multiple spatial data objects to be processed by receiving data information submitted by the front end. In addition, the spatial data acquisition end and the spatial data verification end can also be connected, and the data acquisition device or data acquisition personnel upload the collected spatial data of each object to the acquisition terminal, and the spatial data verification end obtains multiple spatial data objects to be processed by receiving the spatial data updated by the acquisition end.

[0080] Step 102: According to a preset Geohash length range, each spatial data object is segmented at different levels to obtain at least one target Geohash grid after segmentation.

[0081] It should be noted that geocoding is an address encoding method that can encode two-dimensional latitude and longitude data into a one-dimensional string. Each string represents a specific rectangle, and all coordinates within the rectangle share this string. The longer the string, the higher the accuracy, and the smaller the corresponding rectangle. Figure 2As shown, when encoding a geographic coordinate, according to the initial interval range of latitude [-90,90] and longitude [-180,180], calculate whether the target longitude and latitude fall in the left interval or the right interval. If it falls in the left interval, it takes 0, and if it falls in the right interval, it takes 1. Then, continue to search in half of the interval obtained in the previous step according to this method to obtain the next binary code. When the encoding length reaches the progress requirement of the business, according to the rule of "longitude in even digits and latitude in odd digits", the obtained binary codes are interspersed and combined to obtain a new binary string. Finally, according to the base32 comparison table, the binary string is translated into a string, that is, the GeoHash string corresponding to the geographic coordinate is obtained.

[0082] It can be understood that the larger the Geohash length, the higher the accuracy, and the corresponding computational overhead. Therefore, in order to balance accuracy and computational overhead, the corresponding Geohash length range can be preset. Usually, the length range can be a continuous length value, including multiple Geohash lengths, such as a Geohash length of 4 to 7. In addition, the preset Geohash length range can be set by the user through the interactive page of the terminal device, or it can be set directly in the program, and the Geohash length range can be fixed after setting, or it can be a range value adjusted according to the actual application scenario, and this application does not limit this.

[0083] In the embodiment of the present application, each spatial data object is segmented at different levels according to a preset Geohash length range, which means that each spatial data object is segmented according to different Geohash lengths. The target Geohash grid refers to a Geohash grid that can at least partially overlap with at least one spatial data object after all spatial data objects are segmented, that is, the Geohash grid into which the spatial object corresponding to the spatial data object falls, and the number of target Geohash grids is greater than or equal to 1.

[0084] As an example, for each spatial data object, the spatial data object can be segmented according to the minimum Geohash length in a preset Geohash length range, and based on the segmentation result, part of the Geohash grids therein can be further segmented according to the next minimum Geohash length, and so on, until the Geohash length reaches the maximum value in the preset range, or the Geohash grids obtained after segmentation all meet the preset conditions, then the segmentation is completed, and the Geohash grid obtained by the segmentation of each spatial data object is used as at least one target Geohash grid.

[0085] Step 103: compare the plurality of spatial data objects according to at least one target Geohash grid.

[0086] It can be understood that in order to determine the spatial position relationship between the spatial objects corresponding to each of the multiple spatial data objects, it is necessary to compare the multiple spatial data objects. If two spatial data objects correspond to different target Geohash grids, it means that the spatial positions of the spatial objects corresponding to the two spatial data objects are neither an intersection relationship nor a containment relationship. If two spatial data objects correspond to the same target Geohash grid, it means that the spatial position relationship of the spatial objects corresponding to the two spatial data objects may be an intersection relationship or a containment relationship. In an embodiment of the present application, the target Geohash grid can be used as an index, and the spatial data object corresponding to each target Geohash grid can be determined according to the target Geohash grid, and multiple spatial data objects can be compared according to the spatial data object corresponding to each target Geohash grid, thereby reducing invalid comparisons of spatial data and optimizing computing performance.

[0087] In some embodiments of the present application, for each target Geohash grid in at least one target Geohash grid, it can be determined whether there is a first target Geohash grid in the at least one target Geohash grid whose accuracy is less than that of the target Geohash grid, and the target Geohash grid falls into the first target Geohash grid; in response to the existence of the first target Geohash grid in at least one target Geohash grid, the target spatial data objects corresponding to the target Geohash grid and the first target Geohash grid are determined; in response to the absence of the first target Geohash grid in at least one target Geohash grid, the target spatial data objects corresponding to the target Geohash grid are determined; and the target spatial data objects are compared pairwise.

[0088] It can be understood that if the accuracy of target grid 1 in at least one target Geohash grid is higher than that of target grid 2, and target grid 2 falls in target grid 1, where target grid 2 corresponds to spatial data object A and spatial data object B, and target grid 1 corresponds to spatial data object C, then it means that target grid 1 also at least partially covers spatial data object A and spatial data object B, so when comparing the spatial data objects corresponding to target grid 2, it is also necessary to compare it with the spatial data objects corresponding to target grid 1, that is, compare spatial data object A with spatial data object B, spatial data object A with spatial data object C, and spatial data object B with spatial data object C respectively.

[0089] For example, it is possible to determine whether there is a first target Geohash grid with less accuracy than the target Geohash grid in at least one target Geohash grid based on the encoding of each target Geohash grid. If the encoding length n of the target Geohash grid 1 is less than the encoding length m of the target Geohash grid, and the encoding of the target Geohash grid 1 is completely consistent with the first n bits of the encoding of the target Geohash grid, then it means that the target Geohash grid 1 is the above-mentioned first target Geohash grid.

[0090] like Figure 3 As shown, if there are 5 spatial data objects to be processed, namely, the spatial data corresponding to house A, the spatial data corresponding to house B, the spatial data corresponding to house C, the spatial data corresponding to the park, and the spatial data corresponding to the lake, if the spatial data objects are compared in pairs, it takes 10 times to determine the spatial position relationship of each spatial object. However, through the method in the embodiment of the present application, 6 target Geohash grids can be obtained, wherein grid 1 corresponds to the spatial data of the park, grid 2 corresponds to the spatial data of the park and house B, grid 3 corresponds to the spatial data of the park and the lake, grid 4 only corresponds to the spatial data of the park, grid 5 only corresponds to the spatial data of house C, and grid 6 only corresponds to the spatial data of house A; wherein, the accuracy of grid 1 is less than that of grid 6 and grid 6 falls into grid 1, so the spatial data of the park and house A can be compared based on grid 6, and the spatial data of the park and house B, and the spatial data of the park and the lake can be compared based on grid 2 and grid 3 respectively. The spatial position relationship of each spatial object can be determined by comparing 3 times, so the method in the embodiment of the present application can filter out invalid spatial data comparisons, effectively reduce the amount of calculation for spatial data processing, and improve calculation efficiency.

[0091] Step 104: Determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result.

[0092] In some embodiments of the present application, the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects refers to the spatial position relationship between the spatial objects of the multiple spatial data objects, where the spatial position relationship may include inclusion, intersection, etc.

[0093] As an example, after comparing multiple spatial data objects, if all of the spatial data objects A are contained in the spatial data objects B, then it means that the spatial position relationship between the spatial objects A and B corresponding to the two is that the spatial object A is contained in the spatial object B; if part of the spatial data of the spatial data object A is contained in the spatial data object B, then it means that the spatial position relationship between the spatial objects A and B corresponding to the two is that the spatial object A intersects with the spatial object B.

[0094] According to the Geohash-based spatial data processing method in the embodiment of the present application, based on the preset Geohash length range, the multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and the multiple spatial data objects are compared according to the at least one target Geohash grid to determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects. This solution can reduce the waste of resources caused by invalid comparison of spatial data, improve the effectiveness of pairwise comparison of spatial data, thereby optimizing the computing performance in the spatial data processing process and improving the overall computing efficiency.

[0095] Next, the spatial data object segmentation process will be introduced in detail.

[0096] Figure 4 Flow chart of another spatial data processing method based on Geohash provided in the embodiment of the present application. Figure 4 As shown, the method may include:

[0097] Step 401: Acquire multiple spatial data objects to be processed.

[0098] Step 402 , hierarchically segment each spatial data object in the order of multiple Geohash lengths from small to large, and obtain at least one target Geohash grid after segmentation.

[0099] In an embodiment of the present application, the Geohash length range may include multiple Geohash lengths. Since the longer the Geohash length, the higher the accuracy and the smaller the corresponding rectangular range, the spatial data object may be hierarchically segmented according to the order of the multiple Geohash lengths from small to large. The hierarchical segmentation may be implemented as follows: for each spatial data object, the spatial data object is first segmented according to the minimum value among the multiple Geohash length values, i.e., the first-layer segmentation, to obtain the first Geohash grid corresponding to the spatial data object; then, the second-layer segmentation is performed on part of the Geohash grid in the first Geohash grid according to the minimum value of the remaining length among the multiple Geohash lengths, to obtain the second Geohash grid corresponding to the spatial data object; then, the third-layer segmentation is performed on part of the Geohash grid in the second Geohash grid according to the minimum value of the remaining length among the multiple Geohash lengths, until the Geohash length of the current segmentation reaches the maximum value among the multiple Geohash lengths, or the segmentation of the spatial data object is completed when the preset conditions are met.

[0100] As an implementation method, the implementation method of step 402 in the embodiment of the present application may include the following steps:

[0101] Step 402-1: for each spatial data object, the spatial data object is segmented according to the minimum value among multiple Geohash lengths.

[0102] That is to say, for each spatial data object, it is segmented according to the minimum value among multiple Geohash lengths. Since the longer the Geohash length, the higher the accuracy and the smaller the corresponding rectangular range, the spatial data object can be segmented according to the minimum value among multiple Geohash lengths.

[0103] Step 402-2, obtaining the first Geohash grid corresponding to the spatial data object.

[0104] In the embodiment of the present application, the first Geohash grid corresponding to the spatial data object refers to a Geohash grid that can at least partially overlap with the spatial data object in the grid after the spatial data object is segmented according to the minimum value of multiple Geohash lengths. As an example, a library function in the relevant technology can be used to obtain the first Geohash grid corresponding to the spatial data object according to the spatial data object and the minimum value of multiple Geohash lengths.

[0105] Step 402-3: Determine the area ratio of the spatial object corresponding to the spatial data object that falls into the first Geohash grid according to the coding of the spatial data object and the first Geohash grid.

[0106] In the embodiment of the present application, the area ratio of the spatial object corresponding to the spatial data object falling into the first Geohash grid refers to the ratio of the area of ​​the spatial object corresponding to the spatial data object falling into the first Geohash grid corresponding to the spatial data object to the area of ​​the first Geohash grid. For example, if spatial data object A corresponds to spatial object A, and the first Geohash grids at least partially overlapping with spatial data object A are grid 1 and grid 3, then the ratio of the area of ​​spatial object A falling in grid 1 to the area of ​​grid 1, and the ratio of the area of ​​spatial object A falling in grid 3 to the area of ​​grid 3 are both the area ratios of spatial object A falling into the first Geohash grid corresponding to spatial data object A.

[0107] It can be understood that each Geohash grid corresponds to its own string code, and the longitude and latitude range of the Geohash grid and the area of ​​the Geohash grid can be determined based on the string code of a Geohash grid. In an embodiment of the present application, according to the code of each spatial data object and the first Geohash grid, the implementation method of determining the area ratio of the spatial object corresponding to the spatial data object falling into the first Geohash grid may include: determining the longitude and latitude range of the first Geohash grid corresponding to the spatial data object according to the code of the first Geohash grid corresponding to the spatial data object; calculating the area of ​​the spatial object corresponding to the spatial data object falling into the first Geohash grid according to the spatial data object and the longitude and latitude range of the first Geohash grid; using the ratio of the area of ​​the spatial object falling into the first Geohash grid to the area of ​​the first Geohash grid as the area ratio of the spatial object corresponding to the spatial data object falling into the first Geohash grid.

[0108] It should be noted that, since the number of first Geohash grids corresponding to each spatial data object is greater than or equal to 1, if the number of first Geohash grids corresponding to a spatial data object is greater than 1, it is necessary to determine the area ratio of each first Geohash grid corresponding to the spatial data object corresponding to the spatial data object.

[0109] Step 402-4: determine a first Geohash grid to be segmented in the first Geohash grid according to the area ratio.

[0110] In the embodiment of the present application, it can be determined whether the corresponding first Geohash grid needs to be split again according to the area ratio, wherein the first Geohash grid to be split refers to the first Geohash grid that needs to be split according to higher precision. As an example, the obtained area ratio can be compared with a preset threshold, and the first Geohash grid corresponding to the area ratio less than the threshold is determined as the first Geohash grid to be split.

[0111] Step 402-5, split the first Geohash grid to be split according to other lengths among the multiple Geohash lengths, and determine the second Geohash grid corresponding to the spatial data object based on the splitting result of the first Geohash grid to be split and the unsplit grids in the first Geohash grid.

[0112] In the embodiment of the present application, other lengths among the multiple Geohash lengths refer to the remaining Geohash lengths after removing the minimum value among the multiple Geohash lengths included in the Geohash length range.

[0113] As an example, the first Geohash grid to be split can be split according to the minimum value among other lengths to obtain the first Geohash grid after splitting, and the second Geohash grid to be split can be determined according to the area ratio of the spatial object corresponding to the spatial data object falling into the first Geohash grid after splitting; the second Geohash grid to be split can be further split according to the second minimum Geohash length among other lengths, and so on, until the Geohash length of the current split is the maximum value in the Geohash length range, or the area ratio obtained after splitting meets the preset conditions, then the splitting is completed, and the obtained Geohash grid and the unsplit grids in the first Geohash grid are used as the second Geohash grid corresponding to the spatial data object.

[0114] Step 402-6: determine the second Geohash grids corresponding to the plurality of spatial data objects as at least one target Geohash grid.

[0115] That is, after each spatial data object is segmented, the second Geohash grid corresponding to each of the plurality of spatial data objects is used as at least one target Geohash grid.

[0116] Step 403: compare multiple spatial data objects according to at least one target Geohash grid.

[0117] Step 404: determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result.

[0118] According to the Geohash-based spatial data processing method provided in the embodiment of the present application, each spatial data object is segmented at different levels according to multiple Geohash lengths included in the preset Geohash length range, and at least one target Geohash grid after segmentation is obtained, that is, by establishing a hierarchical Geohash index, the performance of spatial data comparison is optimized. In addition, by first segmenting the spatial data object according to the minimum value of multiple Geohash lengths, and then determining the first grid to be segmented according to the area ratio of the spatial object corresponding to the spatial data object falling into the first Geohash grid, and further segmenting the first grid to be segmented according to other lengths, different levels of Geohash indexes can be established for each spatial data object, thereby effectively improving the effectiveness of spatial data comparison and the efficiency of determining spatial position relationships.

[0119] Next, the segmentation process of the first Geohash grid to be segmented will be introduced in detail.

[0120] Figure 5 A flowchart of another method for processing spatial data based on Geohash provided in an embodiment of the present application. Figure 5 As shown, the method may include:

[0121] Step 501: Acquire multiple spatial data objects to be processed.

[0122] Step 502: for each spatial data object, segment the spatial data object according to the minimum value of multiple Geohash lengths included in a preset Geohash length range.

[0123] It should be noted that when this step is executed for the first time, the minimum value here is the minimum value of multiple Geohash lengths included in the Geohash length range, and when this step is executed cyclically, the minimum value here is the new minimum value determined by step 506 for the latest time. When this step is executed for the first time, the spatial data object is each spatial data object in the multiple spatial data objects to be processed obtained in step 501, and when this step is executed cyclically, the spatial data object is the new spatial data object determined by step 506 for the latest time.

[0124] Step 503: Obtain the first Geohash grid corresponding to the spatial data object.

[0125] In the embodiment of the present application, when the step is executed for the first time, the first Geohash grid corresponding to the spatial data object refers to a Geohash grid that can at least partially overlap with the spatial data object in the Geohash grids obtained by segmenting the spatial data object in step 502. When the step is executed again, the first Geohash grid corresponding to the spatial data object refers to a new first Geohash grid that can at least partially overlap with the new spatial data object in the new Geohash grid obtained by segmenting the new spatial data object in the latest step 502.

[0126] In the embodiment of the present application, the implementation method of step 503 is the same as Figure 4 The implementation method of step 402-2 in is the same and will not be repeated here.

[0127] Step 504: Determine the area ratio of the spatial object corresponding to the spatial data object that falls into the first Geohash grid according to the coding of the spatial data object and the first Geohash grid.

[0128] It should be noted that when this step is executed for the first time, the first Geohash grid is the first Geohash grid obtained when step 503 is executed for the first time, and the area percentage is also calculated according to the first Geohash grid. When this step is executed again, the first Geohash grid is the new first Geohash grid obtained when step 503 is executed for the latest time, and the area percentage is calculated according to the new first Geohash grid.

[0129] In the embodiment of the present application, the implementation method of step 504 is the same as Figure 4 The implementation method of step 402-3 in is the same and will not be repeated here.

[0130] Step 505: Determine a first Geohash grid to be segmented in the first Geohash grid according to the area ratio.

[0131] It should be noted that when step 505 is executed for the first time, the step is to determine the first Geohash grid to be segmented in the first Geohash grid obtained when step 503 is first executed based on the area ratio obtained when step 504 is first executed. When step 505 is executed again, the step is to determine the new first Geohash grid to be segmented in the new first Geohash grid obtained when step 503 is most recently executed based on the new area ratio obtained when step 504 is most recently first executed.

[0132] In the embodiment of the present application, the implementation method of step 505 is the same as Figure 4The implementation method of step 402-4 in is the same and will not be repeated here.

[0133] Step 506: determine a first minimum value from other lengths, use the first minimum value as a new minimum value, and use part of the spatial data objects that fall into the first Geohash grid to be segmented as new spatial data objects.

[0134] In an embodiment of the present application, other lengths refer to the remaining Geohash lengths after removing the Geohash lengths that have been used in the segmentation process from multiple Geohash lengths. The first minimum value refers to the minimum value among the other lengths. Since the spatial data object partially overlaps with the first Geohash grid to be segmented, the portion of the spatial data object that overlaps with the first Geohash grid to be segmented is the portion of the spatial data object that falls into the first Geohash grid to be segmented. Among them, the portion of the spatial data object that falls into the first Geohash grid to be segmented can be obtained based on the existing library function according to the encoding of the spatial data object and the first Geohash grid to be segmented.

[0135] In an embodiment of the present application, after executing step 506, the process returns to executing step 502 to implement a cyclic segmentation process of the first Geohash grid to be segmented, until the Geohash length used for the current segmentation is the maximum value among multiple Geohash lengths, or the area ratio of the spatial object falling into the current first Geohash grid is greater than or equal to a threshold, and then step 507 is executed.

[0136] Step 507: Determine a second Geohash grid corresponding to the spatial data object according to the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid.

[0137] In the embodiment of the present application, the segmentation processing result of the first Geohash grid to be segmented includes both the segmentation processing result of the first Geohash grid to be segmented obtained by first executing step 505, and the segmentation processing result of the new first Geohash grid to be segmented obtained by executing step 505 in a loop. The unsegmented grids in the first Geohash grid include both the unsegmented grids in the first Geohash grid obtained by first executing step 503, and the unsegmented grids in the new first Geohash grid obtained by cyclically executing step 503.

[0138] Step 508: Determine the second Geohash grid corresponding to each of the plurality of spatial data objects as at least one target Geohash grid.

[0139] Step 509: compare the plurality of spatial data objects according to at least one target Geohash grid.

[0140] Step 510: Determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result.

[0141] In order to facilitate the understanding of the spatial data processing method based on Geohash in the embodiment of the present application, the implementation process of the method will be described in the form of an example. If the spatial data objects to be processed are the spatial data of house A, the spatial data of house B, the spatial data of house C, the spatial data of the park, and the spatial data of the lake, and the preset Geohash length range includes 4, 5, 6, and 7, the implementation process of the method may include the following process:

[0142] (1) For the park's spatial data, the spatial data object is segmented according to the Geohash length = 4. Figure 6a This is a schematic diagram of the first Geohash grid corresponding to the spatial data object after segmentation, where the first Geohash grids corresponding to the park are grid 1, grid 2, and grid 3; after calculation, the area ratio of the park falling into grid 1 and the area ratio of the park falling into grid 3 are both less than the threshold, while the area ratio of the park falling into grid 2 is greater than the threshold, which means that grid 1 and grid 3 are both the first Geohash grids to be segmented; the part of the spatial data object falling into grid 1 is taken as the new spatial data object, and the part of the spatial data object falling into grid 3 is taken as the new spatial data object

[0143] (2) For the two new spatial data objects determined in step (1), they are split according to the Geohash length = 5. Figure 6b This is a schematic diagram of the first Geohash grid corresponding to the spatial data of the park after this segmentation process, wherein grid 4 and grid 5 are new first Geohash grids; after calculation, the area ratio of the park falling into grid 4 and the area ratio of the park falling into grid 5 are still less than the threshold, which means that grid 4 and grid 5 are both new first Geohash grids to be segmented; some spatial data objects falling into grid 4 are taken as new spatial data objects, and some spatial data objects falling into grid 5 are also taken as new spatial data objects.

[0144] (3) For the two new spatial data objects determined in step (2), they are split according to the Geohash length = 6. Figure 6cThis is a schematic diagram of the first Geohash grid corresponding to the spatial data of the park after this segmentation process, wherein grid 6, grid 7, and grid 8 are all new first Geohash grids; after calculation, the area proportion of the park falling into grid 6 and the area proportion of the park falling into grid 7 are both greater than the threshold, while the area proportion of the park falling into grid 8 is less than the threshold, indicating that grid 8 is the new first Geohash grid to be segmented; some spatial data objects falling into grid 8 are taken as new spatial data objects.

[0145] (4) For the new spatial data object determined in step (3), split it according to the Geohash length = 7, Figure 6d This is a schematic diagram of the first Geohash grid corresponding to the spatial data of the park after this segmentation process, wherein grid 9 is the new first Geohash grid; after calculation, the area of ​​the park falling into grid 9 is still less than the threshold, and the Geohash length = 7 is already the maximum value in the preset Geohash length range, so the segmentation process is stopped. In other words, the second Geohash grids corresponding to the spatial data of the park obtained after the segmentation process are grid 2, grid 6, grid 7, and grid 9 respectively.

[0146] (5) Similarly, the spatial data of the lake, the spatial data of house A, the spatial data of house B, and the spatial data of house C are segmented, such as Figure 6e This is a schematic diagram of the target Geohash grids corresponding to all spatial data objects after segmentation is completed. The second Geohash grid corresponding to the spatial data of house A is grid 10, the second Geohash grid corresponding to the spatial data of house B is grid 7, the second Geohash grid corresponding to the spatial data of the lake is grid 2, and the second Geohash grid corresponding to the spatial data of house C is grid 11. Therefore, the target Geohash grids obtained are grid 2, grid 6, grid 7, grid 9, grid 10 and grid 11. Since grid 2 corresponds to the spatial data of the park and the lake, the spatial data of the park can be compared with the spatial data of the lake; since grid 6 only corresponds to the park, there is no comparison of the target spatial data objects; since grid 7 corresponds to the spatial data of house B and the park, the spatial data of the park can be compared with the spatial data of house B; since grid 9 only corresponds to the spatial data of the park and grid 11 only corresponds to the spatial data of house C, there is no comparison of the target spatial data objects; since the accuracy of grid 6 is less than that of grid 10, and grid 10 falls into grid 6, and grid 6 corresponds to the spatial data of the park and grid 10 corresponds to the spatial data of house A, the spatial data of the park can be compared with the spatial data of house A, so that the spatial position relationship between the spatial objects can be determined after only 3 comparisons.

[0147] According to the Geohash-based spatial data processing method provided in the embodiment of the present application, the spatial data object is segmented at different levels in a loop from small to large according to multiple Geohash lengths contained in a preset Geohash length range, and at least one target Geohash grid after the segmentation process is obtained, so as to establish different hierarchical Geohash indexes for each spatial data object, thereby effectively improving the effectiveness of spatial data comparison and the efficiency of determining spatial position relationships.

[0148] In order to implement the above embodiments, the present application provides a spatial data processing device based on Geohash.

[0149] Figure 7 This is a structural block diagram of a spatial data processing device based on Geohash provided in an embodiment of the present application. Figure 7 As shown, the device may include:

[0150] A first acquisition module 710 is used to acquire a plurality of spatial data objects to be processed;

[0151] The second acquisition module 720 is used to segment each spatial data object at different levels according to a preset Geohash length range, and obtain at least one target Geohash grid after segmentation;

[0152] A comparison module 730 for comparing a plurality of spatial data objects according to at least one target Geohash grid;

[0153] The determination module 740 is used to determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison result.

[0154] In some embodiments of the present application, the Geohash length range includes multiple Geohash lengths; the second acquisition module 720 is specifically used to:

[0155] Each spatial data object is hierarchically segmented in the ascending order of the lengths of the multiple Geohash, and at least one target Geohash grid after segmentation is obtained.

[0156] As an implementation manner, the second acquisition module 720 includes:

[0157] The first segmentation unit 721 is used to segment each spatial data object according to the minimum value of multiple Geohash lengths;

[0158] An acquisition unit 722 is used to acquire a first Geohash grid corresponding to the spatial data object;

[0159] A first determining unit 723 is used to determine the area ratio of the spatial object corresponding to the spatial data object falling into the first Geohash grid according to the coding of the spatial data object and the first Geohash grid;

[0160] A second determining unit 724 is used to determine a first Geohash grid to be segmented in the first Geohash grid according to the area ratio;

[0161] The second segmentation unit 725 is used to segment the first Geohash grid to be segmented according to other lengths among the multiple Geohash lengths;

[0162] A third determining unit 726 is used to determine a second Geohash grid corresponding to the spatial data object according to the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid;

[0163] The fourth determining unit 727 is configured to determine the second Geohash grids corresponding to the plurality of spatial data objects as at least one target Geohash grid.

[0164] In some embodiments of the present application, the second determining unit 724 is specifically configured to:

[0165] The area ratio is compared with a preset threshold, and the first Geohash grid corresponding to the area ratio less than the threshold is determined as the first Geohash grid to be segmented.

[0166] In some embodiments of the present application, the second segmentation unit 725 is specifically used for:

[0167] Determine a first minimum value from other lengths, take the first minimum value as a new minimum value, and take the spatial data corresponding to the portion of the spatial object that falls into the first Geohash grid to be segmented as a new spatial data object;

[0168] The first segmentation unit 721 is further used to segment the new spatial data object according to the new minimum value;

[0169] Until the Geohash length used for the current segmentation is the maximum value among multiple Geohash lengths, or the area ratio of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.

[0170] According to the Geohash-based spatial data processing device in the embodiment of the present application, based on the preset Geohash length range, the multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and the multiple spatial data objects are compared according to the at least one target Geohash grid to determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects. This solution can reduce the waste of resources caused by invalid comparison of spatial data, improve the effectiveness of pairwise comparison of spatial data, thereby optimizing the computing performance in the spatial data processing process and improving the overall computing efficiency.

[0171] Based on the embodiments of the present application, the present application also provides an electronic device, at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the aforementioned Geohash-based spatial data processing methods.

[0172] Based on the embodiments of the present application, the present application also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute any of the aforementioned Geohash-based spatial data processing methods provided according to the embodiments of the present application.

[0173] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0174] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0175] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0176] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a spatial data processing method based on Geohash. For example, in some embodiments, the spatial data processing method based on Geohash may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the spatial data processing method based on Geohash described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the Geohash-based spatial data processing method in any other appropriate manner (for example, by means of firmware).

[0177] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0178] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0179] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0180] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0181] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0182] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0183] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0184] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A spatial data processing method based on geocoding Geohash, characterized in that: include: Acquire multiple spatial data objects to be processed; According to a preset Geohash length range, the Geohash length range includes multiple Geohash lengths, and in the order of the multiple Geohash lengths from small to large, each of the spatial data objects is segmented at different levels to obtain at least one target Geohash grid after segmentation; comparing the plurality of spatial data objects according to the at least one target Geohash grid; Determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result; According to the order of the plurality of Geohash lengths from small to large, each of the spatial data objects is segmented at different levels to obtain at least one target Geohash grid after segmentation, including: For each of the spatial data objects, segment the spatial data object according to the minimum value among the multiple Geohash lengths; Obtaining a first Geohash grid corresponding to the spatial data object; Determine, according to the codes of the spatial data object and the first Geohash grid, the area ratio of the spatial object corresponding to the spatial data object falling into the first Geohash grid; According to the area ratio, determining a first Geohash grid to be segmented in the first Geohash grid; According to other lengths among the plurality of Geohash lengths, the first Geohash grid to be segmented is segmented, and according to the segmentation result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid, a second Geohash grid corresponding to the spatial data object is determined; The second Geohash grids corresponding to the plurality of spatial data objects are determined as the at least one target Geohash grid.

2. The method according to claim 1, characterized in that The step of determining a first Geohash grid to be segmented in the first Geohash grid according to the area proportion includes: The area ratio is compared with a preset threshold, and a first Geohash grid corresponding to an area ratio less than the threshold is determined as a first Geohash grid to be segmented.

3. The method according to claim 1, characterized in that The step of segmenting the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths includes: Determine a first minimum value from the other lengths, use the first minimum value as a new minimum value, and use part of the spatial data objects falling into the first Geohash grid to be segmented as new spatial data objects; Return to executing the step of segmenting the spatial data object according to the minimum value among the multiple Geohash lengths; Until the Geohash length used for the current segmentation is the maximum value among the multiple Geohash lengths, or the area ratio of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.

4. The method according to claim 1, characterized in that: The comparing the plurality of spatial data objects according to the at least one target Geohash grid comprises: For each target Geohash grid in the at least one target Geohash grid, determining whether there is a first target Geohash grid in the at least one target Geohash grid whose accuracy is less than that of the target Geohash grid, and the target Geohash grid falls into the first target Geohash grid; In response to the presence of the first target Geohash grid in the at least one target Geohash grid, determining target spatial data objects corresponding to the target Geohash grid and the first target Geohash grid respectively; In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining a target spatial data object corresponding to the target Geohash grid; The target spatial data objects are compared pairwise.

5. A spatial data processing device based on geohash, characterized in that: include: A first acquisition module, used to acquire a plurality of spatial data objects to be processed; A second acquisition module is used to perform different-level segmentation on each of the spatial data objects according to a preset Geohash length range, wherein the Geohash length range includes multiple Geohash lengths, in ascending order of the multiple Geohash lengths, to obtain at least one target Geohash grid after segmentation; a comparison module, configured to compare the plurality of spatial data objects according to the at least one target Geohash grid; A determination module, used to determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result; The second acquisition module includes: A first segmentation unit is used to segment each of the spatial data objects according to a minimum value among the multiple Geohash lengths; An acquisition unit, used for acquiring a first Geohash grid corresponding to the spatial data object; A first determining unit, configured to determine, according to the coding of the spatial data object and the first Geohash grid, a proportion of an area of ​​a spatial object corresponding to the spatial data object that falls within the first Geohash grid; A second determining unit is used to determine a first Geohash grid to be segmented in the first Geohash grid according to the area proportion; A second segmentation unit, configured to segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths; A third determining unit is used to determine a second Geohash grid corresponding to the spatial data object according to a segmentation processing result of the first Geohash grid to be segmented and an unsegmented grid in the first Geohash grid; The fourth determining unit is used to determine the second Geohash grid corresponding to each of the plurality of spatial data objects as the at least one target Geohash grid.

6. The device according to claim 5, characterized in that The second determining unit is specifically configured to: The area ratio is compared with a preset threshold, and a first Geohash grid corresponding to an area ratio less than the threshold is determined as a first Geohash grid to be segmented.

7. The device according to claim 5, characterized in that The second segmentation unit is specifically used for: Determine a first minimum value from the other lengths, use the first minimum value as a new minimum value, and use part of the spatial data objects falling into the first Geohash grid to be segmented as new spatial data objects; Return to executing the step of segmenting the spatial data object according to the minimum value among the multiple Geohash lengths; Until the Geohash length used for the current segmentation is the maximum value among the multiple Geohash lengths, or the area ratio of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.

8. The device according to claim 5, characterized in that The comparison module is specifically used for: For each target Geohash grid in the at least one target Geohash grid, determining whether there is a first target Geohash grid in the at least one target Geohash grid whose accuracy is less than that of the target Geohash grid, and the target Geohash grid falls into the first target Geohash grid; In response to the presence of the first target Geohash grid in the at least one target Geohash grid, determining target spatial data objects corresponding to the target Geohash grid and the first target Geohash grid respectively; In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining a target spatial data object corresponding to the target Geohash grid; The target spatial data objects are compared pairwise.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Information push method and device

    CN108810167A

  • Method and device for determining moving track of object in multi-dimensional variable-granularity grid and method and device for navigating object

    CN113298954A