WO2023185144A1 - Geohash-based spatial-data processing method and apparatus, and electronic device - Google Patents

Geohash-based spatial-data processing method and apparatus, and electronic device Download PDF

Info

Publication number
WO2023185144A1
WO2023185144A1 PCT/CN2022/142125 CN2022142125W WO2023185144A1 WO 2023185144 A1 WO2023185144 A1 WO 2023185144A1 CN 2022142125 W CN2022142125 W CN 2022142125W WO 2023185144 A1 WO2023185144 A1 WO 2023185144A1
Authority
WO
WIPO (PCT)
Prior art keywords
geohash
spatial data
grid
target
spatial
Prior art date
Application number
PCT/CN2022/142125
Other languages
French (fr)
Chinese (zh)
Inventor
周轶凡
徐鹏飞
崔晓峰
王波
周文明
Original Assignee
杭州数梦工场科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州数梦工场科技有限公司 filed Critical 杭州数梦工场科技有限公司
Publication of WO2023185144A1 publication Critical patent/WO2023185144A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Definitions

  • This application relates to the field of big data, specifically to the field of geographical data information, and in particular to a spatial data processing method, device and electronic equipment based on Geohash.
  • Spatial data is a special type of data. It refers to any data with spatial coordinates, such as architectural design drawings, mechanical design drawings and various maps that are expressed in a digital form that can be accepted by computers to indicate the shape and size of spatial objects. and location and distribution characteristics. Spatial data has been widely used in various industries and departments of society, such as urban planning, transportation, banking, aerospace, etc. With the development of science and society, people have increasingly recognized the importance of spatial data for social and economic development and the improvement of people's living standards, which has also accelerated the pace of people's acquisition and application of spatial data.
  • map spatial data In the application scenario of map spatial data, the map spatial data needs to be managed first, and the legality of the spatial data can be determined by comparing the positional relationship between each spatial data, such as whether there is an inclusion relationship between two roads.
  • the relational comparison calculation is a pairwise calculation of spatial data, the calculation complexity is large and the calculation performance is poor.
  • This application provides a spatial data processing method, device and electronic equipment based on Geohash.
  • a spatial data processing method based on geocoding Geohash including:
  • the spatial position relationship between the corresponding spatial objects of the plurality of spatial data objects is determined according to the comparison result.
  • the Geohash length range includes multiple Geohash lengths; according to the preset Geohash length range, each spatial data object is segmented at different levels to obtain segmentation processing. At least one target Geohash mesh after that, including:
  • Each of the spatial data objects is hierarchically segmented in order from small to large in length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained.
  • each of the spatial data objects is hierarchically segmented in order from small to large in order of length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained, including :
  • a first Geohash grid to be divided is determined in the first Geohash grid
  • the first Geohash mesh to be segmented is segmented according to other lengths among the multiple Geohash lengths, and the segmentation processing result of the first Geohash mesh to be segmented and the first Geohash mesh are segmented.
  • For the unsegmented grid in the Geohash grid determine the second Geohash grid corresponding to the spatial data object;
  • the second Geohash grid corresponding to each of the plurality of spatial data objects is determined as the at least one target Geohash grid.
  • determining the first Geohash grid to be divided in the first Geohash grid based on the area ratio includes:
  • the area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
  • dividing the first Geohash grid to be divided according to other lengths among the plurality of Geohash lengths includes:
  • Geohash length used for current segmentation is the maximum value among the multiple Geohash lengths, or until the area proportion of the spatial data object falling into the current first Geohash grid is greater than or equal to the threshold.
  • the procedure compares the plurality of spatial data objects based on the at least one target Geohash grid, including:
  • For each target Geohash grid in the at least one target Geohash grid determine whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than the target Geohash grid, and the target The Geohash grid falls into the first target Geohash grid;
  • a Geohash-based spatial data processing device including:
  • the first acquisition module is configured to acquire multiple spatial data objects to be processed
  • the second acquisition module is configured to segment each spatial data object at different levels according to the preset Geohash length range, and acquire 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
  • the determination module is configured to determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result.
  • the Geohash length range includes multiple Geohash lengths;
  • the second acquisition module is specifically configured as:
  • Each of the spatial data objects is hierarchically segmented in order from small to large in length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained.
  • the second acquisition module includes:
  • the first slicing unit is configured to, for each spatial data object, segment the spatial data object according to the minimum value among the multiple Geohash lengths;
  • the acquisition unit is configured to acquire the first Geohash grid corresponding to each of the spatial data objects
  • a first determination unit configured to determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the encoding of each spatial data object and the first Geohash grid.
  • the second determination unit is configured to determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio;
  • the second segmentation unit is configured to segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths;
  • the third determination unit is configured to determine the second location corresponding to the spatial data object based on the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid.
  • the fourth determination unit is configured to determine the second Geohash grid corresponding to each of the plurality of spatial data objects as the at least one target Geohash grid.
  • the second determination unit is specifically configured to:
  • the area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
  • the second segmentation unit is specifically configured to:
  • the first segmentation unit is further configured to segment the new spatial data object according to the new minimum value
  • Geohash length used for current segmentation is the maximum value among the multiple Geohash lengths, or the area proportion of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.
  • the comparison module is specifically configured to:
  • For each target Geohash grid in the at least one target Geohash grid determine whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than the target Geohash grid, and the target The Geohash grid falls into the first target Geohash grid;
  • an electronic device including:
  • 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 perform the method described in the first aspect.
  • a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause the computer to execute the method described in the first aspect.
  • multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and according to the at least one target Geohash grid , compare multiple spatial data objects to determine the spatial position relationship between the corresponding spatial objects of the multiple spatial data objects.
  • This solution can reduce the waste of resources caused by invalid comparisons of spatial data and improve the effectiveness of pairwise comparisons of spatial data, thereby optimizing the computing performance during spatial data processing and improving the overall computing efficiency.
  • Figure 1 is a flow chart of a Geohash-based spatial data processing method provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of the principle of Geohash encoding in the embodiment of the present application.
  • Figure 3 is an example diagram of comparing spatial data according to the target Geohash grid in the embodiment of the present application.
  • Figure 4 is a flow chart of another Geohash-based spatial data processing method provided by the embodiment of the present application.
  • Figure 5 is a flow chart of another Geohash-based spatial data processing method provided by the embodiment of the present application.
  • Figure 6a, Figure 6b, Figure 6c, and Figure 6d are respectively example diagrams of the first Geohash grid corresponding to different levels of segmentation processing of spatial data objects in the embodiment of the present application;
  • Figure 6e is an example of all the spatial data objects in the embodiment of the present application.
  • Figure 7 is a structural block diagram of a Geohash-based spatial data processing device provided by an embodiment of the present application.
  • FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present application.
  • spatial data is a special type of data. It refers to any data with spatial coordinates, such as architectural design drawings, mechanical design drawings and various maps expressed in a digital form that can be accepted by computers to indicate The shape, size, location and distribution characteristics of spatial objects. Spatial data has been widely used in various industries and departments of society, such as urban planning, transportation, banking, aerospace, etc. With the development of science and society, people have increasingly recognized the importance of spatial data for social and economic development and the improvement of people's living standards, which has also accelerated the pace of people's acquisition and application of spatial data.
  • map spatial data In the application scenario of map spatial data, the map spatial data needs to be managed first, and the legality of the spatial data can be determined by comparing the positional relationship between each spatial data, such as whether there is an inclusion relationship between two roads.
  • the relational comparison calculation is a pairwise calculation of spatial data, the calculation complexity is large and the calculation performance is poor.
  • embodiments of the present application provide a spatial data processing method, device and electronic equipment based on Geohash.
  • FIG. 1 is a flow chart of a Geohash-based spatial data processing method provided by an embodiment of the present application. It should be noted that the Geohash-based spatial data processing method in the embodiment of the present application can be applied to the Geohash-based spatial data processing device in the embodiment of the present application, and the device can be applied in electronic equipment. As shown in Figure 1, the method may include the following steps:
  • Step 101 Obtain multiple spatial data objects to be processed.
  • the multiple spatial data objects to be processed refer to the spatial data whose positional relationships between their corresponding spatial objects need to be verified in the scenario of geospatial data governance.
  • Each spatial data object is the spatial data of its corresponding spatial object. 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 is a lake, then the spatial data object is the spatial data of the lake.
  • users can upload files corresponding to multiple spatial data objects to be processed through a terminal device with a spatial data object upload function and an interactive interface based on data upload, and receive the data information submitted by the front end. , obtain multiple spatial data objects to be processed.
  • the spatial data collection terminal and the spatial data verification terminal can also be connected.
  • the data collection equipment or data collection personnel upload the collected spatial data of each object to the collection terminal.
  • the spatial data verification terminal receives the space updated by the collection terminal. data to obtain multiple spatial data objects to be processed.
  • Step 102 Segment each spatial data object at different levels according to the preset Geohash length range, and obtain at least one target Geohash grid after segmentation.
  • geocoding Geohash is an address encoding method that can encode two-dimensional longitude and latitude data into a one-dimensional string. Each string represents a specific rectangle, and all coordinates within that rectangle share this string. The longer the string, the higher the precision, and the smaller the corresponding rectangular range.
  • latitude [-90, 90] and longitude [-180, 180] it is calculated whether the target longitude and latitude fall in the left interval or the right interval respectively. If it falls in the left interval, it takes 0, and if it falls in the right interval, it takes 1. Then, continue searching in half according to this method for the interval obtained in the previous step to obtain the next binary code.
  • the obtained binary codes are interspersed and combined to obtain a new binary string.
  • the binary string is translated into a string, that is, the GeoHash string corresponding to the geographical coordinates is obtained.
  • the corresponding Geohash length range can be preset.
  • the length range can be a continuous length value, including multiple Geohash length, for example, the Geohash length is 4 to 7.
  • 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 unchanged after setting, or it can be based on the actual situation. The range value is adjusted by the application scenario, and this application does not limit this.
  • each spatial data object is segmented into different levels according to the preset Geohash length range, which means that each spatial data object is segmented according to different Geohash lengths.
  • the target Geohash grid refers to the 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.
  • the number of target Geohash grids is greater than or equal to 1.
  • the spatial data object can be segmented according to the smallest Geohash length in the preset Geohash length range, and based on the segmentation result, part of the spatial data object can be segmented according to the sub-minimum Geohash length.
  • the grid is further divided, and so on, until the Geohash length reaches the maximum value in the preset range, or the Geohash grids obtained after the division meet the preset conditions, then the division is completed and each spatial data object is The Geohash grid obtained after segmentation is used as at least one target Geohash grid.
  • Step 103 Compare multiple spatial data objects according to at least one target Geohash grid.
  • the multiple spatial data objects need to be compared. 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 intersecting nor inclusive. If two spatial data objects correspond to The same target Geohash grid means that the spatial position relationship of the corresponding spatial objects of the two spatial data objects may be an intersection relationship or an inclusion relationship.
  • the target Geohash grid can be used as an index, the spatial data object corresponding to each target Geohash grid is determined according to the target Geohash grid, and the spatial data object corresponding to each target Geohash grid is determined based on the spatial data object corresponding to the target Geohash grid. Compare multiple spatial data objects, thereby reducing invalid comparisons of spatial data and optimizing computing performance.
  • each target Geohash grid in the at least one target Geohash grid it may be determined whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than 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, it is determined that the target Geohash grid and the first target Geohash grid are respectively The corresponding target space data object; in response to the first target Geohash grid not existing in at least one target Geohash grid, determine the target space data object corresponding to the target Geohash grid; compare the target space data objects pairwise.
  • target grid 2 falls in target grid 1, where target grid 2 corresponds to spatial data objects A and Spatial data object B and target grid 1 correspond to spatial data object C, which 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 also needs to be compared with the spatial data object corresponding to target grid 1, that is, spatial data object A and spatial data object B, spatial data object A and spatial data object C, spatial data object B and spatial data object C respectively. Compare.
  • each target Geohash grid determines whether there is a first target Geohash grid in at least one target Geohash grid that is smaller in accuracy than the target Geohash grid. If the coding length n of target Geohash grid 1 is less than The encoding length of the target Geohash grid is m, 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, which means that the target Geohash grid 1 is the above-mentioned first target Geohash grid.
  • FIG. 3 if there are 5 spatial data objects to be processed, they are 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 space corresponding to the lake. Data, if compared through pairwise spatial data objects, it needs to be executed 10 times to determine the spatial position relationship of each spatial object.
  • Six target Geohash grids can be obtained through the method in the embodiment of this application, in which grid 1 corresponds to the spatial data of the park, grid 2 corresponds to the spatial data of the park and house B, and 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
  • grid 6 only corresponds to the spatial data of house A; among them, the accuracy of grid 1 is smaller than that of grid 6 and grid 6 falls into
  • the spatial data of the park and house A can be compared based on grid 6
  • the spatial data of the park and house B can be compared based on grid 2 and grid 3, respectively.
  • the spatial position relationship of each spatial object can be determined in three times. Therefore, the method of the embodiment of the present application can filter out invalid spatial data comparisons, effectively reduce the calculation amount of spatial data processing, and improve calculation efficiency.
  • Step 104 Determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison results.
  • the spatial position relationship between the corresponding spatial objects of multiple spatial data objects refers to the spatial position relationship between the spatial objects of the respective objects of the multiple spatial data objects, where the spatial position relationship Can include include, intersect, etc.
  • spatial object A is included in spatial object B. If part of the spatial data of spatial data object A is included in spatial data object B, it means that the spatial position relationship between spatial object A and spatial object B corresponding to them is: spatial object A and spatial object B Spatial object B intersects.
  • Geohash-based spatial data processing method based on the preset Geohash length range, multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and according to at least A target Geohash grid compares multiple spatial data objects to determine the spatial position relationship between the corresponding spatial objects of the multiple spatial data objects.
  • This solution can reduce the waste of resources caused by invalid comparisons of spatial data and improve the effectiveness of pairwise comparisons of spatial data, thereby optimizing the computing performance during spatial data processing and improving the overall computing efficiency.
  • FIG 4 is a flow chart of another Geohash-based spatial data processing method provided by an embodiment of the present application. As shown in Figure 4, the method may include:
  • Step 401 Obtain multiple spatial data objects to be processed.
  • Step 402 Perform hierarchical segmentation on each spatial data object in ascending order of multiple Geohash lengths to obtain at least one target Geohash grid after segmentation.
  • the Geohash length range may include multiple Geohash lengths. Since the longer the Geohash length, the higher the accuracy, and the corresponding rectangular range is smaller, so the space can be calculated according to the order of multiple Geohash lengths from small to large. Data objects are divided hierarchically.
  • hierarchical segmentation can be implemented as follows: for each spatial data object, first segment the spatial data object according to the minimum value among multiple Geohash length values, that is, the first layer segmentation, and obtain the space The first Geohash grid corresponding to the data object; then perform a second layer segmentation on part of the Geohash grid in the first Geohash grid according to the minimum value of the remaining lengths among the multiple Geohash lengths to obtain the second layer corresponding to the spatial data object. Geohash grid; then perform the third layer segmentation on part of the Geohash grid in the second Geohash grid according to the minimum value of the remaining lengths among the multiple Geohash lengths, until the current segmented Geohash length reaches the maximum of the multiple Geohash lengths. value, or meet the preset conditions to complete the segmentation of the spatial data object.
  • step 402 in the embodiment of this application may include the following steps:
  • Step 402-1 For each spatial data object, segment the spatial data object according to the minimum value among multiple Geohash lengths.
  • each spatial data object is segmented according to the minimum value of multiple Geohash lengths. Since the longer the Geohash length is, the higher the accuracy is and the smaller the corresponding rectangular range is. Therefore, the spatial data object can be segmented according to the minimum value among the multiple Geohash lengths.
  • Step 402-2 Obtain the first Geohash grid corresponding to the spatial data object.
  • the first Geohash grid corresponding to the spatial data object refers to the grid after the spatial data object is segmented according to the minimum value of multiple Geohash lengths, and the spatial data object can be at least Partially overlapping Geohash meshes.
  • library functions in related technologies can be used to obtain the first Geohash grid corresponding to the spatial data object based on the spatial data object and the minimum value among multiple Geohash lengths.
  • Step 402-3 Determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the coding of the spatial data object and the first Geohash grid.
  • the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid means that the spatial object corresponding to the spatial data object falls into the first Geohash grid corresponding to the spatial data object.
  • the ratio of the area to the area of the first Geohash grid For example, spatial data object A corresponds to spatial object A, and the first Geohash grids that at least partially overlap with spatial data object A are grid 1 and grid 3. Then the area of spatial object A falling in grid 1 is equal to the area of grid 1.
  • the ratio of the area of 1 and the ratio of the area of spatial object A falling in grid 3 to the area of grid 3 are both the proportion of the area of spatial object A falling in the first Geohash grid corresponding to spatial data object A.
  • each Geohash grid corresponds to its own string code, and based on the string code of a certain Geohash grid, the longitude and latitude range of the Geohash grid can be determined, as well as the area of the Geohash grid.
  • the implementation method of determining the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid may include: according to the spatial data object The encoding of the first Geohash grid corresponding to the data object determines the longitude and latitude range of the first Geohash grid corresponding to the spatial data object; based on the spatial data object and the longitude and latitude range of the first Geohash grid, calculate the corresponding range of the spatial data object The area of the spatial object falling into the first Geohash grid; the ratio of the area of the spatial object falling into the first Geohash grid to the area of the first Geohash grid is used as the spatial object corresponding to the spatial data
  • 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 certain spatial data object is greater than 1, the space needs to be determined separately.
  • the area proportion of each first Geohash grid corresponding to the spatial data object corresponding to the data object falls into the spatial data object.
  • Step 402-4 Determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio.
  • the first Geohash grid to be segmented means that it needs to be segmented with higher accuracy.
  • the first Geohash grid As an example, the obtained area ratio may be compared with a preset threshold, and the first Geohash grid corresponding to the area ratio smaller than the threshold value may be determined as the first Geohash grid to be segmented.
  • Step 402-5 Segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths, and based on the segmentation processing result of the first Geohash mesh to be segmented and the first Geohash mesh The undivided grid in the grid determines the second Geohash grid corresponding to the spatial data object.
  • the 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.
  • the first Geohash grid to be divided can be divided according to the minimum value among other lengths to obtain the first divided Geohash grid, and the spatial object corresponding to the spatial data object falls into the first
  • the area ratio in the Geohash grid after segmentation is used to determine the second Geohash grid to be segmented; the second Geohash grid to be segmented is further segmented according to the sub-minimum Geohash length among other lengths, and so on, until the current segmentation
  • the divided Geohash length is the maximum value in the Geohash length range, or if the area ratios obtained after segmentation all meet the preset conditions, then the segmentation is completed, and the resulting Geohash grid and the first Geohash grid that are not The segmented grid is used as the second Geohash grid corresponding to the spatial data object.
  • Step 402-6 Determine the second Geohash grid corresponding to each of the multiple spatial data objects as at least one target Geohash grid.
  • the second Geohash grid corresponding to each of the multiple spatial data objects is used as at least one target Geohash grid.
  • Step 403 Compare multiple spatial data objects according to at least one target Geohash grid.
  • Step 404 Determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison results.
  • each spatial data object is segmented at different levels according to the multiple Geohash lengths included in the preset Geohash length range, and at least the segmented data is obtained.
  • a target Geohash grid that is, by establishing a hierarchical Geohash index to optimize the performance of spatial data comparison.
  • first dividing the spatial data object according to the minimum value among the multiple Geohash lengths and then determining the first to be cut according to the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid. Divide the grid into grids, and further split the first grid to be divided according to other lengths, so that different levels of Geohash indexes can be established for each spatial data object, which can effectively improve the effectiveness of spatial data comparison and improve the determination of efficiency of spatial location relationships.
  • FIG. 5 is a flow chart of yet another Geohash-based spatial data processing method provided by an embodiment of the present application. As shown in Figure 5, the method may include:
  • Step 501 Obtain multiple spatial data objects to be processed.
  • Step 502 For each spatial data object, segment the spatial data object according to the minimum value among multiple Geohash lengths included in the preset Geohash length range.
  • the minimum value here is the minimum value among the multiple Geohash lengths contained in the Geohash length range.
  • the minimum value here is the latest one by the step. 506 determines the new minimum value.
  • the spatial data object is each of the multiple spatial data objects to be processed obtained in step 501.
  • the spatial data object is the latest one determined by step 506. new spatial data object.
  • Step 503 Obtain the first Geohash grid corresponding to the spatial data object.
  • the first Geohash grid corresponding to the spatial data object is a pointer to the spatial data object.
  • the spatial data object is Data objects can at least partially overlap Geohash grids.
  • the first Geohash grid corresponding to the spatial data object refers to the new Geohash grid obtained by dividing the new spatial data object in the latest step 502, and can be at least partially related to the new spatial data object. Overlapping new first Geohash mesh.
  • step 503 is consistent with the implementation of step 402-2 in Figure 4, and will not be described again here.
  • Step 504 Determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the coding of the spatial data object and the first Geohash grid.
  • the first Geohash grid is the first Geohash grid obtained when step 503 is performed for the first time, and the area ratio is also calculated based on the first Geohash grid.
  • the first Geohash grid is the new first Geohash grid obtained when step 503 is executed for the latest time, and the area ratio is calculated based on the new first Geohash grid.
  • step 504 is consistent with the implementation of step 402-3 in Figure 4, and will not be described again here.
  • Step 505 Determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio.
  • step 505 when step 505 is executed for the first time, this step is to determine the first Geohash grid to be divided from the first Geohash grid obtained when step 503 is executed for the first time based on the area ratio obtained when step 504 is executed for the first time. .
  • step 505 is executed again, this step is to determine the new first to be cut in the new first Geohash grid obtained when step 503 is executed for the latest time based on the new area ratio obtained when step 504 is executed for the latest first time. Geohash grid.
  • step 505 is consistent with the implementation of step 402-4 in Figure 4, and will not be described again here.
  • Step 506 Determine the first minimum value from other lengths, use the first minimum value as the new minimum value, and use the partial spatial data objects falling in the first Geohash grid to be divided as new spatial data objects.
  • other lengths refer to the remaining Geohash lengths after removing the Geohash lengths that have been used in the segmentation process among the multiple Geohash lengths.
  • the first minimum value is the minimum value among the other lengths. Since the spatial data object partially overlaps with the first Geohash grid to be segmented, the part of the spatial data object that overlaps with the first Geohash grid to be segmented is part of the spatial data that falls into the first Geohash grid to be segmented. object. Among them, some spatial data objects falling into the first Geohash grid to be divided can be obtained based on the existing library function and according to the encoding of the spatial data object and the first Geohash grid to be divided.
  • step 507 is executed.
  • Step 507 Determine the second Geohash grid corresponding to the spatial data object based on the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid.
  • the segmentation processing result of the first Geohash grid to be segmented includes not only the segmentation processing result of the first Geohash grid to be segmented obtained by executing step 505 for the first time, but also includes the execution of the loop execution step. 505 obtains the segmentation processing result of the new first Geohash grid to be segmented.
  • the undivided grids in the first Geohash grid include both the undivided grids in the first Geohash grid obtained by executing step 503 for the first time, and the new first Geohash grid obtained by looping step 503. The unsegmented mesh.
  • Step 508 Determine the second Geohash grid corresponding to each of the multiple spatial data objects as at least one target Geohash grid.
  • Step 509 Compare multiple spatial data objects according to at least one target Geohash grid.
  • Step 510 Determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison results.
  • the implementation process of the method will be described next in the form of examples. 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 default Geohash length range includes 4, 5, 6, 7, then the implementation process of this method may include the following processes:
  • FIG. 6a is a schematic diagram of the first Geohash grid corresponding to the spatial data object after segmentation processing, in which the first Geohash grid corresponding to the park is The Geohash grids are grid 1, grid 2 and grid 3; after calculation, the area proportion of the park falling into grid 1 and the area proportion falling into grid 3 are both less than the threshold, and the park falling into grid If the area ratio in 2 is greater than the threshold, it means that both grid 1 and grid 3 are the first Geohash grids to be segmented; some spatial data objects falling into grid 1 will be used as new spatial data objects and will fall into Some spatial data objects of Grid 3 are used as new spatial data objects.
  • FIG. 6b shows the first Geohash network corresponding to the spatial data of the park after this segmentation process.
  • FIG. 6c shows the first Geohash network corresponding to the spatial data of the park after this segmentation process.
  • a schematic diagram of the grid in which grid 6, grid 7 and grid 8 are all the 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 The area proportions are all greater than the threshold, and the area proportion of the park falling into grid 8 is less than the threshold, which means that grid 8 is the new first Geohash grid to be segmented; part of the spatial data falling into grid 8 will be object as a new spatial data object.
  • FIG. 6d is a schematic diagram of the first Geohash grid corresponding to the spatial data of the park after this segmentation process.
  • the second Geohash grids corresponding to the park space data obtained after the segmentation process are grid 2, grid 6, grid 7, and grid 9 respectively.
  • FIG. 6e shows the corresponding corresponding after all spatial data objects are segmented.
  • Schematic diagram of the target Geohash grid where 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, and the spatial data of the lake corresponds to The second Geohash grid is Grid 2, and the second Geohash grid corresponding to the spatial data of House C is Grid 11, so the obtained target Geohash grids are Grid 2, Grid 6, Grid 7, and Grid 9. , Grid 10 and Grid 11.
  • grid 2 corresponds to the spatial data of parks and lakes
  • the spatial data of parks can be compared with the spatial data of lakes
  • since grid 7 corresponds to houses B and the spatial data of the park, so the spatial data of the park can be compared with the spatial data of house B
  • the spatial data objects are cyclically segmented at different levels, and the segmented data are obtained.
  • At least one target Geohash grid is used to establish different hierarchical Geohash indexes for each spatial data object, thereby effectively improving the effectiveness of spatial data comparison and improving the efficiency of determining spatial location relationships.
  • embodiments of the present application provide a spatial data processing device based on Geohash.
  • Figure 7 is a structural block diagram of a Geohash-based spatial data processing device provided by an embodiment of the present application. As shown in Figure 7, the device may include:
  • the first acquisition module 710 is configured to acquire multiple spatial data objects to be processed
  • the second acquisition module 720 is configured to segment each spatial data object at different levels according to the preset Geohash length range, and acquire at least one target Geohash grid after segmentation;
  • the comparison module 730 is configured to compare multiple spatial data objects according to at least one target Geohash grid
  • the determination module 740 is configured to determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison results.
  • the Geohash length range includes multiple Geohash lengths; the second acquisition module 720 is specifically configured as:
  • each spatial data object is hierarchically segmented to obtain at least one target Geohash grid after segmentation.
  • the second acquisition module 720 includes:
  • the first segmentation unit 721 is configured to segment each spatial data object according to the minimum value among multiple Geohash lengths
  • the acquisition unit 722 is configured to acquire the first Geohash grid corresponding to the spatial data object
  • the first determination unit 723 is configured to determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the spatial data object and the encoding of the first Geohash grid;
  • the second determination unit 724 is configured to determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio;
  • the second segmentation unit 725 is configured to segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths;
  • the third determination unit 726 is configured to determine the second Geohash grid corresponding to the spatial data object based on the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid;
  • the fourth determining unit 727 is configured to determine the second Geohash grid corresponding to each of the plurality of spatial data objects as at least one target Geohash grid.
  • the second determining unit 724 is specifically configured to:
  • the area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
  • the second segmentation unit 725 is specifically configured as:
  • the first segmentation unit 721 is also configured to segment the new spatial data object according to the new minimum value
  • Geohash length used for current segmentation is the maximum value among multiple Geohash lengths, or the area proportion of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.
  • Geohash-based spatial data processing device based on the preset Geohash length range, multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and based on at least A target Geohash grid compares multiple spatial data objects to determine the spatial position relationship between the corresponding spatial objects of the multiple spatial data objects.
  • This solution can reduce the waste of resources caused by invalid comparisons of spatial data and improve the effectiveness of pairwise comparisons of spatial data, thereby optimizing the computing performance during spatial data processing and improving the overall computing efficiency.
  • the embodiments of the present application further provide an electronic device, at least one processor; and 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, The instructions are executed by at least one processor, so that the at least one processor can execute any of the foregoing Geohash-based spatial data processing methods.
  • the embodiments of the present application also provide a non-transient computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute any of the foregoing methods provided by the embodiments of the present application.
  • Spatial data processing method based on Geohash.
  • Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit the implementation of the present application as described and/or claimed herein.
  • the device 800 includes a computing unit 801 that can execute according to a computer program stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 into a random access memory (RAM) 803 Various appropriate actions and treatments. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored.
  • Computing unit 801, ROM 802 and RAM 803 are connected to each other via bus 804.
  • An input/output (I/O) interface 805 is also connected to bus 804.
  • the I/O interface 805 includes: 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 magnetic disk, optical disk, etc. ; and communication unit 809, such as a network card, modem, wireless communication transceiver, etc.
  • the communication unit 809 allows the device 800 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
  • Computing unit 801 may be a variety of general and/or special purpose processing components having 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 processing processor (DSP), and any appropriate processor, controller, microcontroller, etc.
  • the computing unit 801 executes each method and processing described above, such as a spatial data processing method based on Geohash.
  • the Geohash-based spatial data processing method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as the storage unit 808.
  • part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or communication unit 809.
  • the computer program When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the Geohash-based spatial data processing method described above may be performed.
  • the computing unit 801 may be configured to perform the Geohash-based spatial data processing method in any other suitable manner (eg, by means of firmware).
  • Various implementations of the systems and techniques described above may 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 a chip implemented in a system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or a combination thereof.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOC system
  • CPLD load programmable logic device
  • computer hardware firmware, software, and/or a combination thereof.
  • These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor
  • the processor which may be a special purpose or general purpose programmable processor, may 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.
  • An output device may be a special purpose or general purpose programmable processor, may 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.
  • An output device may be a special purpose or general purpose programmable processor, may 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.
  • Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented.
  • the program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or a trackball
  • Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including acoustic input, voice input, or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented in a computing system that includes back-end 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 front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), the Internet, and blockchain networks.
  • Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other.
  • the server can be a cloud server, also known as cloud computing server or cloud host. It is a host product in the cloud computing service system to solve the problem of traditional physical host and VPS service ("Virtual Private Server", or "VPS" for short) Among them, there are defects such as difficult management and weak business scalability.
  • the server can also be a distributed system server or a server combined with a blockchain.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Remote Sensing (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A GeoHash-based spatial-data processing method and apparatus, and an electronic device, which relate to the field of big data, and particularly relate to the field of geographic data information. The method comprises: acquiring a plurality of spatial data objects to be processed (101); according to a preset GeoHash length range, respectively segmenting, in different levels, each spatial data object, and acquiring at least one target GeoHash grid after segmentation processing (102); according to the at least one target GeoHash grid, comparing the plurality of spatial data objects (103); and according to a comparison result, determining a spatial position relationship between spatial objects respectively corresponding to the plurality of spatial data objects (104). The method can reduce the waste of resources caused by invalid comparison of spatial data, such that the calculation performance during a spatial-data processing process is optimized, and the overall calculation efficiency is improved.

Description

基于Geohash的空间数据处理方法、装置及电子设备Spatial data processing methods, devices and electronic equipment based on Geohash
相关申请的交叉引用Cross-references to related applications
本申请基于2022年3月30日提交的发明名称为“基于Geohash的空间数据处理方法、装置及电子设备”的中国专利申请CN202210336552.4,并且要求该专利申请的优先权,通过引用将其所公开的内容全部并入本申请。This application is based on the Chinese patent application CN202210336552.4 with the invention name "Geohash-based spatial data processing method, device and electronic equipment" submitted on March 30, 2022, and claims the priority of this patent application, and all the claims are incorporated by reference. All disclosed contents are incorporated into this application.
技术领域Technical field
本申请涉及大数据领域,具体涉及地理数据信息领域,尤其涉及一种基于Geohash的空间数据处理方法、装置及电子设备。This application relates to the field of big data, specifically to the field of geographical data information, and in particular to a spatial data processing method, device and electronic equipment based on Geohash.
背景技术Background technique
空间数据是数据的一种特殊类型,它是指凡是带有空间坐标的数据,如将建筑设计图、机械设计图和各种地图表示成计算机能够接受的数字形式,以表明空间对象的形状大小以及位置和分布特征。空间数据已广泛应用于社会各行业、各部门,如城市规划、交通、银行、航空航天等。随着科学和社会的发展,人们已经越来越认识到空间数据对于社会经济的发展、人们生活水平提高的重要性,这也加快了人们获取和应用空间数据的步伐。Spatial data is a special type of data. It refers to any data with spatial coordinates, such as architectural design drawings, mechanical design drawings and various maps that are expressed in a digital form that can be accepted by computers to indicate the shape and size of spatial objects. and location and distribution characteristics. Spatial data has been widely used in various industries and departments of society, such as urban planning, transportation, banking, aerospace, etc. With the development of science and society, people have increasingly recognized the importance of spatial data for social and economic development and the improvement of people's living standards, which has also accelerated the pace of people's acquisition and application of spatial data.
在地图空间数据应用场景中,需要先对地图空间数据进行治理,通过比较各空间数据之间的位置关系,比如两条道路是否存在包含关系等,以确定空间数据的合法性。但是,当涉及计算的空间数据量较大时,由于关系比较计算为对空间数据的两两计算,所以计算复杂度较大,计算性能较差。In the application scenario of map spatial data, the map spatial data needs to be managed first, and the legality of the spatial data can be determined by comparing the positional relationship between each spatial data, such as whether there is an inclusion relationship between two roads. However, when the amount of spatial data involved in calculation is large, since the relational comparison calculation is a pairwise calculation of spatial data, the calculation complexity is large and the calculation performance is poor.
发明内容Contents of the invention
本申请提供了一种基于Geohash的空间数据处理方法、装置及电子设备。This application provides a spatial data processing method, device and electronic equipment based on Geohash.
根据本申请实施例的第一方面,提供了一种基于地理编码Geohash的 空间数据处理方法,包括:According to the first aspect of the embodiment of the present application, a spatial data processing method based on geocoding Geohash is provided, including:
获取待处理的多个空间数据对象;Get multiple spatial data objects to be processed;
根据预设的Geohash长度范围,分别对每个所述空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格;Segment each spatial data object at different levels according to the preset Geohash length range, and obtain at least one target Geohash grid after segmentation;
根据所述至少一个目标Geohash网格,对所述多个空间数据对象进行比较;Comparing the plurality of spatial data objects based on the at least one target Geohash grid;
根据比较结果确定所述多个空间数据对象各自对应的空间对象之间的空间位置关系。The spatial position relationship between the corresponding spatial objects of the plurality of spatial data objects is determined according to the comparison result.
在本申请的一些实施例中,所述Geohash长度范围中包括多个Geohash长度;所述根据预设的Geohash长度范围,分别对每个所述空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格,包括:In some embodiments of the present application, the Geohash length range includes multiple Geohash lengths; according to the preset Geohash length range, each spatial data object is segmented at different levels to obtain segmentation processing. At least one target Geohash mesh after that, including:
按照所述多个Geohash长度从小到大的顺序,分别对每个所述空间数据对象进行分层切分,获取切分处理后的至少一个目标Geohash网格。Each of the spatial data objects is hierarchically segmented in order from small to large in length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained.
作为一种实施方式,所述按照所述多个Geohash长度从小到大的顺序,分别对每个所述空间数据对象进行分层切分,获取切分处理后的至少一个目标Geohash网格,包括:As an implementation manner, each of the spatial data objects is hierarchically segmented in order from small to large in order of length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained, including :
针对每个所述空间数据对象,按照所述多个Geohash长度中的最小值,对所述空间数据对象进行切分处理;For each spatial data object, segment the spatial data object according to the minimum value among the multiple Geohash lengths;
获取所述空间数据对象对应的第一Geohash网格;Obtain the first Geohash grid corresponding to the spatial data object;
根据所述空间数据对象和所述第一Geohash网格的编码,确定所述空间对象对应的空间对象落入所述第一Geohash网格中的面积占比;According to the encoding of the spatial data object and the first Geohash grid, determine the area proportion of the spatial object corresponding to the spatial object falling into the first Geohash grid;
根据所述面积占比,在所述第一Geohash网格中确定出第一待切分Geohash网格;According to the area ratio, a first Geohash grid to be divided is determined in the first Geohash grid;
按照所述多个Geohash长度之中其他长度,对所述第一待切分Geohash网格进行切分处理,并根据所述第一待切分Geohash网格的切分处理结果和所述第一Geohash网格中未被切分的网格,确定所述空间数据对象对应的第二Geohash网格;The first Geohash mesh to be segmented is segmented according to other lengths among the multiple Geohash lengths, and the segmentation processing result of the first Geohash mesh to be segmented and the first Geohash mesh are segmented. For the unsegmented grid in the Geohash grid, determine the second Geohash grid corresponding to the spatial data object;
将所述多个空间数据对象各自对应的第二Geohash网格,确定为所述至少一个目标Geohash网格。The second Geohash grid corresponding to each of the plurality of spatial data objects is determined as the at least one target Geohash grid.
在本申请的一些实施例中,所述根据所述面积占比,在所述第一Geohash网格中确定出第一待切分Geohash网格,包括:In some embodiments of the present application, determining the first Geohash grid to be divided in the first Geohash grid based on the area ratio includes:
将所述面积占比与预设阈值进行比对,并将小于所述阈值的面积占比对应的第一Geohash网格确定为第一待切分Geohash网格。The area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
在本申请的一些实施例中,所述按照所述多个Geohash长度之中其他长度,对所述第一待切分Geohash网格进行切分处理,包括:In some embodiments of the present application, dividing the first Geohash grid to be divided according to other lengths among the plurality of Geohash lengths includes:
从所述其他长度中确定出第一最小值,将所述第一最小值作为新的最小值,将落入所述第一待切分Geohash网格中的部分空间数据对象作为新的空间数据对象;Determine the first minimum value from the other lengths, use the first minimum value as the new minimum value, and use the partial spatial data objects falling in the first Geohash grid to be divided as new spatial data object;
返回执行所述按照所述多个Geohash长度中的最小值,对所述空间数据对象进行切分处理的步骤;Return to perform the step of segmenting the spatial data object according to the minimum value among the multiple Geohash lengths;
直至当前切分所使用的Geohash长度为所述多个Geohash长度中的最大值,或者,所述空间数据对象落入当前第一Geohash网格中的面积占比大于或等于阈值为止。Until the Geohash length used for current segmentation is the maximum value among the multiple Geohash lengths, or until the area proportion of the spatial data object falling into the current first Geohash grid is greater than or equal to the threshold.
在本申请的一些实施例中,诉讼根据所述至少一个目标Geohash网格,对所述多个空间数据对象进行比较,包括:In some embodiments of the present application, the procedure compares the plurality of spatial data objects based on the at least one target Geohash grid, including:
针对所述至少一个目标Geohash网格中的每个目标Geohash网格,确定所述至少一个目标Geohash网格中是否存在精度小于所述目标Geohash网格的第一目标Geohash网格,且所述目标Geohash网格落入所述第一目标Geohash网格中;For each target Geohash grid in the at least one target Geohash grid, determine whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than the target Geohash grid, and the target The Geohash grid falls into the first target Geohash grid;
响应于所述至少一个目标Geohash网格中存在所述第一目标Geohash网格,确定所述目标Geohash网格和所述第一目标Geohash网格各自对应的目标空间数据对象;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;
响应于所述至少一个目标Geohash网格中未存在所述第一目标Geohash网格,确定所述目标Geohash网格对应的目标空间数据对象;In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining the target spatial data object corresponding to the target Geohash grid;
将所述目标空间数据对象进行两两比较。Compare the target space data objects pairwise.
根据本申请实施例的第二方面,提供了一种基于Geohash的空间数据处理装置,包括:According to the second aspect of the embodiment of the present application, a Geohash-based spatial data processing device is provided, including:
第一获取模块,设置为获取待处理的多个空间数据对象;The first acquisition module is configured to acquire multiple spatial data objects to be processed;
第二获取模块,设置为根据预设的Geohash长度范围,分别对每个所 述空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格;The second acquisition module is configured to segment each spatial data object at different levels according to the preset Geohash length range, and acquire at least one target Geohash grid after segmentation;
比较模块,设置为根据所述至少一个目标Geohash网格,对所述多个空间数据对象进行比较;A comparison module configured to compare the plurality of spatial data objects according to the at least one target Geohash grid;
确定模块,设置为根据比较结果确定所述多个空间数据对象各自对应的空间对象之间的空间位置关系。The determination module is configured to determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result.
在本申请的一些实施例中,所述Geohash长度范围中包括多个Geohash长度;所述第二获取模块具体设置为:In some embodiments of the present application, the Geohash length range includes multiple Geohash lengths; the second acquisition module is specifically configured as:
按照所述多个Geohash长度从小到大的顺序,分别对每个所述空间数据对象进行分层切分,获取切分处理后的至少一个目标Geohash网格。Each of the spatial data objects is hierarchically segmented in order from small to large in length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained.
作为一种实施方式,所述第二获取模块包括:As an implementation manner, the second acquisition module includes:
第一切分单元,设置为针对每个所述空间数据对象,按照所述多个Geohash长度中的最小值,对所述空间数据对象进行切分处理;The first slicing unit is configured to, for each spatial data object, segment the spatial data object according to the minimum value among the multiple Geohash lengths;
获取单元,设置为获取每个所述空间数据对象对应的第一Geohash网格;The acquisition unit is configured to acquire the first Geohash grid corresponding to each of the spatial data objects;
第一确定单元,设置为根据每个所述空间数据对象和所述第一Geohash网格的编码,确定所述空间数据对象对应的空间对象落入所述第一Geohash网格中的面积占比;A first determination unit configured to determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the encoding of each spatial data object and the first Geohash grid. ;
第二确定单元,设置为根据所述面积占比,在所述第一Geohash网格中确定出第一待切分Geohash网格;The second determination unit is configured to determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio;
第二切分单元,设置为按照所述多个Geohash长度之中其他长度,对所述第一待切分Geohash网格进行切分处理;The second segmentation unit is configured to segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths;
第三确定单元,设置为根据所述第一待切分Geohash网格的切分处理结果和所述第一Geohash网格中未被切分的网格,确定所述空间数据对象对应的第二Geohash网格;The third determination unit is configured to determine the second location corresponding to the spatial data object based on the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid. Geohash grid;
第四确定单元,设置为将所述多个空间数据对象各自对应的第二Geohash网格,确定为所述至少一个目标Geohash网格。The fourth determination unit is configured to determine the second Geohash grid corresponding to each of the plurality of spatial data objects as the at least one target Geohash grid.
在本申请的一些实施例中,所述第二确定单元具体设置为:In some embodiments of the present application, the second determination unit is specifically configured to:
将所述面积占比与预设阈值进行比对,并将小于所述阈值的面积占比对应的第一Geohash网格确定为第一待切分Geohash网格。The area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
在本申请的一些实施例中,所述第二切分单元具体设置为:In some embodiments of the present application, the second segmentation unit is specifically configured to:
从所述其他长度中确定出第一最小值,将所述第一最小值作为新的最小值,将落入所述第一待切分Geohash网格中的部分空间数据对象作为新的空间数据对象;Determine the first minimum value from the other lengths, use the first minimum value as the new minimum value, and use the partial spatial data objects falling in the first Geohash grid to be divided as new spatial data object;
其中,所述第一切分单元还设置为按照所述新的最小值,对所述新的空间数据对象进行切分处理;Wherein, the first segmentation unit is further configured to segment the new spatial data object according to the new minimum value;
直至当前切分所使用的Geohash长度为所述多个Geohash长度中的最大值,或者,所述空间对象落入当前第一Geohash网格中的面积占比大于或等于阈值为止。Until the Geohash length used for current segmentation is the maximum value among the multiple Geohash lengths, or the area proportion of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.
在本申请的一些实施例中,所述比较模块具体设置为:In some embodiments of this application, the comparison module is specifically configured to:
针对所述至少一个目标Geohash网格中的每个目标Geohash网格,确定所述至少一个目标Geohash网格中是否存在精度小于所述目标Geohash网格的第一目标Geohash网格,且所述目标Geohash网格落入所述第一目标Geohash网格中;For each target Geohash grid in the at least one target Geohash grid, determine whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than the target Geohash grid, and the target The Geohash grid falls into the first target Geohash grid;
响应于所述至少一个目标Geohash网格中存在所述第一目标Geohash网格,确定所述目标Geohash网格和所述第一目标Geohash网格各自对应的目标空间数据对象;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;
响应于所述至少一个目标Geohash网格中未存在所述第一目标Geohash网格,确定所述目标Geohash网格对应的目标空间数据对象;In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining the target spatial data object corresponding to the target Geohash grid;
将所述目标空间数据对象进行两两比较。Compare the target space data objects pairwise.
根据本申请实施例的第三方面,提供了一种电子设备,包括:According to a third aspect of the embodiment of the present application, an electronic device is provided, including:
至少一个处理器;以及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 perform the method described in the first aspect.
根据本申请实施例的第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行上述第一方面所述的方法。According to a fourth aspect of the embodiments of the present application, there is provided a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause the computer to execute the method described in the first aspect.
根据本申请实施例提供的技术方案,基于预设的Geohash长度范围, 分别对待处理的多个空间数据对象进行不同层级切分,以获取至少一个目标Geohash网格,并根据至少一个目标Geohash网格,对多个空间数据对象进行比较,以确定多个空间数据对象各自对应的空间对象之间的空间位置关系。本方案可以降低由于空间数据的无效比较而造成的资源浪费,提高空间数据两两比较的有效性,从而可以优化空间数据处理过程中的计算性能,提升整体的计算效率。According to the technical solution provided by the embodiment of the present application, based on the preset Geohash length range, multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and according to the at least one target Geohash grid , compare multiple spatial data objects to determine the spatial position relationship between the corresponding spatial objects of the multiple spatial data objects. This solution can reduce the waste of resources caused by invalid comparisons of spatial data and improve the effectiveness of pairwise comparisons of spatial data, thereby optimizing the computing performance during spatial data processing and improving the overall computing efficiency.
应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the application, nor is it intended to limit the scope of the application. Other features of the present application will become readily understood from the following description.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application. in:
图1为本申请实施例所提供的一种基于Geohash的空间数据处理方法的流程图;Figure 1 is a flow chart of a Geohash-based spatial data processing method provided by an embodiment of the present application;
图2为本申请实施例中Geohash编码的原理示意图;Figure 2 is a schematic diagram of the principle of Geohash encoding in the embodiment of the present application;
图3为本申请实施例中根据目标Geohash网格对空间数据进行比较的示例图;Figure 3 is an example diagram of comparing spatial data according to the target Geohash grid in the embodiment of the present application;
图4为本申请实施例所提供的另一种基于Geohash的空间数据处理方法的流程图;Figure 4 is a flow chart of another Geohash-based spatial data processing method provided by the embodiment of the present application;
图5为本申请实施例所提供的又一种基于Geohash的空间数据处理方法的流程图;Figure 5 is a flow chart of another Geohash-based spatial data processing method provided by the embodiment of the present application;
图6a、图6b、图6c、图6d分别为本申请实施例中对空间数据对象进行不同层级的切分处理对应的第一Geohash网格的示例图;图6e为本申请实施例中对所有空间数据对象切分处理后对应的目标Geohash网格的示例图;Figure 6a, Figure 6b, Figure 6c, and Figure 6d are respectively example diagrams of the first Geohash grid corresponding to different levels of segmentation processing of spatial data objects in the embodiment of the present application; Figure 6e is an example of all the spatial data objects in the embodiment of the present application. An example of the corresponding target Geohash grid after segmentation processing of spatial data objects;
图7为本申请实施例所提供的一种基于Geohash的空间数据处理装置的结构框图;Figure 7 is a structural block diagram of a Geohash-based spatial data processing device provided by an embodiment of the present application;
图8示出了可以用来实施本申请的实施例的示例电子设备800的示意性框图。8 illustrates a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present application.
具体实施方式Detailed ways
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and they should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
需要说明的是,空间数据是数据的一种特殊类型,它是指凡是带有空间坐标的数据,如将建筑设计图、机械设计图和各种地图表示成计算机能够接受的数字形式,以表明空间对象的形状大小以及位置和分布特征。空间数据已广泛应用于社会各行业、各部门,如城市规划、交通、银行、航空航天等。随着科学和社会的发展,人们已经越来越认识到空间数据对于社会经济的发展、人们生活水平提高的重要性,这也加快了人们获取和应用空间数据的步伐。It should be noted that spatial data is a special type of data. It refers to any data with spatial coordinates, such as architectural design drawings, mechanical design drawings and various maps expressed in a digital form that can be accepted by computers to indicate The shape, size, location and distribution characteristics of spatial objects. Spatial data has been widely used in various industries and departments of society, such as urban planning, transportation, banking, aerospace, etc. With the development of science and society, people have increasingly recognized the importance of spatial data for social and economic development and the improvement of people's living standards, which has also accelerated the pace of people's acquisition and application of spatial data.
在地图空间数据应用场景中,需要先对地图空间数据进行治理,通过比较各空间数据之间的位置关系,比如两条道路是否存在包含关系等,以确定空间数据的合法性。但是,当涉及计算的空间数据量较大时,由于关系比较计算为对空间数据的两两计算,所以计算复杂度较大,计算性能较差。In the application scenario of map spatial data, the map spatial data needs to be managed first, and the legality of the spatial data can be determined by comparing the positional relationship between each spatial data, such as whether there is an inclusion relationship between two roads. However, when the amount of spatial data involved in calculation is large, since the relational comparison calculation is a pairwise calculation of spatial data, the calculation complexity is large and the calculation performance is poor.
为了解决上述问题,本申请实施例提供了一种基于Geohash的空间数据处理方法、装置及电子设备。In order to solve the above problems, embodiments of the present application provide a spatial data processing method, device and electronic equipment based on Geohash.
图1为本申请实施例所提供的一种基于Geohash的空间数据处理方法的流程图。需要说明的是,本申请实施例中的基于Geohash的空间数据处理方法可以应用于本申请实施例中的基于Geohash的空间数据处理装置,且该装置可应用于电子设备中。如图1所示,该方法可以包括以下步骤:Figure 1 is a flow chart of a Geohash-based spatial data processing method provided by an embodiment of the present application. It should be noted that the Geohash-based spatial data processing method in the embodiment of the present application can be applied to the Geohash-based spatial data processing device in the embodiment of the present application, and the device can be applied in electronic equipment. As shown in Figure 1, the method may include the following steps:
步骤101,获取待处理的多个空间数据对象。Step 101: Obtain multiple spatial data objects to be processed.
在本申请的一些实施例中,待处理的多个空间数据对象是指在进行地理空间数据治理的场景中,待对其各自对应的空间对象之间的位置关系进行验证的空间数据,比如可以包含空间对象的坐标信息。每个空间数据对象均为其对应的空间对象的空间数据,比如,若空间数据对象对应的空间对象为某公园,则该空间数据对象为该公园的空间数据;若空间数据对象 对应的空间对象为某湖泊,则该空间数据对象为该湖泊的空间数据。In some embodiments of the present application, the multiple spatial data objects to be processed refer to the spatial data whose positional relationships between their corresponding spatial objects need to be verified in the scenario of geospatial data governance. For example, Contains coordinate information for spatial objects. Each spatial data object is the spatial data of its corresponding spatial object. 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 is a lake, then the spatial data object is the spatial data of the lake.
在本申请的一些实施例中,用户可以通过具有空间数据对象上传功能的终端设备,基于数据上传的交互界面将待处理的多个空间数据对象对应的文件进行上传,通过接收前端提交的数据信息,获取待处理的多个空间数据对象。此外,也可以将空间数据采集端与空间数据验证端打通,数据采集设备或者数据采集人员将采集到的各对象的空间数据上传至采集终端中,空间数据验证端通过接收到采集端更新的空间数据,来获取待处理的多个空间数据对象。In some embodiments of this application, users can upload files corresponding to multiple spatial data objects to be processed through a terminal device with a spatial data object upload function and an interactive interface based on data upload, and receive the data information submitted by the front end. , obtain multiple spatial data objects to be processed. In addition, the spatial data collection terminal and the spatial data verification terminal can also be connected. The data collection equipment or data collection personnel upload the collected spatial data of each object to the collection terminal. The spatial data verification terminal receives the space updated by the collection terminal. data to obtain multiple spatial data objects to be processed.
步骤102,根据预设的Geohash长度范围,分别对每个空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格。Step 102: Segment each spatial data object at different levels according to the preset Geohash length range, and obtain at least one target Geohash grid after segmentation.
需要说明的是,地理编码Geohash是一种地址编码方式,它能把二维的经纬度数据编码成一维的字符串。每个字符串代表一个特定的矩形,在该矩形范围内的所有坐标都共用这个字符串。字符串越长精度越高,对应的矩形范围越小。如图2所示,对一个地理坐标编码时,按照初始区间范围纬度[-90,90]和经度[-180,180],计算目标经度和纬度分别落在左区间还是右区间。落在左区间则取0,右区间则取1。然后,对上一步得到的区间继续按照此方法对半查找,得到下一位二进制编码。当编码长度达到业务的进度需求后,根据“偶数位放经度,奇数位放纬度”的规则,将得到的二进制编码穿插组合,得到一个新的二进制串。最后,根据base32的对照表,将二进制串翻译成字符串,即得到地理坐标对应的GeoHash字符串。It should be noted that geocoding Geohash is an address encoding method that can encode two-dimensional longitude and latitude data into a one-dimensional string. Each string represents a specific rectangle, and all coordinates within that rectangle share this string. The longer the string, the higher the precision, and the smaller the corresponding rectangular range. As shown in Figure 2, when encoding a geographical coordinate, according to the initial interval range latitude [-90, 90] and longitude [-180, 180], it is calculated whether the target longitude and latitude fall in the left interval or the right interval respectively. If it falls in the left interval, it takes 0, and if it falls in the right interval, it takes 1. Then, continue searching in half according to this method for the interval obtained in the previous step to obtain the next binary code. When the coding length reaches the business progress requirement, according to the rule of "even-numbered bits are placed in longitude and odd-numbered bits are placed in latitude", 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 geographical coordinates is obtained.
可以理解,Geohash长度越大精度越高,同时对应的计算开销越大,所以为了兼顾精度和计算开销,可以预设对应的Geohash长度范围,通常该长度范围可以为连续的长度值,包含多个Geohash长度,比如Geohash长度为4~7。此外,预设的Geohash长度范围可以是用户通过终端设备的交互页面来设定的,也可以是直接在程序中设定的,而且Geohash长度范围可以是设定之后一成不变的,也可以是根据实际应用场景而自行调整的范围值,本申请对此不作限定。It can be understood that the larger the Geohash length, the higher the accuracy, and at the same time the greater the corresponding calculation overhead. Therefore, in order to take into account both accuracy and calculation overhead, the corresponding Geohash length range can be preset. Usually, the length range can be a continuous length value, including multiple Geohash length, for example, the Geohash length is 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 unchanged after setting, or it can be based on the actual situation. The range value is adjusted by the application scenario, and this application does not limit this.
在本申请实施例中,根据预设的Geohash长度范围,分别对每个空间数据对象进行不同层级切分,是指按照不同的Geohash长度分别对每个空间数据对象进行切分处理。其中,目标Geohash网格是指在对所有空间数 据对象切分结束后,能与至少一个空间数据对象至少部分重叠的Geohash网格,即空间数据对象对应的空间对象所落入的Geohash网格,且目标Geohash网格的数量大于等于1。In the embodiment of the present application, each spatial data object is segmented into different levels according to the preset Geohash length range, which means that each spatial data object is segmented according to different Geohash lengths. Among them, the target Geohash grid refers to the 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.
作为一种示例,可以针对每个空间数据对象,按照预设的Geohash长度范围中最小的Geohash长度对该空间数据对象进行切分,并根据切分结果,按照次最小Geohash长度对其中的部分Geohash网格进一步切分,依此类推,直至Geohash长度达到预设范围中的最大值,或者,切分后得到的Geohash网格均满足预设条件,则完成切分,并将每个空间数据对象经过切分处理得到的Geohash网格作为至少一个目标Geohash网格。As an example, for each spatial data object, the spatial data object can be segmented according to the smallest Geohash length in the preset Geohash length range, and based on the segmentation result, part of the spatial data object can be segmented according to the sub-minimum Geohash length. The grid is further divided, and so on, until the Geohash length reaches the maximum value in the preset range, or the Geohash grids obtained after the division meet the preset conditions, then the division is completed and each spatial data object is The Geohash grid obtained after segmentation is used as at least one target Geohash grid.
步骤103,根据至少一个目标Geohash网格,对多个空间数据对象进行比较。Step 103: Compare multiple spatial data objects according to at least one target Geohash grid.
可以理解,为了确定多个空间数据对象各自对应的空间对象之间的空间位置关系,需要对多个空间数据对象进行比较。若某两个空间数据对象分别对应不同的目标Geohash网格,则说明这两个空间数据对象各自对应的空间对象的空间位置既非相交关系也非包含关系,若某两个空间数据对象均对应相同的目标Geohash网格,则说明这两个空间数据对象各自对应的空间对象的空间位置关系有可能为相交关系,也有可能为包含关系。本申请实施例中,可以将目标Geohash网格作为索引,根据目标Geohash网格确定每个目标Geohash网格所对应的空间数据对象,并根据每个目标Geohash网格所对应的空间数据对象,对多个空间数据对象进行比较,从而可以减少空间数据的无效比对,优化计算性能。It can be understood that in order to determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects, the multiple spatial data objects need to be compared. 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 intersecting nor inclusive. If two spatial data objects correspond to The same target Geohash grid means that the spatial position relationship of the corresponding spatial objects of the two spatial data objects may be an intersection relationship or an inclusion relationship. In the embodiment of the present application, the target Geohash grid can be used as an index, the spatial data object corresponding to each target Geohash grid is determined according to the target Geohash grid, and the spatial data object corresponding to each target Geohash grid is determined based on the spatial data object corresponding to the target Geohash grid. Compare multiple spatial data objects, thereby reducing invalid comparisons of spatial data and optimizing computing performance.
在本申请的一些实施例中,可以针对至少一个目标Geohash网格中的每个目标Geohash网格,确定至少一个目标Geohash网格中是否存在精度小于该目标Geohash网格的第一目标Geohash网格,且该目标Geohash网格落入该第一目标Geohash网格中;响应于至少一个目标Geohash网格中存在第一目标Geohash网格,确定该目标Geohash网格和该第一目标Geohash网格各自对应的目标空间数据对象;响应于至少一个目标Geohash网格中未存在第一目标Geohash网格,确定该目标Geohash网格对应的目标空间数据对象;将目标空间数据对象进行两两比较。In some embodiments of the present application, for each target Geohash grid in the at least one target Geohash grid, it may be determined whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than 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, it is determined that the target Geohash grid and the first target Geohash grid are respectively The corresponding target space data object; in response to the first target Geohash grid not existing in at least one target Geohash grid, determine the target space data object corresponding to the target Geohash grid; compare the target space data objects pairwise.
可以理解,若至少一个目标Geohash网格中的目标网格1的精度高于 目标网格2,且目标网格2落在目标网格1中,其中,目标网格2对应空间数据对象A和空间数据对象B,目标网格1对应空间数据对象C,则说明目标网格1也至少部分覆盖空间数据对象A和空间数据对象B,所以在针对目标网格2对应的空间数据对象进行比较时,也需要将其与目标网格1对应的空间数据对象进行比较,即对空间数据对象A与空间数据对象B、空间数据对象A与空间数据对象C、空间数据对象B与空间数据对象C分别进行比较。It can be understood that if the accuracy of target grid 1 in at least one target Geohash grid is higher than target grid 2, and target grid 2 falls in target grid 1, where target grid 2 corresponds to spatial data objects A and Spatial data object B and target grid 1 correspond to spatial data object C, which 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 also needs to be compared with the spatial data object corresponding to target grid 1, that is, spatial data object A and spatial data object B, spatial data object A and spatial data object C, spatial data object B and spatial data object C respectively. Compare.
举例而言,可以根据各目标Geohash网格的编码来确定至少一个目标Geohash网格中是否存在精度小于该目标Geohash网格的第一目标Geohash网格,若目标Geohash网格1的编码长度n小于该目标Geohash网格的编码长度m,且目标Geohash网格1的编码与该目标Geohash网格的编码的前n位完全一致,则说明目标Geohash网格1为上述第一目标Geohash网格。For example, it can be determined based on the coding of each target Geohash grid whether there is a first target Geohash grid in at least one target Geohash grid that is smaller in accuracy than the target Geohash grid. If the coding length n of target Geohash grid 1 is less than The encoding length of the target Geohash grid is m, 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, which means that the target Geohash grid 1 is the above-mentioned first target Geohash grid.
如图3所示,若待处理的空间数据对象为5个,分别为房屋A对应的空间数据、房屋B对应的空间数据、房屋C对应的空间数据、公园对应的空间数据和湖泊对应的空间数据,若通过两两空间数据对象进行比较需要执行10次才可以确定各空间对象的空间位置关系。而经本申请实施例中的方法可以得到6个目标Geohash网格,其中网格1对应公园的空间数据,网格2对应公园和房屋B的空间数据,网格3对应公园和湖泊的空间数据,网格4只对应公园的空间数据,网格5只对应房屋C的空间数据,网格6只对应房屋A的空间数据;其中,网格1的精度小于网格6且网格6落入网格1中,所以可以基于网格6将公园与房屋A的空间数据进行比较,基于网格2和网格3分别对公园和房屋B的空间数据、公园和湖泊的空间数据进行比较,比较3次即可确定各空间对象的空间位置关系,所以本申请实施例的方法可以过滤掉无效的空间数据比较,有效地降低空间数据处理的计算量,提高计算效率。As shown in Figure 3, if there are 5 spatial data objects to be processed, they are 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 space corresponding to the lake. Data, if compared through pairwise spatial data objects, it needs to be executed 10 times to determine the spatial position relationship of each spatial object. Six target Geohash grids can be obtained through the method in the embodiment of this application, in which grid 1 corresponds to the spatial data of the park, grid 2 corresponds to the spatial data of the park and house B, and 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; among them, the accuracy of grid 1 is smaller than that of grid 6 and grid 6 falls into In grid 1, 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 in three times. Therefore, the method of the embodiment of the present application can filter out invalid spatial data comparisons, effectively reduce the calculation amount of spatial data processing, and improve calculation efficiency.
步骤104,根据比较结果确定多个空间数据对象各自对应的空间对象之间的空间位置关系。Step 104: Determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison results.
在本申请的一些实施例中,多个空间数据对象各自对应的空间对象之间的空间位置关系是指多个空间数据对象各自对象的空间对象两两之间 的空间位置关系,其中空间位置关系可以包括包含、相交等。In some embodiments of the present application, the spatial position relationship between the corresponding spatial objects of multiple spatial data objects refers to the spatial position relationship between the spatial objects of the respective objects of the multiple spatial data objects, where the spatial position relationship Can include include, intersect, etc.
作为一种示例,经过对多个空间数据对象进行比较,若空间数据对象A的均包含在空间数据对象B的中,则说明二者各自对应的空间对象A和空间对象B的空间位置关系为空间对象A包含在空间对象B中,若空间数据对象A的部分空间数据包含在空间数据对象B中,则说明二者各自对应的空间对象A和空间对象B的空间位置关系为空间对象A与空间对象B相交。As an example, after comparing multiple spatial data objects, if spatial data object A is included in spatial data object B, then the spatial position relationship between spatial object A and spatial object B corresponding to them is: Spatial object A is included in spatial object B. If part of the spatial data of spatial data object A is included in spatial data object B, it means that the spatial position relationship between spatial object A and spatial object B corresponding to them is: spatial object A and spatial object B Spatial object B intersects.
根据本申请实施例中的基于Geohash的空间数据处理方法,基于预设的Geohash长度范围,分别对待处理的多个空间数据对象进行不同层级切分,以获取至少一个目标Geohash网格,并根据至少一个目标Geohash网格,对多个空间数据对象进行比较,以确定多个空间数据对象各自对应的空间对象之间的空间位置关系。本方案可以降低由于空间数据的无效比较而造成的资源浪费,提高空间数据两两比较的有效性,从而可以优化空间数据处理过程中的计算性能,提升整体的计算效率。According to the Geohash-based spatial data processing method in the embodiment of the present application, based on the preset Geohash length range, multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and according to at least A target Geohash grid compares multiple spatial data objects to determine the spatial position relationship between the corresponding spatial objects of the multiple spatial data objects. This solution can reduce the waste of resources caused by invalid comparisons of spatial data and improve the effectiveness of pairwise comparisons of spatial data, thereby optimizing the computing performance during spatial data processing and improving the overall computing efficiency.
接下来,将对空间数据对象切分过程进行详细介绍。Next, the spatial data object segmentation process will be introduced in detail.
图4为本申请实施例所提供的另一种基于Geohash的空间数据处理方法的流程图。如图4所示,该方法可以包括:Figure 4 is a flow chart of another Geohash-based spatial data processing method provided by an embodiment of the present application. As shown in Figure 4, the method may include:
步骤401,获取待处理的多个空间数据对象。Step 401: Obtain multiple spatial data objects to be processed.
步骤402,按照多个Geohash长度从小到大的顺序,分别对每个空间数据对象进行分层切分,获取切分处理后的至少一个目标Geohash网格。Step 402: Perform hierarchical segmentation on each spatial data object in ascending order of multiple Geohash lengths to obtain at least one target Geohash grid after segmentation.
在本申请的实施例中,Geohash长度范围中可以包括多个Geohash长度,由于Geohash长度越长精度越高,对应的矩形范围越小,所以可以按照多个Geohash长度从小到大的顺序,对空间数据对象进行分层切分。其中,分层切分的实现方式可以为:针对每个空间数据对象,首先按照以多个Geohash长度值中的最小值对该空间数据对象进行切分,即第一层切分,得到该空间数据对象对应的第一Geohash网格;再按照多个Geohash长度中剩余长度的最小值对第一Geohash网格中的部分Geohash网格进行第二层切分,得到该空间数据对象对应的第二Geohash网格;再按照多个Geohash长度中剩余长度的最小值对第二Geohash网格中的部分Geohash网格进行第三层切分,直至当前切分的Geohash长度达到多个Geohash长 度中的最大值,或者,满足预设的条件完成对该空间数据对象的切分。In the 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 corresponding rectangular range is smaller, so the space can be calculated according to the order of multiple Geohash lengths from small to large. Data objects are divided hierarchically. Among them, hierarchical segmentation can be implemented as follows: for each spatial data object, first segment the spatial data object according to the minimum value among multiple Geohash length values, that is, the first layer segmentation, and obtain the space The first Geohash grid corresponding to the data object; then perform a second layer segmentation on part of the Geohash grid in the first Geohash grid according to the minimum value of the remaining lengths among the multiple Geohash lengths to obtain the second layer corresponding to the spatial data object. Geohash grid; then perform the third layer segmentation on part of the Geohash grid in the second Geohash grid according to the minimum value of the remaining lengths among the multiple Geohash lengths, until the current segmented Geohash length reaches the maximum of the multiple Geohash lengths. value, or meet the preset conditions to complete the segmentation of the spatial data object.
作为一种实施方式,本申请实施例中步骤402的实现方式可以包括以下步骤:As an implementation manner, the implementation of step 402 in the embodiment of this application may include the following steps:
步骤402-1,针对每个空间数据对象,按照多个Geohash长度中的最小值,对空间数据对象进行切分处理。Step 402-1: For each spatial data object, segment the spatial data object according to the minimum value among multiple Geohash lengths.
也就是说,针对每个空间数据对象分别按照多个Geohash长度中的最小值,对其进行切分处理。由于Geohash长度越长精度越高,对应的矩形范围越小,所以可以首先按照多个Geohash长度中的最小值,对空间数据对象进行切分处理。That is to say, each spatial data object is segmented according to the minimum value of multiple Geohash lengths. Since the longer the Geohash length is, the higher the accuracy is and the smaller the corresponding rectangular range is. Therefore, the spatial data object can be segmented according to the minimum value among the multiple Geohash lengths.
步骤402-2,获取空间数据对象对应的第一Geohash网格。Step 402-2: Obtain the first Geohash grid corresponding to the spatial data object.
在本申请实施例中,空间数据对象对应的第一Geohash网格是指在按照多个Geohash长度中的最小值对空间数据对象进行切分处理后的网格中,与该空间数据对象可以至少部分重叠的Geohash网格。作为一种示例,可以利用相关技术中的库函数,根据空间数据对象和多个Geohash长度中的最小值,获取该空间数据对象对应的第一Geohash网格。In the embodiment of the present application, the first Geohash grid corresponding to the spatial data object refers to the grid after the spatial data object is segmented according to the minimum value of multiple Geohash lengths, and the spatial data object can be at least Partially overlapping Geohash meshes. As an example, library functions in related technologies can be used to obtain the first Geohash grid corresponding to the spatial data object based on the spatial data object and the minimum value among multiple Geohash lengths.
步骤402-3,根据空间数据对象和第一Geohash网格的编码,确定空间数据对象对应的空间对象落入第一Geohash网格中的面积占比。Step 402-3: Determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the coding of the spatial data object and the first Geohash grid.
在本申请实施例中,空间数据对象对应的空间对象落入第一Geohash网格中的面积占比是指,空间数据对象对应的空间对象落入该空间数据对象对应的第一Geohash网格中的面积与第一Geohash网格的面积比值。比如与空间数据对象A对应空间对象A,其中与空间数据对象A至少部分重叠的第一Geohash网格为网格1和网格3,则空间对象A落在网格1中的面积与网格1的面积的比值,以及空间对象A落在网格3中的面积与网格3的面积的比值均为空间对象A落入空间数据对象A对应的第一Geohash网格中的面积占比。In the embodiment of this application, the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid means that the spatial object corresponding to the spatial data object falls into the first Geohash grid corresponding to the spatial data object. The ratio of the area to the area of the first Geohash grid. For example, spatial data object A corresponds to spatial object A, and the first Geohash grids that at least partially overlap with spatial data object A are grid 1 and grid 3. Then the area of spatial object A falling in grid 1 is equal to the area of grid 1. The ratio of the area of 1 and the ratio of the area of spatial object A falling in grid 3 to the area of grid 3 are both the proportion of the area of spatial object A falling in the first Geohash grid corresponding to spatial data object A.
可以理解,每个Geohash网格均对应各自的字符串编码,且根据某Geohash网格的字符串编码可以确定该Geohash网格所在的经纬度范围,以及该Geohash网格的面积。在本申请实施例中,根据每个空间数据对象和第一Geohash网格的编码,确定空间数据对象对应的空间对象落入第一Geohash网格中的面积占比的实现方式可以包括:根据空间数据对象对应 的第一Geohash网格的编码,确定该空间数据对象对应的第一Geohash网格的经纬度范围;根据该空间数据对象,以及第一Geohash网格的经纬度范围,计算该空间数据对象对应的空间对象落入第一Geohash网格中的面积;将该空间对象落入第一Geohash网格中的面积与第一Geohash网格的面积的比值,作为空间数据对象对应的空间对象落入第一Geohash网格中的面积占比。It can be understood that each Geohash grid corresponds to its own string code, and based on the string code of a certain Geohash grid, the longitude and latitude range of the Geohash grid can be determined, as well as the area of the Geohash grid. In the embodiment of the present application, based on the coding of each spatial data object and the first Geohash grid, the implementation method of determining the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid may include: according to the spatial data object The encoding of the first Geohash grid corresponding to the data object determines the longitude and latitude range of the first Geohash grid corresponding to the spatial data object; based on the spatial data object and the longitude and latitude range of the first Geohash grid, calculate the corresponding range of the spatial data object The area of the spatial object falling into the first Geohash grid; the ratio of the area of the spatial object falling into the first Geohash grid to the area of the first Geohash grid is used as the spatial object corresponding to the spatial data object falling into the first Geohash grid. The area ratio in a Geohash grid.
需要说明的是,由于每个空间数据对象对应的第一Geohash网格的数量大于等于1,所以若某个空间数据对象对应的第一Geohash网格的数量大于1时,则需要分别确定该空间数据对象对应空间对象落入该空间数据对象对应的每个第一Geohash网格的面积占比。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 certain spatial data object is greater than 1, the space needs to be determined separately. The area proportion of each first Geohash grid corresponding to the spatial data object corresponding to the data object falls into the spatial data object.
步骤402-4,根据面积占比,在第一Geohash网格中确定出第一待切分Geohash网格。Step 402-4: Determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio.
在本申请实施例中,可以根据面积占比来确定对应的第一Geohash网格是否需要再次切分,其中,第一待切分Geohash网格是指还需要按照更高的精度对其切分的第一Geohash网格。作为一种示例,可以将得到的面积占比与预设阈值进行比对,并将小于阈值的面积占比对应的第一Geohash网格确定为第一待切分Geohash网格。In the embodiment of the present application, it can be determined based on the area ratio whether the corresponding first Geohash grid needs to be segmented again, where the first Geohash grid to be segmented means that it needs to be segmented with higher accuracy. The first Geohash grid. As an example, the obtained area ratio may be compared with a preset threshold, and the first Geohash grid corresponding to the area ratio smaller than the threshold value may be determined as the first Geohash grid to be segmented.
步骤402-5,按照多个Geohash长度之中其他长度,对第一待切分Geohash网格进行切分处理,并根据第一待切分Geohash网格的切分处理结果和第一Geohash网格中未被切分的网格,确定空间数据对象对应的第二Geohash网格。Step 402-5: Segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths, and based on the segmentation processing result of the first Geohash mesh to be segmented and the first Geohash mesh The undivided grid in the grid determines the second Geohash grid corresponding to the spatial data object.
在本申请实施例中,多个Geohash长度之中其他长度是指将Geohash长度范围中包含的多个Geohash长度中的最小值去掉后,剩余的Geohash长度。In the embodiment of the present application, the 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.
作为一种示例,可以按照其他长度中的最小值对第一待切分Geohash网格进行切分,得到第一切分后Geohash网格,并根据该空间数据对象对应的空间对象落入第一切分后Geohash网格中的面积占比,确定第二待切分Geohash网格;按照其他长度中次最小Geohash长度对第二待切分Geohash网格进一步切分,依此类推,直至当前切分的Geohash长度为Geohash长度范围中的最大值,或者,切分后得到的面积占比均满足预设 条件,则完成切分,并将得到的Geohash网格和第一Geohash网格中未被切分的网格作为该空间数据对象对应的第二Geohash网格。As an example, the first Geohash grid to be divided can be divided according to the minimum value among other lengths to obtain the first divided Geohash grid, and the spatial object corresponding to the spatial data object falls into the first The area ratio in the Geohash grid after segmentation is used to determine the second Geohash grid to be segmented; the second Geohash grid to be segmented is further segmented according to the sub-minimum Geohash length among other lengths, and so on, until the current segmentation The divided Geohash length is the maximum value in the Geohash length range, or if the area ratios obtained after segmentation all meet the preset conditions, then the segmentation is completed, and the resulting Geohash grid and the first Geohash grid that are not The segmented grid is used as the second Geohash grid corresponding to the spatial data object.
步骤402-6,将多个空间数据对象各自对应的第二Geohash网格,确定为至少一个目标Geohash网格。Step 402-6: Determine the second Geohash grid corresponding to each of the multiple spatial data objects as at least one target Geohash grid.
也就是说,在对每个空间数据对象均完成切分后,将多个空间数据对象各自对应的第二Geohash网格,作为至少一个目标Geohash网格。That is to say, after each spatial data object is segmented, the second Geohash grid corresponding to each of the multiple spatial data objects is used as at least one target Geohash grid.
步骤403,根据至少一个目标Geohash网格,对多个空间数据对象进行比较。Step 403: Compare multiple spatial data objects according to at least one target Geohash grid.
步骤404,根据比较结果确定多个空间数据对象各自对应的空间对象之间的空间位置关系。Step 404: Determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison results.
根据本申请实施例提供的基于Geohash的空间数据处理方法,按照预设Geohash长度范围中包含的多个Geohash长度,分别对每个空间数据对象进行不同层级的切分,获取切分处理后的至少一个目标Geohash网格,也就是说,通过建立分层Geohash索引的方式,以优化空间数据比较的性能。此外,通过先按照多个Geohash长度中的最小值对空间数据对象进行切分处理,再根据空间数据对象对应的空间对象落入第一Geohash网格中的面积占比,来确定第一待切分网格,并根据其他长度对第一待切分网格进一步切分处理,从而可以为每个空间数据对象建立不同层级的Geohash索引,进而可以有效地提高空间数据比较的有效性,提升确定空间位置关系的效率。According to the Geohash-based spatial data processing method provided by the embodiment of the present application, each spatial data object is segmented at different levels according to the multiple Geohash lengths included in the preset Geohash length range, and at least the segmented data is obtained. A target Geohash grid, that is, by establishing a hierarchical Geohash index to optimize the performance of spatial data comparison. In addition, by first dividing the spatial data object according to the minimum value among the multiple Geohash lengths, and then determining the first to be cut according to the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid. Divide the grid into grids, and further split the first grid to be divided according to other lengths, so that different levels of Geohash indexes can be established for each spatial data object, which can effectively improve the effectiveness of spatial data comparison and improve the determination of efficiency of spatial location relationships.
接下来,将针对第一待切分Geohash网格的切分过程进行详细介绍。Next, the segmentation process of the first Geohash grid to be segmented will be introduced in detail.
图5为本申请实施例所提供的又一种基于Geohash的空间数据处理方法的流程图。如图5所示,该方法可以包括:Figure 5 is a flow chart of yet another Geohash-based spatial data processing method provided by an embodiment of the present application. As shown in Figure 5, the method may include:
步骤501,获取待处理的多个空间数据对象。Step 501: Obtain multiple spatial data objects to be processed.
步骤502,针对每个空间数据对象,按照预设Geohash长度范围所包含的多个Geohash长度中的最小值,对空间数据对象进行切分处理。Step 502: For each spatial data object, segment the spatial data object according to the minimum value among multiple Geohash lengths included in the preset Geohash length range.
需要说明的是,在首次执行该步骤时,此处的最小值为Geohash长度范围内包含的多个Geohash长度中的最小值,循环执行该步骤时,此处的最小值为当前最新一次由步骤506确定出的新的最小值。在首次执行该步骤时,空间数据对象为步骤501获取的待处理的多个空间数据对象中的每 个空间数据对象,而循环执行该步骤时,空间数据对象为当前最新一次由步骤506确定出的新的空间数据对象。It should be noted that when this step is executed for the first time, the minimum value here is the minimum value among the multiple Geohash lengths contained in the Geohash length range. When this step is executed cyclically, the minimum value here is the latest one by the step. 506 determines the new minimum value. When this step is executed for the first time, the spatial data object is each of the multiple spatial data objects to be processed obtained in step 501. When this step is executed cyclically, the spatial data object is the latest one determined by step 506. new spatial data object.
步骤503,获取空间数据对象对应的第一Geohash网格。Step 503: Obtain the first Geohash grid corresponding to the spatial data object.
在本申请实施例中,在首次执行该步骤时,空间数据对象对应的第一Geohash网格是指针对该空间数据对象,在步骤502切分空间数据对象得到的Geohash网格中,与该空间数据对象可以至少部分重叠的Geohash网格。在再次执行该步骤时,空间数据对象对应的第一Geohash网格是指在当前最新一次步骤502切分新的空间数据对象得到的新的Geohash网格中,与新的空间数据对象可以至少部分重叠的新的第一Geohash网格。In the embodiment of the present application, when this step is performed for the first time, the first Geohash grid corresponding to the spatial data object is a pointer to the spatial data object. In the Geohash grid obtained by dividing the spatial data object in step 502, the spatial data object is Data objects can at least partially overlap Geohash grids. When this step is performed again, the first Geohash grid corresponding to the spatial data object refers to the new Geohash grid obtained by dividing the new spatial data object in the latest step 502, and can be at least partially related to the new spatial data object. Overlapping new first Geohash mesh.
在本申请实施例中,步骤503的实现方式与图4中的步骤402-2的实现方式一致,此处不再赘述。In this embodiment of the present application, the implementation of step 503 is consistent with the implementation of step 402-2 in Figure 4, and will not be described again here.
步骤504,根据空间数据对象和第一Geohash网格的编码,确定空间数据对象对应的空间对象落入第一Geohash网格中的面积占比。Step 504: Determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the coding of the spatial data object and the first Geohash grid.
需要说明的是,在首次执行该步骤时,第一Geohash网格为首次执行步骤503时得到的第一Geohash网格,面积占比也是按照该第一Geohash网格而计算得到的。而再次执行该步骤时,第一Geohash网格为当前最新一次执行步骤503时得到的新的第一Geohash网格,面积占比是按照新的第一Geohash网格而计算得到的。It should be noted that when this step is performed for the first time, the first Geohash grid is the first Geohash grid obtained when step 503 is performed for the first time, and the area ratio is also calculated based on 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 ratio is calculated based on the new first Geohash grid.
在本申请实施例中,步骤504的实现方式与图4中的步骤402-3的实现方式一致,此处不再赘述。In this embodiment of the present application, the implementation of step 504 is consistent with the implementation of step 402-3 in Figure 4, and will not be described again here.
步骤505,根据面积占比,在第一Geohash网格中确定出第一待切分Geohash网格。Step 505: Determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio.
需要说明的是,在首次执行步骤505时,该步骤为根据首次执行步骤504得到的面积占比,在首次执行步骤503时得到的第一Geohash网格中确定出第一待切分Geohash网格。再次执行步骤505时,该步骤为根据当前最新一次首次执行步骤504得到的新的面积占比,在最新一次执行步骤503时得到的新的第一Geohash网格中确定出新的第一待切分Geohash网格。It should be noted that when step 505 is executed for the first time, this step is to determine the first Geohash grid to be divided from the first Geohash grid obtained when step 503 is executed for the first time based on the area ratio obtained when step 504 is executed for the first time. . When step 505 is executed again, this step is to determine the new first to be cut in the new first Geohash grid obtained when step 503 is executed for the latest time based on the new area ratio obtained when step 504 is executed for the latest first time. Geohash grid.
在本申请实施例中,步骤505的实现方式与图4中的步骤402-4的实现方式一致,此处不再赘述。In this embodiment of the present application, the implementation of step 505 is consistent with the implementation of step 402-4 in Figure 4, and will not be described again here.
步骤506,从其他长度中确定出第一最小值,将第一最小值作为新的最小值,将落入第一待切分Geohash网格中的部分空间数据对象作为新的空间数据对象。Step 506: Determine the first minimum value from other lengths, use the first minimum value as the new minimum value, and use the partial spatial data objects falling in the first Geohash grid to be divided as new spatial data objects.
在本申请实施例中,其他长度是指在多个Geohash长度中去掉切分处理已使用过的Geohash长度后,剩余的Geohash长度。第一最小值是指将其他长度中的最小值。由于空间数据对象与第一待切分Geohash网格部分重叠,所以该空间数据对象中与第一待切分Geohash网格重叠的部分为落入第一待切分Geohash网格中的部分空间数据对象。其中,落入第一待切分Geohash网格中的部分空间数据对象可以基于现有的库函数,根据空间数据对象和第一待切分Geohash网格的编码来获取。In the embodiment of this application, other lengths refer to the remaining Geohash lengths after removing the Geohash lengths that have been used in the segmentation process among the multiple Geohash lengths. The first minimum value is the minimum value among the other lengths. Since the spatial data object partially overlaps with the first Geohash grid to be segmented, the part of the spatial data object that overlaps with the first Geohash grid to be segmented is part of the spatial data that falls into the first Geohash grid to be segmented. object. Among them, some spatial data objects falling into the first Geohash grid to be divided can be obtained based on the existing library function and according to the encoding of the spatial data object and the first Geohash grid to be divided.
在本申请实施例中,执行步骤506后返回执行步骤502,以实现循环对第一待切分Geohash网格的切分处理,直至当前切分所使用的Geohash长度为多个Geohash长度中的最大值,或者,空间对象落入当前第一Geohash网格中的面积占比大于或等于阈值为止,执行步骤507。In the embodiment of the present application, after executing step 506, return to executing step 502 to realize the cyclic segmentation process of the first Geohash grid to be segmented until the Geohash length used for the current segmentation is the maximum of multiple Geohash lengths. value, or until the area proportion of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold, step 507 is executed.
步骤507,根据第一待切分Geohash网格的切分处理结果和第一Geohash网格中未被切分的网格,确定空间数据对象对应的第二Geohash网格。Step 507: Determine the second Geohash grid corresponding to the spatial data object based on the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid.
在本申请实施例中,第一待切分Geohash网格的切分处理结果既包含对首次执行步骤505得到的第一待切分Geohash网格的切分处理结果,也包含对执行循环执行步骤505得到的新的第一待切分Geohash网格的切分处理结果。第一Geohash网格中未被切分的网格既包含首次执行步骤503得到的第一Geohash网格中未被切分的网格,也包含循环执行步骤503得到的新的第一Geohash网格中未被切分的网格。In the embodiment of the present application, the segmentation processing result of the first Geohash grid to be segmented includes not only the segmentation processing result of the first Geohash grid to be segmented obtained by executing step 505 for the first time, but also includes the execution of the loop execution step. 505 obtains the segmentation processing result of the new first Geohash grid to be segmented. The undivided grids in the first Geohash grid include both the undivided grids in the first Geohash grid obtained by executing step 503 for the first time, and the new first Geohash grid obtained by looping step 503. The unsegmented mesh.
步骤508,将多个空间数据对象各自对应的第二Geohash网格,确定为至少一个目标Geohash网格。Step 508: Determine the second Geohash grid corresponding to each of the multiple spatial data objects as at least one target Geohash grid.
步骤509,根据至少一个目标Geohash网格,对多个空间数据对象进行比较。Step 509: Compare multiple spatial data objects according to at least one target Geohash grid.
步骤510,根据比较结果确定多个空间数据对象各自对应的空间对象之间的空间位置关系。Step 510: Determine the spatial position relationship between the spatial objects corresponding to the multiple spatial data objects according to the comparison results.
为了便于本申请实施例中基于Geohash的空间数据处理方法的理解, 接下来将以示例的形式对该方法的实现过程进行说明。假如待处理的空间数据对象分别为房屋A的空间数据、房屋B的空间数据、房屋C的空间数据、公园的空间数据和湖泊的空间数据,且预设Geohash长度范围包括4、5、6、7,则该方法的实现过程可以包括以下过程:In order to facilitate the understanding of the spatial data processing method based on Geohash in the embodiment of this application, the implementation process of the method will be described next in the form of examples. 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 default Geohash length range includes 4, 5, 6, 7, then the implementation process of this method may include the following processes:
(1)针对公园的空间数据,按照Geohash长度=4对该空间数据对象进行切分,图6a为切分处理后该空间数据对象对应的第一Geohash网格的示意图,其中公园对应的第一Geohash网格为网格1、网格2和网格3;经过计算公园落入网格1中的面积占比和落入网格3中的面积占比均小于阈值,而公园落入网格2中的面积占比大于阈值,则说明网格1和网格3均为第一待切分Geohash网格;将落入网格1的部分空间数据对象作为新的空间数据对象,将落入网格3的部分空间数据对象均作为新的空间数据对象(1) For the spatial data of the park, the spatial data object is segmented according to Geohash length = 4. Figure 6a is a schematic diagram of the first Geohash grid corresponding to the spatial data object after segmentation processing, in which the first Geohash grid corresponding to the park is The Geohash grids are grid 1, grid 2 and grid 3; after calculation, the area proportion of the park falling into grid 1 and the area proportion falling into grid 3 are both less than the threshold, and the park falling into grid If the area ratio in 2 is greater than the threshold, it means that both grid 1 and grid 3 are the first Geohash grids to be segmented; some spatial data objects falling into grid 1 will be used as new spatial data objects and will fall into Some spatial data objects of Grid 3 are used as new spatial data objects.
(2)针对步骤(1)中确定的两个新的空间数据对象,分别按照Geohash长度=5对其进行切分,图6b为此次切分处理后公园的空间数据对应的第一Geohash网格的示意图,其中,网格4和网格5为新的第一Geohash网格;经过计算,公园落入网格4中的面积占比和公园落入网格5中的面积占比依然小于阈值,则说明网格4和网格5均为新的第一待切分Geohash网格;将落入网格4的部分空间数据对象作为新的空间数据对象,将落入网格5的部分空间数据对象也作为新的空间数据对象。(2) For the two new spatial data objects determined in step (1), segment them according to Geohash length = 5. Figure 6b shows the first Geohash network corresponding to the spatial data of the park after this segmentation process. A schematic diagram of the grid, in which grid 4 and grid 5 are the new first Geohash grids; after calculation, the area proportion of the park falling into grid 4 and the area proportion of the park falling into grid 5 are still less than threshold, it means that both grid 4 and grid 5 are the new first Geohash grids to be segmented; some spatial data objects falling into grid 4 will be used as new spatial data objects, and some parts falling into grid 5 will be used as new spatial data objects. Spatial data objects also serve as new spatial data objects.
(3)针对步骤(2)中确定的两个新的空间数据对象,分别按照Geohash长度=6对其进行切分,图6c为此次切分处理后公园的空间数据对应的第一Geohash网格的示意图,其中,网格6、网格7和网格8均为新的第一Geohash网格;经过计算,公园落入网格6中的面积占比和公园落入网格7中的面积占比均大于阈值,而公园落入网格8中的面积占比小于阈值,则说明网格8为新的第一待切分Geohash网格;将落入网格8中的部分空间数据对象作为新的空间数据对象。(3) For the two new spatial data objects determined in step (2), segment them according to Geohash length = 6 respectively. Figure 6c shows the first Geohash network corresponding to the spatial data of the park after this segmentation process. A schematic diagram of the grid, in which grid 6, grid 7 and grid 8 are all the 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 The area proportions are all greater than the threshold, and the area proportion of the park falling into grid 8 is less than the threshold, which means that grid 8 is the new first Geohash grid to be segmented; part of the spatial data falling into grid 8 will be object as a new spatial data object.
(4)针对步骤(3)中确定的新的空间数据对象,按照Geohash长度=7对其进行切分,图6d为此次切分处理后公园的空间数据对应的第一Geohash网格的示意图,其中,网格9为新的第一Geohash网格;经过计算,公园落入网格9中的面积占比依然小于阈值,而Geohash长度=7已 经是预设Geohash长度范围中的最大值,则停止切分处理,也就是说,经切分处理后得到的公园空间数据对应的第二Geohash网格分别为网格2、网格6、网格7、网格9。(4) For the new spatial data object determined in step (3), segment it according to Geohash length = 7. Figure 6d is a schematic diagram of the first Geohash grid corresponding to the spatial data of the park after this segmentation process. , among which, grid 9 is the new first Geohash grid; after calculation, the area proportion of the park falling into grid 9 is still less than the threshold, and Geohash length = 7 is already the maximum value in the preset Geohash length range. Then stop the segmentation process, that is to say, the second Geohash grids corresponding to the park space data obtained after the segmentation process are grid 2, grid 6, grid 7, and grid 9 respectively.
(5)同样分别对湖泊的空间数据、房屋A的空间数据、房屋B的空间数据和房屋C的空间数据进行切分处理,如图6e为对所有的空间数据对象均切分完成后各自对应的目标Geohash网格的示意图,其中,房屋A的空间数据对应的第二Geohash网格为网格10,房屋B的空间数据对应的第二Geohash网格为网格7,湖泊的空间数据对应的第二Geohash网格为网格2,房屋C的空间数据对应的第二Geohash网格为网格11,所以得到的目标Geohash网格为网格2、网格6、网格7、网格9、网格10和网格11。由于网格2对应公园和湖泊的空间数据,可以将公园的空间数据与湖泊的空间数据进行比较;由于网格6只对应公园,所以不存在目标空间数据对象的比较;由于网格7对应房屋B和公园的空间数据,所以可以将公园的空间数据与房屋B的空间数据进行比较;由于网格9只对应公园的空间数据,网格11只对应房屋C的空间数据,所以不存在目标空间数据对象的比较;由于网格6的精度小于网格10,且网格10落入网格6中,且网格6对应公园的空间数据,网格10对应房屋A的空间数据,所以可以将公园的空间数据与房屋A的空间数据进行比较,从而可以只经过3次比较就可以确定各空间对象之间的空间位置关系。(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 respectively. Figure 6e shows the corresponding corresponding after all spatial data objects are segmented. Schematic diagram of the target Geohash grid, where 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, and the spatial data of the lake corresponds to The second Geohash grid is Grid 2, and the second Geohash grid corresponding to the spatial data of House C is Grid 11, so the obtained target Geohash grids are Grid 2, Grid 6, Grid 7, and Grid 9. , Grid 10 and Grid 11. Since grid 2 corresponds to the spatial data of parks and lakes, the spatial data of parks can be compared with the spatial data of lakes; since grid 6 only corresponds to parks, there is no comparison of target spatial data objects; since grid 7 corresponds to houses B and the spatial data of the park, so 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 target space. Comparison of data objects; since the accuracy of grid 6 is smaller than 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, so it can be The spatial data of the park is compared with the spatial data of House A, so that the spatial position relationship between each spatial object can be determined after only three comparisons.
根据本申请实施例提供的基于Geohash的空间数据处理方法,按照预设Geohash长度范围中包含的多个Geohash长度从小到大,循环对空间数据对象进行不同层级的切分,获取切分处理后的至少一个目标Geohash网格,以针对每个空间数据对象建立不同的分层Geohash索引,从而可以有效地提高空间数据比较的有效性,提升确定空间位置关系的效率。According to the Geohash-based spatial data processing method provided by the embodiment of the present application, according to the multiple Geohash lengths included in the preset Geohash length range from small to large, the spatial data objects are cyclically segmented at different levels, and the segmented data are obtained. At least one target Geohash grid is used to establish different hierarchical Geohash indexes for each spatial data object, thereby effectively improving the effectiveness of spatial data comparison and improving the efficiency of determining spatial location relationships.
为了实现上述实施例,本申请实施例提供了一种基于Geohash的空间数据处理装置。In order to implement the above embodiments, embodiments of the present application provide a spatial data processing device based on Geohash.
图7为本申请实施例所提供的一种基于Geohash的空间数据处理装置的结构框图。如图7所示,该装置可以包括:Figure 7 is a structural block diagram of a Geohash-based spatial data processing device provided by an embodiment of the present application. As shown in Figure 7, the device may include:
第一获取模块710,设置为获取待处理的多个空间数据对象;The first acquisition module 710 is configured to acquire multiple spatial data objects to be processed;
第二获取模块720,设置为根据预设的Geohash长度范围,分别对每 个空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格;The second acquisition module 720 is configured to segment each spatial data object at different levels according to the preset Geohash length range, and acquire at least one target Geohash grid after segmentation;
比较模块730,设置为根据至少一个目标Geohash网格,对多个空间数据对象进行比较;The comparison module 730 is configured to compare multiple spatial data objects according to at least one target Geohash grid;
确定模块740,设置为根据比较结果确定多个空间数据对象各自对应的空间对象之间的空间位置关系。The determination module 740 is configured to determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison results.
在本申请的一些实施例中,Geohash长度范围中包括多个Geohash长度;第二获取模块720具体设置为:In some embodiments of the present application, the Geohash length range includes multiple Geohash lengths; the second acquisition module 720 is specifically configured as:
按照多个Geohash长度从小到大的顺序,分别对每个空间数据对象进行分层切分,获取切分处理后的至少一个的目标Geohash网格。According to the order of multiple Geohash lengths from small to large, each spatial data object is hierarchically segmented to obtain at least one target Geohash grid after segmentation.
作为一种实施方式,第二获取模块720包括:As an implementation manner, the second acquisition module 720 includes:
第一切分单元721,设置为针对每个空间数据对象,按照多个Geohash长度中的最小值,对空间数据对象进行切分处理;The first segmentation unit 721 is configured to segment each spatial data object according to the minimum value among multiple Geohash lengths;
获取单元722,设置为获取空间数据对象对应的第一Geohash网格;The acquisition unit 722 is configured to acquire the first Geohash grid corresponding to the spatial data object;
第一确定单元723,设置为根据空间数据对象和第一Geohash网格的编码,确定空间数据对象对应的空间对象落入第一Geohash网格中的面积占比;The first determination unit 723 is configured to determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the spatial data object and the encoding of the first Geohash grid;
第二确定单元724,设置为根据面积占比,在第一Geohash网格中确定出第一待切分Geohash网格;The second determination unit 724 is configured to determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio;
第二切分单元725,设置为按照多个Geohash长度之中其他长度,对第一待切分Geohash网格进行切分处理;The second segmentation unit 725 is configured to segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths;
第三确定单元726,设置为根据第一待切分Geohash网格的切分处理结果和第一Geohash网格中未被切分的网格,确定空间数据对象对应的第二Geohash网格;The third determination unit 726 is configured to determine the second Geohash grid corresponding to the spatial data object based on the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid;
第四确定单元727,设置为将多个空间数据对象各自对应的第二Geohash网格,确定为至少一个目标Geohash网格。The fourth determining unit 727 is configured to determine the second Geohash grid corresponding to each of the plurality of spatial data objects as at least one target Geohash grid.
在本申请的一些实施例中,第二确定单元724具体设置为:In some embodiments of the present application, the second determining unit 724 is specifically configured to:
将面积占比与预设阈值进行比对,并将小于阈值的面积占比对应的第一Geohash网格确定为第一待切分Geohash网格。The area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
在本申请的一些实施例中,第二切分单元725具体设置为:In some embodiments of the present application, the second segmentation unit 725 is specifically configured as:
从其他长度中确定出第一最小值,将第一最小值作为新的最小值,将空间对象落入第一待切分Geohash网格中的部分对应的空间数据作为新的空间数据对象;Determine the first minimum value from other lengths, use the first minimum value as the new minimum value, and use the spatial data corresponding to the part of the spatial object falling into the first Geohash grid to be segmented as the new spatial data object;
其中,第一切分单元721还设置为按照新的最小值,对新的空间数据对象进行切分处理;Among them, the first segmentation unit 721 is also configured to segment the new spatial data object according to the new minimum value;
直至当前切分所使用的Geohash长度为多个Geohash长度中的最大值,或者,空间对象落入当前第一Geohash网格中的面积占比大于或等于阈值为止。Until the Geohash length used for current segmentation is the maximum value among multiple Geohash lengths, or the area proportion of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.
根据本申请实施例中的基于Geohash的空间数据处理装置,基于预设的Geohash长度范围,分别对待处理的多个空间数据对象进行不同层级切分,以获取至少一个目标Geohash网格,并根据至少一个目标Geohash网格,对多个空间数据对象进行比较,以确定多个空间数据对象各自对应的空间对象之间的空间位置关系。本方案可以降低由于空间数据的无效比较而造成的资源浪费,提高空间数据两两比较的有效性,从而可以优化空间数据处理过程中的计算性能,提升整体的计算效率。According to the Geohash-based spatial data processing device in the embodiment of the present application, based on the preset Geohash length range, multiple spatial data objects to be processed are divided into different levels to obtain at least one target Geohash grid, and based on at least A target Geohash grid compares multiple spatial data objects to determine the spatial position relationship between the corresponding spatial objects of the multiple spatial data objects. This solution can reduce the waste of resources caused by invalid comparisons of spatial data and improve the effectiveness of pairwise comparisons of spatial data, thereby optimizing the computing performance during spatial data processing and improving the overall computing efficiency.
基于本申请的实施例,本申请实施例还提供了一种电子设备,至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行前述任一项基于Geohash的空间数据处理方法。Based on the embodiments of the present application, the embodiments of the present application further provide an electronic device, at least one processor; and 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, The instructions are executed by at least one processor, so that the at least one processor can execute any of the foregoing Geohash-based spatial data processing methods.
基于本申请的实施例,本申请实施例还提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,计算机指令用于使计算机执行根据本申请实施例提供的前述任一项的基于Geohash的空间数据处理方法。Based on the embodiments of the present application, the embodiments of the present application also provide a non-transient computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute any of the foregoing methods provided by the embodiments of the present application. Spatial data processing method based on Geohash.
图8示出了可以用来实施本申请的实施例的示例电子设备800的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。8 illustrates a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present application. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit the implementation of the present application as described and/or claimed herein.
如图8所示,设备800包括计算单元801,其可以根据存储在只读存 储器(ROM)802中的计算机程序或者从存储单元808加载到随机访问存储器(RAM)803中的计算机程序,来执行各种适当的动作和处理。在RAM 803中,还可存储设备800操作所需的各种程序和数据。计算单元801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8 , the device 800 includes a computing unit 801 that can execute according to a computer program stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 into a random access memory (RAM) 803 Various appropriate actions and treatments. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. Computing unit 801, ROM 802 and RAM 803 are connected to each other via bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
设备800中的多个部件连接至I/O接口805,包括:输入单元806,例如键盘、鼠标等;输出单元807,例如各种类型的显示器、扬声器等;存储单元808,例如磁盘、光盘等;以及通信单元809,例如网卡、调制解调器、无线通信收发机等。通信单元809允许设备800通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple 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 magnetic disk, optical disk, etc. ; and communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
计算单元801可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元801的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元801执行上文所描述的各个方法和处理,例如基于Geohash的空间数据处理方法。例如,在一些实施例中,基于Geohash的空间数据处理方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元808。在一些实施例中,计算机程序的部分或者全部可以经由ROM 802和/或通信单元809而被载入和/或安装到设备800上。当计算机程序加载到RAM 803并由计算单元801执行时,可以执行上文描述的基于Geohash的空间数据处理方法的一个或多个步骤。备选地,在其他实施例中,计算单元801可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行基于Geohash的空间数据处理方法。 Computing unit 801 may be a variety of general and/or special purpose processing components having 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 processing processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 executes each method and processing described above, such as a spatial data processing method based on Geohash. For example, in some embodiments, the Geohash-based spatial data processing method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or 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 Geohash-based spatial data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the Geohash-based spatial data processing method in any other suitable manner (eg, by means of firmware).
本文中以上描述的***和技术的各种实施方式可以在数字电子电路***、集成电路***、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上***的***(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程***上执行和/ 或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储***、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储***、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above may 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 a chip implemented in a system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or a combination thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may 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. An output device.
用于实施本申请的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
在本申请的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行***、装置或设备使用或与指令执行***、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体***、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of this application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
为了提供与用户的交互,可以在计算机上实施此处描述的***和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入、或者触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including acoustic input, voice input, or tactile input) to receive input from the user.
可以将此处描述的***和技术实施在包括后台部件的计算***(例如,作为数据服务器)、或者包括中间件部件的计算***(例如,应用服务器)、 或者包括前端部件的计算***(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的***和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算***中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将***的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)、互联网和区块链网络。The systems and techniques described herein may be implemented in a computing system that includes back-end 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 front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), the Internet, and blockchain networks.
计算机***可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务(″Virtual Private Server″,或简称″VPS″)中,存在的管理难度大,业务扩展性弱的缺陷。服务器也可以为分布式***的服务器,或者是结合了区块链的服务器。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other. The server can be a cloud server, also known as cloud computing server or cloud host. It is a host product in the cloud computing service system to solve the problem of traditional physical host and VPS service ("Virtual Private Server", or "VPS" for short) Among them, there are defects such as difficult management and weak business scalability. The server can also be a distributed system server or a server combined with a blockchain.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that various forms of the process shown above may be used, with steps reordered, added or deleted. For example, each step described in the disclosure of the present application can be executed in parallel, sequentially, or in a different order. As long as the desired results of the technical solution disclosed in the present application can be achieved, there is no limitation here.
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the scope of protection of the present application. It will be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions are possible depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application shall be included in the protection scope of this application.

Claims (19)

  1. 一种基于地理编码Geohash的空间数据处理方法,包括:A spatial data processing method based on geocoding Geohash, including:
    获取待处理的多个空间数据对象;Get multiple spatial data objects to be processed;
    根据预设的Geohash长度范围,分别对每个所述空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格;Segment each spatial data object at different levels according to the preset Geohash length range, and obtain at least one target Geohash grid after segmentation;
    根据所述至少一个目标Geohash网格,对所述多个空间数据对象进行比较;Comparing the plurality of spatial data objects based on the at least one target Geohash grid;
    根据比较结果确定所述多个空间数据对象各自对应的空间对象之间的空间位置关系。The spatial position relationship between the corresponding spatial objects of the plurality of spatial data objects is determined according to the comparison result.
  2. 根据权利要求1所述的方法,其中,所述Geohash长度范围中包括多个Geohash长度;所述根据预设的Geohash长度范围,分别对每个所述空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格,包括:The method according to claim 1, wherein the Geohash length range includes multiple Geohash lengths; and according to the preset Geohash length range, each spatial data object is segmented at different levels to obtain the segmentation. At least one target Geohash mesh after processing, including:
    按照所述多个Geohash长度从小到大的顺序,分别对每个所述空间数据对象进行分层切分,获取切分处理后的至少一个目标Geohash网格。Each of the spatial data objects is hierarchically segmented in order from small to large in length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained.
  3. 根据权利要求2所述的方法,其中,所述按照所述多个Geohash长度从小到大的顺序,分别对每个所述空间数据对象进行分层切分,获取切分处理后的至少一个目标Geohash网格,包括:The method according to claim 2, wherein each of the spatial data objects is hierarchically segmented according to the order of the plurality of Geohash lengths from small to large, and at least one target after segmentation is obtained. Geohash grid, including:
    针对每个所述空间数据对象,按照所述多个Geohash长度中的最小值,对所述空间数据对象进行切分处理;For each spatial data object, segment the spatial data object according to the minimum value among the multiple Geohash lengths;
    获取所述空间数据对象对应的第一Geohash网格;Obtain the first Geohash grid corresponding to the spatial data object;
    根据所述空间数据对象和所述第一Geohash网格的编码,确定所述空间数据对象对应的空间对象落入所述第一Geohash网格中的面积占比;According to the encoding of the spatial data object and the first Geohash grid, determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid;
    根据所述面积占比,在所述第一Geohash网格中确定出第一待切分Geohash网格;According to the area ratio, a first Geohash grid to be divided is determined in the first Geohash grid;
    按照所述多个Geohash长度之中其他长度,对所述第一待切分Geohash网格进行切分处理,并根据所述第一待切分Geohash网格的切分处理结果和所述第一Geohash网格中未被切分的网格,确定 所述空间数据对象对应的第二Geohash网格;The first Geohash mesh to be segmented is segmented according to other lengths among the multiple Geohash lengths, and the segmentation processing result of the first Geohash mesh to be segmented and the first Geohash mesh are segmented. For the unsegmented grid in the Geohash grid, determine the second Geohash grid corresponding to the spatial data object;
    将所述多个空间数据对象各自对应的第二Geohash网格,确定为所述至少一个目标Geohash网格。The second Geohash grid corresponding to each of the plurality of spatial data objects is determined as the at least one target Geohash grid.
  4. 根据权利要求3所述的方法,其中,根据所述空间数据对象和所述第一Geohash网格的编码,确定所述空间数据对象对应的空间对象落入所述第一Geohash网格中的面积占比,包括:The method according to claim 3, wherein the area of the spatial object corresponding to the spatial data object falling into the first Geohash grid is determined according to the encoding of the spatial data object and the first Geohash grid. proportion, including:
    根据所述空间数据对象对应的所述第一Geohash网格的编码,确定所述空间数据对象对应的第一Geohash网格的经纬度范围;Determine the latitude and longitude range of the first Geohash grid corresponding to the spatial data object according to the encoding of the first Geohash grid corresponding to the spatial data object;
    根据所述空间数据对象,以及所述第一Geohash网格的经纬度范围,计算所述空间数据对象对应的空间对象落入所述第一Geohash网格中的面积;According to the spatial data object and the latitude and longitude range of the first Geohash grid, calculate the area of the spatial object corresponding to the spatial data object falling into the first Geohash grid;
    将所述空间对象落入所述第一Geohash网格中的面积与第一Geohash网格的面积的比值,作为所述空间数据对象对应的空间对象落入第一Geohash网格中的面积占比。The ratio of the area of the spatial object falling into the first Geohash grid to the area of the first Geohash grid is used as the proportion of the area of the spatial object corresponding to the spatial data object falling into the first Geohash grid. .
  5. 根据权利要求3所述的方法,其中,所述根据所述面积占比,在所述第一Geohash网格中确定出第一待切分Geohash网格,包括:The method according to claim 3, wherein determining the first Geohash grid to be divided in the first Geohash grid according to the area ratio includes:
    将所述面积占比与预设阈值进行比对,并将小于所述阈值的面积占比对应的第一Geohash网格确定为第一待切分Geohash网格。The area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
  6. 根据权利要求3所述的方法,其中,所述按照所述多个Geohash长度之中其他长度,对所述第一待切分Geohash网格进行切分处理,包括:The method according to claim 3, wherein said segmenting the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths includes:
    从所述其他长度中确定出第一最小值,将所述第一最小值作为新的最小值,将落入所述第一待切分Geohash网格中的部分空间数据对象作为新的空间数据对象;Determine the first minimum value from the other lengths, use the first minimum value as the new minimum value, and use the partial spatial data objects falling in the first Geohash grid to be divided as new spatial data object;
    返回执行所述按照所述多个Geohash长度中的最小值,对所述空间数据对象进行切分处理的步骤;Return to perform the step of segmenting the spatial data object according to the minimum value among the multiple Geohash lengths;
    直至当前切分所使用的Geohash长度为所述多个Geohash长度中的最大值,或者,所述空间对象落入当前第一Geohash网格中的面积占比大于或等于阈值为止。Until the Geohash length used for current segmentation is the maximum value among the multiple Geohash lengths, or the area proportion of the spatial object falling into the current first Geohash grid is greater than or equal to the threshold.
  7. 根据权利要求1所述的方法,其中,所述根据所述至少一个目标Geohash网格,对所述多个空间数据对象进行比较,包括:The method of claim 1, wherein the comparing the plurality of spatial data objects according to the at least one target Geohash grid includes:
    针对所述至少一个目标Geohash网格中的每个目标Geohash网格,确定所述至少一个目标Geohash网格中是否存在精度小于所述目标Geohash网格的第一目标Geohash网格,且所述目标Geohash网格落入所述第一目标Geohash网格中;For each target Geohash grid in the at least one target Geohash grid, determine whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than the target Geohash grid, and the target The Geohash grid falls into the first target Geohash grid;
    响应于所述至少一个目标Geohash网格中存在所述第一目标Geohash网格,确定所述目标Geohash网格和所述第一目标Geohash网格各自对应的目标空间数据对象;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;
    响应于所述至少一个目标Geohash网格中未存在所述第一目标Geohash网格,确定所述目标Geohash网格对应的目标空间数据对象;In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining the target spatial data object corresponding to the target Geohash grid;
    将所述目标空间数据对象进行两两比较。Compare the target space data objects pairwise.
  8. 根据权利要求1所述的方法,其中,获取待处理的多个空间数据对象包括:The method according to claim 1, wherein obtaining a plurality of spatial data objects to be processed includes:
    获取通过交互界面上传的待处理的所述多个空间数据对象;或Obtain the multiple spatial data objects to be processed uploaded through the interactive interface; or
    从采集端接收待处理的所述多个空间数据对象。The plurality of spatial data objects to be processed are received from the collection end.
  9. 根据权利要求1所述的方法,其中,根据预设的Geohash长度范围,分别对每个所述空间数据对象进行不同层级切分之前,还包括:The method according to claim 1, wherein before segmenting each spatial data object into different levels according to the preset Geohash length range, it further includes:
    通过终端设备的交互页面设定所述预设的Geohash长度范围,或在程序中设定所述预设的Geohash长度范围。The preset Geohash length range is set through the interactive page of the terminal device, or the preset Geohash length range is set in the program.
  10. 根据权利要求9所述的方法,还包括:The method of claim 9, further comprising:
    根据应用场景调整所述Geohash长度范围。Adjust the Geohash length range according to the application scenario.
  11. 根据权利要求1所述的方法,根据比较结果确定所述多个空间数据对象各自对应的空间对象之间的空间位置关系,包括:The method according to claim 1, determining the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison results, including:
    如果两个空间数据对象分别对应不同的目标Geohash网格,则该两个空间数据对象各自对应的空间对象的空间位置既非相交关系也非包含关系,如果两个空间数据对象均对应相同的目标Geohash 网格,则该两个空间数据对象各自对应的空间对象的空间位置关系为相交关系或包含关系。If two spatial data objects respectively correspond to different target Geohash grids, the spatial positions of the spatial objects corresponding to the two spatial data objects are neither intersecting nor inclusive. If both spatial data objects correspond to the same target Geohash grid, then the spatial position relationship of the corresponding spatial objects of the two spatial data objects is an intersection relationship or an inclusion relationship.
  12. 一种基于Geohash的空间数据处理装置,包括:A spatial data processing device based on Geohash, including:
    第一获取模块,设置为获取待处理的多个空间数据对象;The first acquisition module is configured to acquire multiple spatial data objects to be processed;
    第二获取模块,设置为根据预设的Geohash长度范围,分别对每个所述空间数据对象进行不同层级切分,获取切分处理后的至少一个目标Geohash网格;The second acquisition module is configured to segment each of the spatial data objects at different levels according to the preset Geohash length range, and acquire at least one target Geohash grid after segmentation;
    比较模块,设置为根据所述至少一个目标Geohash网格,对所述多个空间数据对象进行比较;A comparison module configured to compare the plurality of spatial data objects according to the at least one target Geohash grid;
    确定模块,设置为根据比较结果确定所述多个空间数据对象各自对应的空间对象之间的空间位置关系。The determination module is configured to determine the spatial position relationship between the spatial objects corresponding to the plurality of spatial data objects according to the comparison result.
  13. 根据权利要求12所述的装置,其中,所述Geohash长度范围中包括多个Geohash长度;所述第二获取模块具体设置为:The device according to claim 12, wherein the Geohash length range includes multiple Geohash lengths; the second acquisition module is specifically configured to:
    按照所述多个Geohash长度从小到大的顺序,分别对每个所述空间数据对象进行分层切分,获取切分处理后的至少一个目标Geohash网格。Each of the spatial data objects is hierarchically segmented in order from small to large in length of the plurality of Geohash, and at least one target Geohash grid after segmentation is obtained.
  14. 根据权利要求13所述的装置,其中,所述第二获取模块包括:The device according to claim 13, wherein the second acquisition module includes:
    第一切分单元,设置为针对每个所述空间数据对象,按照所述多个Geohash长度中的最小值,对所述空间数据对象进行切分处理;The first slicing unit is configured to, for each spatial data object, segment the spatial data object according to the minimum value among the multiple Geohash lengths;
    获取单元,设置为获取所述空间数据对象对应的第一Geohash网格;The acquisition unit is configured to acquire the first Geohash grid corresponding to the spatial data object;
    第一确定单元,设置为根据所述空间数据对象和所述第一Geohash网格的编码,确定所述空间数据对象对应的空间对象落入所述第一Geohash网格中的面积占比;A first determination unit configured to determine the area proportion of the spatial object corresponding to the spatial data object falling into the first Geohash grid based on the encoding of the spatial data object and the first Geohash grid;
    第二确定单元,设置为根据所述面积占比,在所述第一Geohash网格中确定出第一待切分Geohash网格;The second determination unit is configured to determine the first Geohash grid to be divided in the first Geohash grid based on the area ratio;
    第二切分单元,设置为按照所述多个Geohash长度之中其他长度,对所述第一待切分Geohash网格进行切分处理;The second segmentation unit is configured to segment the first Geohash grid to be segmented according to other lengths among the plurality of Geohash lengths;
    第三确定单元,设置为根据所述第一待切分Geohash网格的切 分处理结果和所述第一Geohash网格中未被切分的网格,确定所述空间数据对象对应的第二Geohash网格;The third determination unit is configured to determine the second location corresponding to the spatial data object based on the segmentation processing result of the first Geohash grid to be segmented and the unsegmented grids in the first Geohash grid. Geohash grid;
    第四确定单元,设置为将所述多个空间数据对象各自对应的第二Geohash网格,确定为所述至少一个目标Geohash网格。The fourth determination unit is configured to determine the second Geohash grid corresponding to each of the plurality of spatial data objects as the at least one target Geohash grid.
  15. 根据权利要求14所述的装置,其中,所述第二确定单元具体设置为:The device according to claim 14, wherein the second determining unit is specifically configured to:
    将所述面积占比与预设阈值进行比对,并将小于所述阈值的面积占比对应的第一Geohash网格确定为第一待切分Geohash网格。The area proportion is compared with a preset threshold, and the first Geohash grid corresponding to the area proportion less than the threshold is determined as the first Geohash grid to be segmented.
  16. 根据权利要求14所述的装置,其中,所述第二切分单元具体设置为:The device according to claim 14, wherein the second slicing unit is specifically configured to:
    从所述其他长度中确定出第一最小值,将所述第一最小值作为新的最小值,将落入所述第一待切分Geohash网格中的部分空间数据对象作为新的空间数据对象;Determine the first minimum value from the other lengths, use the first minimum value as the new minimum value, and use the partial spatial data objects falling in the first Geohash grid to be divided as new spatial data object;
    其中,所述第一切分单元还设置为按照所述新的最小值,对所述新的空间数据对象进行切分处理。Wherein, the first segmentation unit is further configured to segment the new spatial data object according to the new minimum value.
  17. 根据权利要求12所述的装置,其中,所述比较模块具体设置为:The device according to claim 12, wherein the comparison module is specifically configured to:
    针对所述至少一个目标Geohash网格中的每个目标Geohash网格,确定所述至少一个目标Geohash网格中是否存在精度小于所述目标Geohash网格的第一目标Geohash网格,且所述目标Geohash网格落入所述第一目标Geohash网格中;For each target Geohash grid in the at least one target Geohash grid, determine whether there is a first target Geohash grid in the at least one target Geohash grid that is less accurate than the target Geohash grid, and the target The Geohash grid falls into the first target Geohash grid;
    响应于所述至少一个目标Geohash网格中存在所述第一目标Geohash网格,确定所述目标Geohash网格和所述第一目标Geohash网格各自对应的目标空间数据对象;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;
    响应于所述至少一个目标Geohash网格中未存在所述第一目标Geohash网格,确定所述目标Geohash网格对应的目标空间数据对象;In response to the first target Geohash grid not existing in the at least one target Geohash grid, determining the target spatial data object corresponding to the target Geohash grid;
    将所述目标空间数据对象进行两两比较。Compare the target space data objects pairwise.
  18. 一种电子设备,包括:An electronic device including:
    至少一个处理器;以及at least one processor; and
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1至11中任一项所述的方法。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 perform any one of claims 1 to 11 Methods.
  19. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行权利要求1至11中任一项所述的方法。A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in any one of claims 1 to 11.
PCT/CN2022/142125 2022-03-30 2022-12-26 Geohash-based spatial-data processing method and apparatus, and electronic device WO2023185144A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210336552.4 2022-03-30
CN202210336552.4A CN114691691A (en) 2022-03-30 2022-03-30 Geohash-based spatial data processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2023185144A1 true WO2023185144A1 (en) 2023-10-05

Family

ID=82141258

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/142125 WO2023185144A1 (en) 2022-03-30 2022-12-26 Geohash-based spatial-data processing method and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN114691691A (en)
WO (1) WO2023185144A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691691A (en) * 2022-03-30 2022-07-01 杭州数梦工场科技有限公司 Geohash-based spatial data processing method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170068689A1 (en) * 2015-09-07 2017-03-09 Casio Computer Co., Ltd. Geographic coordinate encoding device, method, and storage medium, geographic coordinate decoding device, method, and storage medium, and terminal unit using geographic coordinate encoding device
CN111522892A (en) * 2019-02-02 2020-08-11 阿里巴巴集团控股有限公司 Geographic element retrieval method and device
CN111831769A (en) * 2020-06-18 2020-10-27 汉海信息技术(上海)有限公司 Track processing method and device, electronic equipment and storage medium
CN114691691A (en) * 2022-03-30 2022-07-01 杭州数梦工场科技有限公司 Geohash-based spatial data processing method and device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170068689A1 (en) * 2015-09-07 2017-03-09 Casio Computer Co., Ltd. Geographic coordinate encoding device, method, and storage medium, geographic coordinate decoding device, method, and storage medium, and terminal unit using geographic coordinate encoding device
CN111522892A (en) * 2019-02-02 2020-08-11 阿里巴巴集团控股有限公司 Geographic element retrieval method and device
CN111831769A (en) * 2020-06-18 2020-10-27 汉海信息技术(上海)有限公司 Track processing method and device, electronic equipment and storage medium
CN114691691A (en) * 2022-03-30 2022-07-01 杭州数梦工场科技有限公司 Geohash-based spatial data processing method and device and electronic equipment

Also Published As

Publication number Publication date
CN114691691A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
WO2022213580A1 (en) Map generation method and apparatus, and electronic device and storage medium
CN112233240B (en) Three-dimensional vector data slicing method and device of three-dimensional vector map and electronic equipment
WO2022247165A1 (en) Coding method and apparatus for geographic location area, and method and apparatus for establishing coding model
US11861919B2 (en) Text recognition method and device, and electronic device
US10157219B2 (en) Geographical map-based visualization of big data
WO2023185144A1 (en) Geohash-based spatial-data processing method and apparatus, and electronic device
WO2022193872A1 (en) Method and apparatus for determining spatial relationship, computer device, and storage medium
WO2022237821A1 (en) Method and device for generating traffic sign line map, and storage medium
KR20230139296A (en) Method and apparatus for training point cloud processing model and partitioning point cloud instances
JP7357114B2 (en) Training method, device, electronic device and storage medium for living body detection model
EP4155670A1 (en) Intersection vertex height value acquisition method and apparatus, electronic device and storage medium
US12007965B2 (en) Method, device and storage medium for deduplicating entity nodes in graph database
WO2022227760A1 (en) Image retrieval method and apparatus, electronic device and computer-readable storage medium
CN112948517B (en) Regional position calibration method and device and electronic equipment
CN115527028A (en) Map data processing method and device
CN115687587A (en) Internet of things equipment and space object association matching method, device, equipment and medium based on position information
US20230013055A1 (en) Method for determining region attribute information, computing device, and storage medium
US20220237474A1 (en) Method and apparatus for semanticization, electronic device and readable storage medium
US20230196674A1 (en) Method and apparatus for processing three dimentional graphic data, device, storage medium and product
EP4036861A2 (en) Method and apparatus for processing point cloud data, electronic device, storage medium, computer program product
CN114840721B (en) Data searching method and device and electronic equipment
CN113868555A (en) Track retrieval method, device, equipment and storage medium
US11835356B2 (en) Intelligent transportation road network acquisition method and apparatus, electronic device and storage medium
US20220333931A1 (en) Road network data processing method, electronic device, and storage medium
JP7427120B2 (en) Feature image processing method, device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22934958

Country of ref document: EP

Kind code of ref document: A1