Spatial matching acceleration method for specific area range and Internet of Things equipment
By converting the WKT data and latitude and longitude information in the MPP database into S2Cell ID and forming an index structure, the problem of insufficient rapid matching capabilities between facilities and equipment in a specific area is solved, and efficient and accurate matching effect is achieved.
Patent Information
- Application Number
- CN202411878841.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-25
AI Technical Summary
The MPP database has insufficient ability to quickly match facilities and equipment within a specific area, mainly due to the lack of efficient spatial indexing mechanism.
Using a spatial fill curve-based method, the WKT data and the latitude and longitude information of the device in a specific area are converted into S2Cell IDs, and a quick search and matching index structure is formed through sorting and indexing to achieve preliminary and precise matching.
It significantly improves the matching speed between facilities and equipment within a specific area, ensures the accuracy of matching results, and has good scalability, and is suitable for other scenarios that require spatial matching.
Smart Images

Figure CN119691001A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a spatiotemporal big data technology, and in particular to a method for accelerating the spatial matching between a specific area range and an Internet of Things device based on a space filling curve. Background Art
[0002] With the acceleration of urbanization, there are many special areas in urban development, and the management of their internal facilities and equipment has become increasingly complex. In order to improve the efficiency of matching specific areas with equipment, existing technologies usually rely on the spatial indexing function of relational databases. However, although MPP databases perform well in processing large-scale data, they lack an efficient spatial indexing mechanism. This limits its ability to quickly match facilities and equipment within a specific area. Summary of the invention
[0003] Aiming at the low efficiency of spatial indexing function of relational database in matching specific area ranges with devices in a city, a method for accelerating spatial matching between specific area ranges and IoT devices was proposed.
[0004] The technical solution of the present invention is:
[0005] A method for accelerating spatial matching between a specific area range and an IoT device comprises the following steps:
[0006] Step 1: Data collection: Extract WKT data and latitude and longitude information of equipment in a specific area from the MPP database;
[0007] Step 2: Data conversion: Convert the WKT format data of a specific area range and the latitude and longitude information of the device into an S2Cell ID. This step involves converting the geographic coordinate system into the hierarchical structure of S2 and generating a unique 64-bit integer representation.
[0008] Step 3: Sorting and indexing: Sort the area range and the S2 Cell ID converted from the device longitude and latitude respectively to form an index based on the S2 Cell ID for fast retrieval and matching;
[0009] Step 4: Preliminary matching: Using the sorted S2 Cell ID index, perform preliminary matching of facilities and equipment within a specific area through connections within the MPP database. This step quickly screens out possible spatially adjacent devices by comparing the prefix of the S2Cell ID.
[0010] Step 5: Precise matching: For the preliminarily matched devices, the spatial matching function of the MPP database is used to further perform precise spatial matching to confirm whether the device is actually located within the specific area.
[0011] The beneficial effects of the present invention are:
[0012] The method of the present invention effectively solves the shortcomings of the MPP database in spatial indexing by utilizing the characteristics of the space filling curve. Through the two-step strategy of preliminary matching and precise matching, not only the matching speed is greatly improved, but also the accuracy of the matching results is guaranteed. In addition, the algorithm has good scalability and can be applied to other scenarios that require spatial matching, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a logic diagram of the acceleration method for spatial matching of a specific area range and an IoT device of the present invention. DETAILED DESCRIPTION
[0014] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0015] MPP database: Massively Parallel Processing database is a special type of database system designed to process large-scale data and achieve high performance and scalability.
[0016] S2 cell id: S2 space filling curve is a special algorithm for solving geometric problems on spheres. S2 uses quadtree for spatial indexing. Each non-bottom-level spatial unit (cell) has four subcells. Each cell has its own specific id, which is used for naming and identification.
[0017] A method for accelerating the spatial matching of a specific area range and IoT devices, such as Figure 1 As shown, the specific steps are as follows:
[0018] Step 1: Extract the WKT data of a specific area and the latitude and longitude information of the equipment from the MPP database.
[0019] Step 2: Use the S2 library to convert the WKT data and longitude and latitude information into S2 Cell IDs respectively.
[0020] Step 3: Sort the area range and the S2 Cell ID converted from the device longitude and latitude to form an index.
[0021] Step 4: Perform preliminary matching through the index to filter out specific area ranges and devices with the same S2 Cell ID.
[0022] Step 5: For the selected devices, use the database space matching function to perform precise space matching to ensure the accuracy of the matching results.
[0023] Efficiency optimization: Through the above steps, the algorithm significantly improves the matching speed, and the efficiency is improved by dozens of times compared with traditional methods.
[0024] Experimental data:
[0025] Dataset: 50 million devices and longitude and latitude data, 300 urban village range data in a city.
[0026] Hardware: Processor: 4-core 2.7GHz Intel Xeon Scalable processor, memory: 8GB
[0027] Hard disk: 1 local HDD, 100GB of space
[0028] Operating system: CentOS7.9
[0029] Database: Starrocks3.2
[0030] Comparison of test results:
[0031]
[0032] The two methods were tested three times respectively. From the above test results, it can be seen that the query speed of the present invention is 12.7 times faster than that of using the spatial matching function provided by the database.
[0033] The above-mentioned embodiment only expresses one implementation mode of the present invention, and its description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A method for accelerating spatial matching between a specific area and an IoT device, characterized in that: The following steps are involved: Step 1: Data collection: Extract WKT data and latitude and longitude information of equipment in a specific area from the MPP database; Step 2: Data conversion: Convert the WKT format data of a specific area range and the latitude and longitude information of the device into S2 CellID; this step involves converting the geographic coordinate system into the hierarchical structure of S2 and generating a unique 64-bit integer representation; Step 3: Sorting and indexing: Sort the area range and the S2 Cell ID converted from the device longitude and latitude respectively to form an index based on the S2 Cell ID for fast retrieval and matching; Step 4: Preliminary matching: Using the sorted S2 Cell ID index, perform preliminary matching of facilities and equipment within a specific area through connections within the MPP database. This step quickly screens out possible spatially adjacent devices by comparing the prefix of the S2Cell ID. Step 5: Precise matching: For the preliminarily matched devices, the spatial matching function of the MPP database is used to further perform precise spatial matching to confirm whether the device is actually located within the specific area.